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



Hi!

I have a problem here I just cannot solve:
VBox myBox is containing some widgets1..3 I show
first.
Later in my program (windows stays the same), I build
a new VBox to display widgets4..5 instead, but the widgets1..3
stay displayed!

Can somebody throw light on this?



.h:
Gtk::VBox *myBox; // Pointer to VBox I want to display

.cpp:

// 1st object of VBox holds widgets1..3 and shows them -> fine
myBox = Gtk::manage(new Gtk::VBox());
myBox->pack_start(widget1);
myBox->pack_start(widget2);
myBox->pack_start(widget3);
myBox.show();

...

// Assigning the new VBox to the Pointer myBox
// but the new widgets are not displayed!!
myBox = Gtk::manage(new Gtk::VBox());
myBox->pack_start(widget4);
myBox->pack_start(widget5);
myBox->pack_start(widget6);
myBox.show();


TIA,
Andi




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