Adding a signal to an exixting widget
- From: Stefano Salvi <stefano salvi mn it>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Adding a signal to an exixting widget
- Date: Tue, 16 Aug 2005 12:33:36 +0200
I'm using gtkmm-2.6 from Sarge.
I need a "scrollable DrawingArea" to insert into a ScrolledWindow widget.
To get the adjustmets to scroll it I need to add the
signal_set_scroll_adjustments signal to my widget.
I added the SignalProxy with this declaration:
Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* >
signal_set_scroll_adjustments();
and initialized the proxy with the following code:
const Glib::SignalProxyInfo MemoryPanel_signal_set_scroll_adjustments_info =
{
"set_scroll_adjustments",
(GCallback) &MemoryPanel_signal_set_scroll_adjustments_callback,
(GCallback) &MemoryPanel_signal_set_scroll_adjustments_callback
};
Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment* >
MemoryPanel::signal_set_scroll_adjustments()
{
return Glib::SignalProxy2< void,Gtk::Adjustment*,Gtk::Adjustment*
>(this, &MemoryPanel_signal_set_scroll_adjustments_info);
}
when the code runs I gat a runtime error claiming tha cannot connect to
the "set_scroll_adjustments" signal, so I browsed the documentation to
find a way to register the signal.
I found nothing in gtkmm and found a note on using
gtk_object_class_user_signal_new(), but this function is present in
GTK1.2 and not in GTK2.0.
What's the right method to add the signal?
Thank you
Stefano Salvi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]