Re: Forcing size_allocate?
- From: The Surprises <thesurprises1 attbi com>
- To: gtk-list gnome org
- Subject: Re: Forcing size_allocate?
- Date: Wed, 9 Oct 2002 10:46:38 -0700
This won't show correct values until a size_allocate event occurs. This
is what I do inside my draw routine which gets called during a
size_allocate event. Before the size_allocate event, both width and
height are set to 1.
On Wed, Oct 09, 2002 at 08:49:40AM -0400, Owen Taylor wrote:
>
> 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
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]