Re: help on array of widgets
- From: Mj Mendoza IV <mjmendoza konsolscript org>
- To: gtkmm-list gnome org
- Subject: Re: help on array of widgets
- Date: Wed, 27 Jul 2011 20:18:37 +0800 (SGT)
Thanks for the snippet Yann!
Now how do I properly handle which button was clicked?
What I did was:
(*buttons.back()).signal_clicked().connect(sigc::mem_fun(*this, &HelloWorld::onButtonsClick));
//...
void HelloWorld::onButtonsClick() {
//who was clicked?!?
}
Regards.Mj Mendoza IV,Developer, KonsolScripthttp://www.konsolscript.org
From: Yann
Leydier <yann leydier info>
To: gtkmm-list gnome org
Sent: Wednesday, July 27, 2011 7:30:48 PM
Subject: Re: help on array of widgets
It is the exact opposite ! :o)
std::vector<Gtk::Button*> buttons;
buttons.push_back(Gtk::manage(new Gtk::Button("but")));
vbox.pack_start(*buttons.back(), …
Calling Gtk::manage(widget_pointer) will cause the widget to be freed
when its parent is destroyed.
Glib::RefPtr is generally not to be used when the API does not force you
to use it.
Yann
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]