[gtkmm] GTKMM classes handling local variables



Hi all, 

Maybe someone can help me with this, I have only been developing with
GTKMM for a little while so I am a little bit of a newbie.

Right here is a piece of example code:

class MyClass : public Gtk::Window
{
	public:
		MyClass();
		virtual ~MyClass();
	private:
		VBox m_box;
};

MyClass::MyClass()
{
	Label _label("Hello World");
	m_box.pack_start(_label, PACK_SHRINK);
	show_all_children);
}

MyClass::~MyClass()
{
}

Right what I cannot understand is why this program will compile but my
label will not be displayed? For some reason it will only work if I
declare my Label in the class definition... I don't see why it is not
working... :(

Ian




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