Luca Cappa wrote:

Hello,

I created a custom widget which extends the Gtk::Frame class. I add to it a HBox and inside this box a gtkglextmm widget (which extends from Gtk::DrawingArea and public Gtk::GL::Widget<View2D>), and a Gtk::HScale. In the constructor of the Gtk::Frame custom class i put:

mScale.set_digits (0);
mScale.set_draw_value (true);
crap = mScale.signal_value_changed ().connect (
sigc::mem_fun (*this, &klSliceViewer::sliderChangedEvent));
std::cout << (crap.connected () ? "connected" : "unconnected") << std::endl;
std::cout << (crap.empty () ? "empty" : "not empty") << std::endl;
Gtk::Adjustment lAdj (0, 0, 255, 1, 1, 0);
mScale.set_adjustment (lAdj);

Here there was the problem. Indeed the Gtk::Adjustment would be destroyed just after the constructor og my widget exits. Now the Adj object is a class member and no more a localvariable, and it works like a charm :)


_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to