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

Vinay Pai glade-users@vinaypai.com
Sun, 22 Feb 2004 03:16:34 -0500 (EST)


Hi Manish,
I read your suggestions and amd struggling to understand what problem
you're trying to solve. Could you clarify what pointer manipulation
problems you're facing?

I, for one, think that this is a rather messy solution and would like to
suggest something more elegant once I figure out what the issue is!

Vinay


On Sun, 22 Feb 2004, Manish Chakravarty wrote:

>
> Hi all fellow newbies,
>
> Just discovered a method which takes care of all those variabe problems in
> Glade and makes coding hassle free:
> First let me describe a typical problem newbies face in programming with
> Glade/GTK for the first time:
> You design two windows, A & B
> A is the window to be shown initially when the program starts
> When the user presses "OK", window A disappears and wnidow B is shown
> typically what Glade will put in main() is :
> GtkWidget *window1;
> blah, blah blah
> ..................
> .......................
> then we have
> window1 = new GtkWidget (....);
> gtk_widget_show(window1);
>
> then, in callbacks. we will have
> _on_button_OK_clicked(){
> ....................
> }
> functions
>
> this causes the pointer passing and manipulation problems
> I WOULOD RECOMMEND THE FOLLOWING SOLN TO ALL SUCH PROBLEMS FOR NEWBIES::
> 1) Make your UI in glade as you normally would.
> 2) Generate the source files
> (the first two steps are common with the established procedure)
> 3) APPEND callbacks.c to main.c
> 4) include "callbacks.h" in main.c after all other files have been included
> 5) Remove all references to callbacks.c in your makefile, but DO NOT delete
> it or move it from its original location
> 6) Now edit the funcitons like on _button_ok_clicked_() to you heart's
> content..
>
> PROS KINDLY NOTE: i dont write code from scratch.. i use the following
> approach and my work gets done quickly and effecdiently.
>
> Hackers and Experts, please comment... and Newbies like me... this is one
> way to go (i guess)
> Regards
> Manish
>
> In a world without fences, limits, boundaries and walls,
> Who needs windows and gates??
>
>
> _______________________________________________
> Glade-users maillist  -  Glade-users@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/glade-users
>