[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk-app-devel
Subject:    Re: Type of widget
From:       Tim =?iso-8859-1?q?M=FCller?= <zen18864 () zen ! co ! uk>
Date:       2004-03-31 2:33:12
Message-ID: 200403310333.12358.zen18864 () zen ! co ! uk
[Download RAW message or body]

On Wednesday 31 March 2004 02:57, Russell Shaw wrote:

> If i define a GtkWidget as: item=gtk_label_new("thing") or
> item=gtk_button_new(), how can i find later whether "item"
> is a label or a button?

     if (GTK_IS_BUTTON(item))
     {
          g_print("item is a button.\n");
     }

etc.

or

    g_print("item is of type '%s'\n", g_type_name(G_OBJECT_TYPE(item)));

Cheers
-Tim
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic