A quick question, which is more one of style and programming practice. What is the best way to structure a GTK Program. I have written a program which contains many dialog boxes, all which hold buttons, text boxes etc.. I felt that the best way to program this would be to use classes as I am used to object orientated programming however I found that it could not be effectively done.

Having created an instance of a class , b I tried to call

gtk_signal_connect_object( GTK_OBJECT( button_setup ), "clicked",
        GTK_SIGNAL_FUNC( b.setup ), NULL );

This did not work, I then tried to pass the class as a parameter ie.

gtk_signal_connect_object( GTK_OBJECT( button_setup ), "clicked",
        GTK_SIGNAL_FUNC( global_void_function ), b );

and this did not work.
Since most of my functions need access to alot of the GtkWidgets I have made nearly all my variables global so they can be accessed by all the functions, but this is crap, and need to improve it cause it is an important project for college. How do you think I should structure the program to have good programming practive and have the variables available to numerous functions.


Get your own FREE, personal Netscape Webmail account today at

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