[Glade-users] signal handler -> does not work under windows & linux | compil. OK
- From: anthibug at gmail.com (TiTi)
- Subject: [Glade-users] signal handler -> does not work under windows & linux | compil. OK
- Date: Wed, 28 Mar 2007 15:19:38 +0200
Hi!
I'm trying to create a simple application with libglade. The problem is :
nothing happens when I clic on my button :-/
Some days ago, my console show me a libglade-warning : "libglade-WARNING **:
could not find signal handler"
I find the origin of the problem, it was due to compiler/linker options.
Now, the compilation and the execution are good, but still nothing
when i clic on the button.
I found a post that suggest to
set the window visibility into the .glade, and then call gtk_widget_show()
...
I also try to manually connect the signal (without
glade_xml_signal_connect(), with glade_xml_signal_connect)
But still the same problem -_-
The signal is : activate.
The really weird thing is :
does not work under windows
does not work under linux!
under linux (ubuntu) :
cc -o test main.c `pkg-config --cflags --libs libglade-2.0 gtk+-2.0
gmodule-2.0` -Wl,--export-dynamic
under windows (devcpp) :
libglade-2.4.0-dev.zip (
http://gladewin32.sourceforge.net/modules/wfdownloads/viewcat.php?op=&cid=3)
-export-dynamic
//-----------------------------------------------------
main.c
//-------
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <gmodule.h>
G_MODULE_EXPORT void some_handler(GtkWidget *widget, gpointer user_data)
{
g_printf("test\n");
gtk_main_quit();
}
int main(int argc, char **argv)
{
GladeXML *xml;
GtkWidget *widget;
gtk_init(&argc, &argv);
xml = glade_xml_new("damn.glade", NULL, NULL);
glade_xml_signal_autoconnect(xml);
widget = glade_xml_get_widget(xml, "window1");
//glade_xml_signal_connect(xml, "activate", G_CALLBACK(some_handler)); //
GTK_SIGNAL_FUNC
gtk_widget_show(widget);
gtk_main();
return 0;
}
//-----------------------------------------------------
damn.glade
//-------
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkWindow" id="window1">
<property name="width_request">300</property>
<property name="height_request">200</property>
<property name="title" translatable="yes">window1</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<child>
<widget class="GtkFixed" id="fixed1">
<property name="visible">True</property>
<child>
<widget class="GtkTextView" id="textview1">
<property name="width_request">50</property>
<property name="height_request">50</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="overwrite">False</property>
<property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">True</property>
<property name="pixels_above_lines">0</property>
<property name="pixels_below_lines">0</property>
<property name="pixels_inside_wrap">0</property>
<property name="left_margin">0</property>
<property name="right_margin">0</property>
<property name="indent">0</property>
<property name="text" translatable="yes">hello</property>
</widget>
<packing>
<property name="x">64</property>
<property name="y">40</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="width_request">48</property>
<property name="height_request">23</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">button1</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="activate" handler="some_handler" last_modification_time="Tue,
27 Mar 2007 20:47:35 GMT"/>
</widget>
<packing>
<property name="x">192</property>
<property name="y">120</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
//-----------------------------------------------------
In fact my problem is exactly like this one :
http://lists.ximian.com/pipermail/glade-users/2007-February/003300.html
But I still can't make it work!
Please help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20070328/8e4f9b5a/attachment-0001.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]