Re: [gtkmm] it´s driving me mad ... (replacing contents of VBox)



Hi Martin,

thx for your reply.

My VBox is part of a scrolled window.
I just donīt know how to remove a widget
from a scrolled window...

To follow your hint I do:

myBox = Gtk::manage(new Gtk::VBox());
myBox->pack_start(widget1);
myBox->pack_start(widget2);
myBox->pack_start(widget3);
m_scrolledParamWindow.add(*myBox);
show_all();

Then I should do:

m_scrolledParamWindow.add(*myNewBox);
myBox->pack_start(widget4);
myBox->pack_start(widget5);
myBox->pack_start(widget6);
// I should delete myBox from scrolledWindow
m_scrolledParamWindow.add(*myNewBox);
show_all();


You assign a pointer, but you don't change the widget tree.
You must first remove the old VBox and then add the new one
to the parent widget. To remove and destroy a widget use
delete. (I'm not sure whether this works with Gtk::manage() -
you'll have to try.)






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