Re: adding widget to vbox created by glade



On Sat, 2007-12-01 at 22:56 -0700, Gezim Hoxha wrote:

> I'm using glade to design my interface. I want to add a
> Gtk::VolumeButton but glade doesn't have this widget.
> 
> So, instead I'm trying to add the volume button using code.
> 
> Here's what I have:
> 
> 	Gtk::Window *notWindow;
> 	refXml->get_widget("notificationWindow", notWindow);
> 	notWindow->show();
> 	
> 	Gtk::VBox *myvbox = 0;
> 	refXml->get_widget("mainVbox", myvbox);
> 	Gtk::HBox *mybuttons = 0;
> 	refXml->get_widget("buttonsHbox", mybuttons);
> 	myvbox->remove(*mybuttons);
> 	myvbox->pack_end(*mybuttons);
> 	
> 	Gtk::VolumeButton my1223;
> 	myvbox->pack_end(my1223);

Okay, muntyan at #gtk+ helped me figure it out. One thing I forgot to do
is show().

So, now this code works:
	Gtk::VolumeButton *my1223 = new Gtk::VolumeButton;
	myvbox->pack_end(*my1223);
	my1223->show();

but this doesn't:
	Gtk::VolumeButton my1223;
	myvbox->pack_end(my1223);
	my1223.show();

and my question is, why doesn't this last code work?

Thanks,
-Gezim



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