[Glade-users] RE: The best way to use Glade generated code : suggestions to new bies from a newbie

Amit BHATNAGAR abhatnag@mda.ca
Fri, 27 Feb 2004 10:29:14 -0800


If you newbies haven't read this tutorial, do so now!!

http://people.debian.org/~rleigh/gtk/ogcalc/ogcalc.pdf

amit.


> -----Original Message-----
> From: Zoran Rilak [mailto:wayward@tirion.test.net]
> Sent: February 23, 2004 7:40 PM
> Cc: glade-users@lists.ximian.com; GTK Development List
> Subject: Re: The best way to use Glade generated code : suggestions to
> newbies from a newbie
> 
> 
> On Sun, 22 Feb 2004, Manish Chakravarty wrote:
> 
> Hi Manish & fellow newbies, greetings to pros,
> 
> > Just discovered a method which takes care of all those 
> variabe problems in
> > Glade and makes coding hassle free:
> 
>   I'm a Glade/GTK newbie as well. If I understand the problem you're
> referring to, then perhaps what I did in my gppp code will 
> provide some
> help:
> 
> 1) Get Glade to generate all its code.
> 2) Write a widget_util.h & widget_util.c (or similar) with
> 
> #include "support.h"
> 
> GtkWidget *preferences = NULL;
> 
> GtkWidget *
> get_preferences_window (void)
> {
>   if (preferences == NULL)
>     return (preferences = create_preferences_window ());
>   else
>     return preferences;
> }
> 
> and some utility functions such as
> 
> set_widget_blah (GtkWidget *widget, const gchar *control)
> {
>   GtkWidget *w = lookup_widget (widget, control);
>   if (w != NULL)
>     gtk_set_widget_blah (w);
>   else
>     g_warning ("not setting blah of unknown widget: %s", control);
> }
> 
> Am I off the mark here?
> 
> By the way, I make extensive use of "lookup_widget" function 
> and find it
> to be most attractive means of manipulating widgets.
> 
> 
> Wayward Bruce - Yet Another Kind of Bruces
> ---
> http://www.rcub.bg.ac.yu/~bruce
> bruce@tesla.rcub.bg.ac.yu
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 
>