Re: libglade question



On Fri, 25 May 2001, Andrei Zmievski wrote:

> On Fri, 25 May 2001, Corey Thornburg wrote:
> > On each window in glade, set the visible prperties to no, it is under
> > Common in the properties dialog.  This etermines wether the widget is
> > visible on startup or not.
>
> Ok, and how do I make it visible after I load it up and change some
> things in the tree a bit?

This example should work, if not forgive me, most of my Gtk work is done
in Perl.


#include <gtk/gtk.h>
#include <glade/glade.h>

 void some_signal_handler_func(GtkWidget *widget, gpointer user_data) {
   /* do something useful here */
 }

 int main(int argc, char *argv[]) {
     GladeXML *xml;
     GtkWidget *w;

     gtk_init(&argc, &argv);
     glade_init();

     /* load the interface */
     xml = glade_xml_new("filename-for-interface", NULL);
     /* connect the signals in the interface */
     glade_xml_signal_autoconnect(xml);
     w = glade_xml_get_widget(xml, "wMain");
     gtk_widget_show((GTK_WIDGET) w);
     /* start the event loop */
     gtk_main();
     return 0;
 }


>
> -Andrei
> * It said 'Winmodem' on the box, but I still feel like I lost. *
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>

-- 
Corey Thornburg
coreyt coreyt com






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