Re: [gtkmm] Label in a std::list<Gtk::button *>



Few notes regarding to your code:
use Gtk::manage when you do not certainly plan do delete widget youself.
It fixes alot of leaks and should become some sort of automatic action.
Also, You can use simpler form of SigC::bind, like that:
m_Button_1.signal_clicked ().connect(SigC::bind ( SigC::slot(*this, &ExampleWindow::on_button_numbered), "blah-blah-blah"));

Also, gtkmm containers offer stl-like api, and it sufficient for many tasks,
so you do not need stl containers here.

About your problem:
You pack buttons in a wrong way,
	it=buttons.begin();
 	(*it)->set_label(label); //should set label
	 (*it)->signal_clicked().connect(
      SigC::bind<Glib::ustring>( SigC::slot(*this, &ExampleWindow::on_button_numbered), label) );
  m_Table->attach(*(*it), 0, 1, 0<<<-YOUR-PROBLEM-IS-HERE, i+3);
Problem is in that zero. Use i+2 there, and all would work nice.
Your buttons start at row 0 and last to i+3, so labels are hidden by
higher buttons.

regards,
--
fuxx




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]