Re: gtkmm 3.4.0 - Gtk::Switch where is the signal "activate"?
- From: Kjell Ahlstedt <kjell ahlstedt bredband net>
- To: Giuseppe Penone <giuspen gmail com>
- Cc: Gtkmm list <gtkmm-list gnome org>
- Subject: Re: gtkmm 3.4.0 - Gtk::Switch where is the signal "activate"?
- Date: Tue, 19 Jun 2012 19:27:37 +0200
2012-06-19 18:00, Giuseppe Penone skrev:
Hi,
I would like to use the signal "activate" of the widget Gtk::Switch
(which I discovered through glade signals tab),
I see that it exists in gtk 3.2:
http://developer.gnome.org/gtk3/3.2/GtkSwitch.html#GtkSwitch-activate
but it is not mentioned on
http://developer.gnome.org/gtkmm/stable/classGtk_1_1Switch.html
and the "m_switch.signal_activate()" causes error at compilation time.
Cheers,
Giuseppe.
The description of GtkSwitch-activate that you link to says
"Applications should never connect to this signal, but use the
notify::active signal." That's why this signal is not wrapped in gtkmm.
I wonder if it's really a good thing that it appears in glade.
It's not obvious how to connect to the notify::active signal from a C++
program. I think this how to do it:
void MyWidget::on_switch_active_changed();
m_switch.property_active().signal_changed().connect(sigc::mem_fun(*this,
&MyWidget::on_switch_active_changed));
I admit that it looks complicated. Does anyone know an easier way?
Kjell
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]