[Glade-users] glade_xml_signal_autoconnect woes

Tristan Van Berkom tvb at gnome.org
Tue Nov 21 10:21:16 EST 2006


Sudharshan S wrote:
> Hello all,
> Novice programmer here. So please be gentle :)..Anyway I have this
> project wherein the main routine is in a file called main.c, main.h has
> some defines and includes all other headers. I like to group the
> callback functions in different files according to the widget from which
> they occur, for example filechooser.c, .h etc. 

You can go ahead and put callbacks in any area of your app, or even
in a shared lib that your app is linking against - note you might
find it tedious to seperate callback code by widget, note2 since you
are working with a dynamic UI you probably want to abstract the GUI
from your callback code.

In an ideal world (well, my ideal and some folks too), you can have
a GtkAction of all kinds of types to connect signals to, regardless
of what button you decided to put in what window or whatnot, your
code should only be concerned that the user somehow said "Play!"
or, "crank up the volume a notch", you can then go ahead and completely
change your GUI and since you have the same actions with the same
callbacks attached, it will "just work" (ofcourse the action stuff
is sadly currenlty limited to menuitems and toolbars, but this idea
should help shed some light on how you might want to design your GUI
code).

[...]
> Since I use autotools to manage my project, I added the -rdynamic and
> --export-dynamic flags to the Makefiles also after some googling, but
> didnt work. Also callbacks arent declared static.
> I hope I have given information regarding this problem. Would be great
> if anyone sheds light on this.

Well something is askew here, care to post the output of "make" in your
project so I can verify you put --export-dynamic in the correct linker stage ?

You should also try an "nm myapp" and see if your callback symbols are
indeed exposed in the text segment of your binary (i.e. marked with "T").

Cheers,
                    -Tristan


More information about the Glade-users mailing list