Bloody hell!! I went to Anjuta 1.2.4a and started a new libglade project. Its auto-generated main.c function was there with all this autoconnect stuff, ok. Then I added another C file to the project only for the "signal handlers", like on_button1_clicked and so on. Declared them at the top of this file. Compiled. The interface was loaded, but a test message ("Oops, nothing implemented yet!") from clicking the button didn´t come out, and closing the window would keep ther application in memory (in spite of having set gtk_main_quit for on_window1_destroy).
Tried passing the handlers declaration to the main.c file -- same (no)thing happens. Tried moving those declarations to a header file -- nothing happened again. Tried declaring the GladeXML *xml buffer and GtkWidget *window1 as global -- nothing again. After HOURS of reading, browsing my gtk-app-devel-list archive and googling around, I found that from our always gentle Tristan: /****************************************************/ Tristan Van Berkom tristan.van.berkom at gmail.com Thu Oct 6 11:46:24 EDT 2005 pramathesh_a at rediffmail.com wrote: > I have a simple test libglade project. A window with a single button > ("button1") with a callback function on_button1_clicked. The callback > function is coded in callback.c and declared in callback.h. There is > one main.c (The other glade generated code files I have discarded). In > main I have put a call to glade_xml_signal_autoconnect. I have edited > configure.in to compile the project with appropriate libglade cflags > and libraries. In Makefile.am, I have put project source files as > main.c, callbacks.c and callbacks.h. > The project compiles OK but at run time I get the following message: > libglade-WARNING: **: could not find signal handler 'on_button1_clicked'. > > Why is this? The code for the signal handler is in callbacks.c which is one of > the source files for the project. This (my best guess) is because libglade is not seeing global symbols in your application, try compiling your program with `-rdynamic' (I think there are other equivalent options, this one works). Ofcourse you also have to make sure that your signal callback is not declared static. Cheers, -Tristan /**************************************************************/ So I came there at one of the (mysterious) Anjuta configuration dialogs and put this -rdynamics flag as a compiler option. And then... the damn thing worked!! Did/does anyone also HAVE to set this -rdynamic flag "manually" for libglade to work fine? Shouldn´t Anjuta (or a script called gtk-config or something alike, which was there for GTK 1.2 and I don´t know if it is there for GTK 2.0) set this flag automatically?? Anyway, I am glad it has worked. But if you guys have any objection or know another solution, I would like to know it. Thank you! Fabricio Rocha Brasilia, Brasil _______________________________________________________ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list