Re: modifiable dialog button labels?

On Wed, 7 Mar 2012, Lance Dillon wrote:

you can use gtk_get_action_area() to get the GtkBox that that is the action
area, that itself contains the buttons.  I believe you can then get all the
child widgets, which would be the GtkButtons.

The  docs for GtkDialog describes it some, but doesn't talk about getting the
buttons.  I think you would have to go to the page for GtkBox for how to get
the children.

Hi Lance,

The GtkDialog documentation tells only how to access the action area, not its children. Searching around I see a gtk_container_get_children() which presumably returns a list of GtkWidget pointers. Is there a way I can look at a widget pointer and detrmine the widget's type, i.e., figure out whether or not it's a button? I see references to a gtk_widget_get_type() on the web, but no good examples of how it's used, and it appears to be not present at all in my own GTK release's GtkWidget documentation. There also seem to be some related type discovery functions in the gobject library such as g_type(), etc., but so far I have not found any useful examples of how I might use them to figure out if any particular widget pointer is a button or not.



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