Re: [gtkmm] configure_event in drawing area



>On Thu, 12 Sep 2002 09:58:15 -0400
>Paul Davis <pbd op net> wrote:
>
>> >I need to draw to the window before a user choose to view it. Is there a wa
>y t
>> >o do this init earlier? If I try to init the pixmap in the ctor it segfault
>s..
>> 
>> all drawing to on-screen drawables is done from an expose event
>> handler. 
>> 
>> configure events can be used to set up off-screen drawables and/or to
>> note the sizes of windows.
>
>Yes I know, I don't draw anything in the on_configure_event, the problem is th
>at I have to draw to the drawingarea before it is shown for the first time, an
>d it seems like on_configure_event is executed when the drawingarea is shown f
>or the first time. If click on the notebook page where this drawingarea is and
> then click on another notebook page, then everything works fine when i do the
> drawing. If i draw without clicking on the notebook page where the drawingare
>a is it doesn't work.

the order of events related to a window becoming visible is something
like:

	show
	realize
	configure  << whenever its size changes, including the first show
	map
	expose

the exact order may be a little different; what matters here is that
the expose event comes *after* the configure event.

you can get the information about size from configure, then draw in
expose. what the user sees on the screen will reflect what you do in
the expose event handler.

--p

    



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