[Glade-users] get/set GTK widget properties.



Hello everyone!

I'm using Glade to make the GUI (actually it's made), as a result I 
don't have much idea about the coding part (in C) neither there are any 
tutorials which focus on the coding part with Glade, most of them being 
Python based.

How do you change/set the property of a widget? For e.g. a button label, 
or read buffer text in an input box?

I've realized that every widget type has a dedicated structure assigned 
to it, for e.g. Gtkbutton, or GtkEntry, and each widget has properties, 
e.g. --

https://developer.gnome.org/gtk3/3.2/GtkButton.html#GtkButton.properties

But how do you get or change these properties? The structure of the 
widget does not have have these elements, as a result you can't 
GtkEntry.buffer.

So how do you access these properties?

I've noticed these functions --

gtk_button_get_label
gtk_button_set_use_stock
gtk_button_set_image
...

Which may be used to modify the widget properties, but I get --

"(a.out:23415): Gtk-CRITICAL **: gtk_entry_get_text: assertion 
`GTK_IS_ENTRY (entry)' failed"

on

gtk_entry_get_text(test);

In function --

void test_func(GtkEntry *test)

Where glade is set to run this function and pass "entry2" (in "user 
data" of the signals tab) on event GtkButton > released.

If this's how you get/set properties, then of what use are the 
properties as listed in --

https://developer.gnome.org/gtk3/3.2/GtkButton.html#GtkButton.properties

Thankyou for the help, I need this to be fixed quick.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]