gtk2

How to refresh, redraw a window (widget) in gtk?

最后都变了- 提交于 2019-12-11 03:53:29
问题 I am using Opensuse 13.1 Linux Os. I am new to gtk2 and c. I am trying to create a application that can place a button on a table which is attached as per the values typed by the user. My program code is as following #include <stdlib.h> #include <gtk/gtk.h> typedef struct { GtkWidget *value1, *value2, *value3, *value4; } entrygrouped; guint ival1, ival2, ival3, ival4; void button_clicked(entrygrouped *widget) { const gchar *value1, *value2, *value3, *value4; value1 = gtk_entry_get_text (GTK

Need example/help with GtkTextBuffer (of GtkTextView) serialize/deserialize

佐手、 提交于 2019-12-11 03:05:07
问题 I am trying to save user's bold/italic/font/etc tags in a GtkTextView. Using GtkTextBuffer.get_text() does not return the tags. The best documentation I have found on this is: http://www.pygtk.org/docs/pygtk/class-gtktextbuffer.html#method-gtktextbuffer--register-serialize-format However, I do not understand the function arguments. It would be infinitely handy to have an example of how these are used to save/load a textview with tags in it. Edit: I would like to clarify what I am trying to

Get Pixel Position of Item or Cell Height in Treeview

醉酒当歌 提交于 2019-12-11 02:49:17
问题 In a GTK# application, I am using a TreeView inside a ScrolledWindow, and try to find the position of an item inside the TreeStore to draw lines starting from that item in Cairo. For now, I am using a hard coded value for cell height, which works for few items, but when other font sizes are used or the item list gets longer, there is a visible offset. Is there a method to get the cell height of a TreeView, or another way to get the vertical position of an item in the TreeStore? Here is the

Can someone explain Gtk2 packing?

廉价感情. 提交于 2019-12-11 02:07:35
问题 I need to use Gtk2 for a project. I will be using python/ruby for it. The problem is that packing seems kind of mystical to me. I tried using a VBox so that I could have the following widgets in my window ( in the following order ): menubar toolbar text view/editor control I've managed to "guess" my way with pack_start and get the layout I need, but I'd like to be able to understand it. The documentation at Ruby Gtk2 seems way too unintuitive (and so is the python one, since it's the same,

Gtk-ERROR **: GTK+ 2.x symbols detected

自古美人都是妖i 提交于 2019-12-10 16:15:52
问题 I'm compiling my c application with gcc with the following flags: gcc evis.c `pkg-config --cflags --libs gtk+-2.0 --libs clutter-gtk-1.0 --libs gthread-2.0` -Wall -o evis Now my code compiles with a few warnings but still finishes. When I try to run my program I get: (evis:1820): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported How do I troubleshoot this error? How do I know where to look? Is there some kind of tool I could use online

Learning GUI programming with GTK+2 or GTK+3?

牧云@^-^@ 提交于 2019-12-08 17:59:25
问题 I am new to GUI programming, and I haven't found yet what library is best for my purpose (i want to make desktop environment applications, eg. docks, panels, desklets etc.) I have started learning basics of GTK, mainly using PyGtk. Most tutorials i found on line are for GTK+2.0. Recently however, GTK+3 has been released. So i am a bit unsure as to what that means for my learning curve: Should i learn using GTK+3 and forget about GTK+2? Does using one or the other really makes a difference

OCaml-Wodi Part 2: Compiling using what was installed

只愿长相守 提交于 2019-12-08 12:13:13
问题 I am trying to compile a very small vignette to see how lablgtk2 works. (* file: base.ml *) let main () = let window = GWindow.window () in window#show (); GMain.Main.main () let _ = main () I have it properly installed via the wodi32 package manager and checked the pgk-lib folder to see that there are gMain.cmx/cmi and gWindow.cmx/cmi files (as well as the respective .ml and .mli files). However, when I run the following compile command: $ ocamlc -I +lablgtk2 -o base lablgtk.cma gtkInit.cmo

GTK+ (2.0) - signal “clicked” on GtkEntry?

安稳与你 提交于 2019-12-07 11:30:10
问题 I'm testing some signals with GTK+ 2.0. I'm looking for a way to get a signal emitted when I click on a GtkEntry. if (widgets_info[i].action & IG_INPUT) { widget->frame[i] = gtk_entry_new_with_max_length(MAX_INPUT_LENGTH); gtk_entry_set_text(widget->frame[i], widgets_info[i].text); catch_signal(widget->frame[i], MY_SIGNAL, &change_entry, widget); } I have a pre-selected text in my entry ( widgets_info[i].text ) and i want this text to disappear if the user click on my GtkEntry. Does someone

How can I change the font size in GTK?

前提是你 提交于 2019-12-07 00:28:42
问题 Is there an easy way to change the font size of text elements in GTK? Right now the best I can do is do set_markup on a label, with something silly like: lbl.set_markup("<span font_desc='Tahoma 5.4'>%s</span>" % text) This 1) requires me to set the font , 2) seems like a lot of overhead (having to parse the markup), and 3) would make it annoying to change the font size of buttons and such. Is there a better way? 回答1: If you want to change font overall in your app(s), I'd leave this job to

GTK+ (2.0) - signal “clicked” on GtkEntry?

坚强是说给别人听的谎言 提交于 2019-12-05 16:58:04
I'm testing some signals with GTK+ 2.0. I'm looking for a way to get a signal emitted when I click on a GtkEntry. if (widgets_info[i].action & IG_INPUT) { widget->frame[i] = gtk_entry_new_with_max_length(MAX_INPUT_LENGTH); gtk_entry_set_text(widget->frame[i], widgets_info[i].text); catch_signal(widget->frame[i], MY_SIGNAL, &change_entry, widget); } I have a pre-selected text in my entry ( widgets_info[i].text ) and i want this text to disappear if the user click on my GtkEntry. Does someone know what is this signal? (Sorry for my English) Try focus-in-event , note that you must enable focus