Re: Gtk window.show() (maybe just c++ related)
- From: Maik Beckmann <maikbeckmann gmx de>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Gtk window.show() (maybe just c++ related)
- Date: Sat, 02 Dec 2006 12:24:12 +0100
> Hi,
>
> Please consider any foo widget with a show() method.
> Why :
> foo* foo1=new(foo);
> foo->show();
> shows the widget, but:
>
> foo foo1;
> foo.show();
>
> does not?
>
I assume the code you posted is inside a constructor or GUI-arrange
function.
Consider this:
{ // enter scope
...
foo* foo_ptr=new(foo);
bar_container->add(*foo_ptr);
foo_ptr->show();
foo foo_obj;
bar_container->add(foo_obj);
foo_obj.show();
...
} // leave scope
foo_obj will be destroyed, gtk+ can't show it because its gone.
foo_ptr is destroyed too, but the object it pointed to still lives.
MfG Maik
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]