How to determine the type of a widget?



Hi,

Question: how can I determine the type of a widget
when all I know is that it is a GtkWidget? i.e. it may
be a GtkButton, GtkFrame, etc.

For example, gtk_container_get_children will give me a GList
of widget objects. I need to know what are the type of those
widgets so I can dispatch the correct methods.

	switch (get_the_type_of_this_widget (w))
	{
		case XXX:  ...
		case YYY: ...
		... etc.
	}

This has to do with implementing GTK in a programming
language, so basically I need to be able to map the Gtk
class to some internal class.

I tried to dig into the manual for an easy solution but
I cant seem to find any. Or maybe I miss something?

Thanks in advance,
marc




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