gtk

Pass received argument to a callback function

夙愿已清 提交于 2020-01-16 19:32:12
问题 I am working on a Gtk project in C. From the main.c I call a function1 with an int address as a parameter. In that function1 , I can access that first value, but then at the end (inside) of that function1 , I call another function2 (which is a callback function to a click event) and pass it the address I got from the function1 parameter. But in function2 , the address have changed, definitely can't figure out why ... My project looks like this : [main.c] int main(...) { int a = 50; function1(

How can I change the thickness of a gtkwidget?

♀尐吖头ヾ 提交于 2020-01-16 18:06:09
问题 This image shows a scene in my current app. It looks dumb. The empty gtk list is only taking half the screen. How can I make it take four fifths of the screen and the done button take up one fifth? I am using the C programming language as always and gtk3 which I just upgraded to. I am also having trouble with fat text entries, if there is a way to ajust the thickness of widgets. Making it homogeneous makes them all the same, but how can I make it NOT homogeneous but let me decide how much of

How can I change the thickness of a gtkwidget?

左心房为你撑大大i 提交于 2020-01-16 18:04:06
问题 This image shows a scene in my current app. It looks dumb. The empty gtk list is only taking half the screen. How can I make it take four fifths of the screen and the done button take up one fifth? I am using the C programming language as always and gtk3 which I just upgraded to. I am also having trouble with fat text entries, if there is a way to ajust the thickness of widgets. Making it homogeneous makes them all the same, but how can I make it NOT homogeneous but let me decide how much of

GTK Text to entry

跟風遠走 提交于 2020-01-16 08:37:18
问题 After having a look at firefox's history window, i saw something which i want to implement to my own entry: How can I make the default text in the entry faded like that? 回答1: In GTK+ it's called placeholder text, available in GtkEntry since GTK+ 3.2. 回答2: Here's an implementation for GTK versions earlier than 3.2: https://github.com/ptomato/gnome-inform7/blob/master/src/placeholder-entry.c 来源: https://stackoverflow.com/questions/9153086/gtk-text-to-entry

GTK Text to entry

你离开我真会死。 提交于 2020-01-16 08:37:06
问题 After having a look at firefox's history window, i saw something which i want to implement to my own entry: How can I make the default text in the entry faded like that? 回答1: In GTK+ it's called placeholder text, available in GtkEntry since GTK+ 3.2. 回答2: Here's an implementation for GTK versions earlier than 3.2: https://github.com/ptomato/gnome-inform7/blob/master/src/placeholder-entry.c 来源: https://stackoverflow.com/questions/9153086/gtk-text-to-entry

how to add text box in gtkmm:gtk::Listbox using c++

情到浓时终转凉″ 提交于 2020-01-16 01:05:12
问题 I want to add this type of text in Listbox using Gtkmm in c++. Can you suggest me any way how to do it, please? 回答1: For this very simple case, you might want to use gtkmm's ListViewText widget: https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListViewText.html Here is some example code: https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/treeview/listviewtext/examplewindow.cc However, if you want to do anything more complex, you'd need to use the full Gtk::TreeView class.

Update GTK+ MenuItem Countdown Each Second, and Periodic Function Call

…衆ロ難τιáo~ 提交于 2020-01-15 11:46:25
问题 This is my International Space Station indicator. I am trying to create a GTK MenuItem that displays a countdown. This wil be in an Ubuntu Unity indicator using AppIndicator3. I want this MenuItem ( futpass )to refresh each second (i.e., countdown appears in real time), but also want it to stay inactive when the menu is not selected so as to not consume system resources. Problem is, I can't get it to refresh on its own. Because there is a long wait period between each time checkiss needs to

Ubuntu 12.10 libgtk-3-0 Missing Symbols

妖精的绣舞 提交于 2020-01-15 08:33:28
问题 I am running Ubuntu 12.10 and somehow my libgtk-3-0 became screwed up. When trying to run many different apps, I get errors like: gedit: symbol lookup error: /usr/lib/libgtk-3.so.0: undefined symbol: g_action_group_action_state_changed I've tried to reinstall libgtk-3-0: sudo apt-get install --reinstall libgtk-3-0 sudo apt-get update sudo apt-get upgrade But still I get this problem - several undefined symbols from libgtk-3.so.0 when trying to run various apps. There is no problem booting the

yocto编译bug1)

≡放荡痞女 提交于 2020-01-14 19:42:36
ERROR: gtk+3-3.22.30-r0 do_compile: oe_runmake failed 引用文本 ERROR: gtk+3-3.22.30-r0 do_compile: oe_runmake failed ERROR: gtk+3-3.22.30-r0 do_compile: Function failed: do_compile (log file is located at /home/cy/stm32/yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/gtk+3/3.22.30-r0/temp/log.do_compile.32594) ERROR: Logfile of failure stored in: /home/cy/stm32/yocto/build-openstlinuxweston-stm32mp1/tmp-glibc/work/cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi/gtk+3/3.22.30-r0/temp/log.do_compile.32594 Log data follows: |

How to resize a Gtk.Image in vala

╄→гoц情女王★ 提交于 2020-01-14 19:30:27
问题 I'm trying to resize a Image in vala. So I read valadoc and end up writing this code var img = new Gtk.Image.from_file ("fire.png"); var pix_buf = img.get_pixbuf (); pix_buf.scale_simple (50, 50, InterpType.BILINEAR); window.add (img); But it has no effect. If there is a way to dynamically scale the image so that it fill his container it would be awesome, but just scaling it would be fine. 回答1: Pixbuf.scale_simple does not modify the image. It returns a new Pixbuf that has been scaled. Use