Re: how to use get_geometry correctlly



On Tue, 2008-03-25 at 10:43 +0800, chennanbang wrote:
> 
> 
> On Tue, Mar 25, 2008 at 9:27 AM, Paul Davis
> <paul linuxaudiosystems com> wrote:
>         
>         
>         
>         you can't do this until the widget has been realized, because
>         before
>         that time get_window() will return a null (ref) ptr.
>         
>         put that in the realize handler, or make sure you do it
>         post-realize.
>         
>         --p
>         
> 
> Does "Been realized" mean that the parrent window do something on my
> widget with something like Gtk::Fixed?
> 
> /* in the parrent window of my widget */
> m_page_layout.put( *my_widget, X, Y );// Realize my widget ??

no, it means that the widget has been realized .... that is, a low level
window owned by the windowing system in use (X Window, GDI on windows,
Quartz on OS X) has been created and the widget has been "attached" to
it so that it will draw into that window.

you cannot predict or even directly control when this happens, so i
wouldn't bother to try. if you want the geometry, the best thing to do
is to catch configure-events on the parent top level window
(configure-event is only sent to top level windows), and then query the
widget. you can be certain that (a) it will have a window at that time
and (b) the window manager (or its equivalent on different platforms)
has finished (for now) with controlling the top level window dimensions.

--p




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