|
|
On 6/19/21 1:24 PM, Webb Hinton wrote:
I'm trying to figure out how to get a child widget to
conform to the dimensions of it's parent widget exactly.
While the code below (modeled after the code from Fl_pack.cxx does a decent job of
resizing the child widget, when resizing the window the child
and parent can differ a pixel or two in size. This is
particularly noticeable when when resizing the window quickly.
It seems the drawing of the child is somehow "lagging
behind" the drawing of the parent.
I don't know the language you
posted, but it looks like you might be resizing
in the draw() method, that'd
explain why you're seeing a lag.
Don't do resizing in draw().
The ONLY thing you should really do in draw() code is draw
stuff.
If you want precise resizing, subclass the group widget and
override the resize(x,y,w,h)
method, and inside that:
1) Tell the baseclass to resize(),
2) Set the child to the size you want
3) Call init_sizes() last, so the group knows you changed
the size of one of its children
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/df915a0f-bfba-985e-94d5-f2a4f9abe066%40seriss.com.
[ Direct Link to Message ] | |
|
| |