[Glade-users] Getting pointer to GtkWindow

David Sveningsson wrote:

Do I have to typecast it then? It give a warning: "assignment from 
incompatible pointer type" when I assign the return value from 

Typicly you will declare everything as `GtkWidget *' and then only
cast them when using their functions; like:

GtkWidget *window;

if ((window = glade_xml_get_widget (xml, "toplevel")) != NULL) {
    gtk_window_present (GTK_WINDOW (window));

Since so many functions take `GtkWidget *' as an argument, its
generally easier to just declare everything `GtkWidget *'
(less casting all in all then doing it backwards).


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