Re: Forcing size_allocate?
- From: Owen Taylor <otaylor redhat com>
- To: The Surprises <thesurprises1 attbi com>, gtk-list gnome org
- Subject: Re: Forcing size_allocate?
- Date: Wed, 9 Oct 2002 08:49:40 -0400 (EDT)
Paul Davis <pbd op net> writes:
> >I have a gnome_canvas packed into a vbox. All drawing in the canvas is
> >connected to a size_allocate event because I need to know the width and
> >height of the area before drawing.
>
> don't do this. a size allocate will always be followed by an expose
> event. all drawing must be done from the expose event handler, always.
> just store the width and height in the size allocate handler for later
> use. if for some reason, the expose event is really missing, use
> gtk_widget_queue_draw() to cause one to occur "soon".
Note also that you can simply get the current width and height
of the canvas with:
canvas->allocation.width
canvas->allocation.height
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]