[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 
glade_xml_get_widget.

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).

Cheers,
                                         -Tristan




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