RE: [gtkmm] Q: how to centre in a VBox?



> From: gtkmm-list-admin gnome org 
> Ah! gtkmm seems to violate normal STL semantics regarding 
> lifetimes. If I 
> use an hbox that goes out of scope at the end of the page's 
> constructor, 
> then it doesn't work

Widgets are not copied. There'd be all kinds of issues if they were.
add()ing a widget to a container just means that it is positioned inside the
container. It doesn't mean that a second widget has been instantiated.
Naturally, if the widget goes out of scope then it will be deleted, and
politely disappear from the container widget.

> -- I have to include the hbox as an 
> object carried 
> inside the class that defines the page.

Yes, you'll notice that this is what most of the examples do.

> Oddly, though, the 
> same is not true 
> for the label that goes inside the hbox -- that can go out of 
> scope at the 
> end of the constructor with no ill effects. Strange.

I doubt that.

Murray Cumming
www.murrayc.com
murrayc usa net



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