[Glade-users] GtkCheckButton signal toggled not connected
- From: mferrero at reer.it (Manuel Ferrero)
- Subject: [Glade-users] GtkCheckButton signal toggled not connected
- Date: Tue, 31 Jan 2012 14:31:44 +0100
I draw a GtkCheckButton in my application and in its signal tab I wrote
dummy_callback as signal callback for the toggled event.
In my code I call gtk_builder_connect_signals to automatically connect
all the signals to the callbacks.
All my other callbacks works as expected, but if I click on the checkbox
to change its state the dummy_callback isn't executed.
Where am I wrong?
I compile in a Win32 environment with MinGW gcc, passing the following
parameters: -mms-bitfields `pkg-config --cflags gtk+-win32-2.0
gmodule-2.0` `pkg-config --libs gtk+-win32-2.0 gmodule-2.0`
GTK+ 2.24.8
Glade 3.8.1
Windows XP
mingw32-gcc 4.6.2
I enclose the checkbox part of the glade file and the callback code.
---SNIP---
<object class="GtkCheckButton" id="checkbutton1">
<property name="label" translatable="yes">Sostituzione micro</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="yalign">1</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="dummy_callback" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
---PINS---
---CODE---
// struct for callback data
typedef struct _ChData ChData;
struct _ChData
{
GtkWidget *window1;
GtkWidget *checkbutton1;
};
ChData *data;
data = g_slice_new(ChData);
// connects all the signals
gtk_builder_connect_signals(builder_handler, data);
// callback for the checkbox toggled event
G_MODULE_EXPORT void dummy_callback(GtkWidget *widget, ChData *data)
{
guint dummy1;
guint dummy2;
dummy1 = 0;
dummy2 = 0;
dummy1++;
dummy2++;
} // dummy_callback
---EDOC---
--
Regards,
Manuel Ferrero
R&D department
Reer SpA
Tel. +39 011 2482215
Fax. +39 011 859867
L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe costituire reato.
Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve essere considerato
come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, via e-mail,
ce ne comunicasse l'errata ricezione.
The unauthorized use of this e-mail is prohibited and could constitute an offence.
If you are not the intended recipient of this message its contents shall be understood as neither
given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in that case.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]