Re: how to limit the usable canvas area
- From: "maura.monville@xxxxxxxxx" <maura.monville@xxxxxxxxx>
- Date: 30 Aug 2006 02:19:40 -0700
Aric Bills wrote:
One solution would be to constrain the size of the canvas widget itself
so that it covers exactly the area you want users to interact with.
I think you are suggesting to dynamically reconfigure the canvas size.
I had the same idea. It turns out that if I do that off-line it works.
I mean the user changes the canvas aspect-ratio through a radiobutton
selection followed by clicking on the Draw button (which rebuilds the
canvas image). The command (proc) associated to such a radiobutton
calculates the scaling factor. The command 9proc0 assocaited to the
Draw button redraw the canvas. Since all graphic objects have their
y-coordinates and heights multiplied by the scaling factor the image
gets resized.
The question is *where* to place the canvas size reconfiguration. The
logical choice is (I think) at the end of the command "draw_canvas"
activated by clicking on the Draw button.
But a quick test shows that the canvas size reconfiguration takes place
*before* the whole canvas image rescaling process is completed. The
result is obviously awful.
Whereas if I let the canvas image rescaling to complete and then
off-line in the window where the Tcl program was launched I type in
the following command line as the control i returned from the program
to the interpreter:
% $plot(canvas) configure -width 590 -height 300
then the canvas gets resized nicely.
This tells me that events synchonization is crucial and I do not know
how to control it with Tcl/Tk.
I know there exists two commands to instruct Tcl to wait until a
variable content is changed.
But in my case there is no variable that is set or reset when the whole
canvas image rescaling process is done. How can I know when the Window
Manager has completed repainting the canvas ?
Thank you,
Maura
.
- References:
- how to limit the usable canvas area
- From: maura.monville@xxxxxxxxx
- Re: how to limit the usable canvas area
- From: Aric Bills
- how to limit the usable canvas area
- Prev by Date: Re: Need help with loading .SO file
- Next by Date: Re: Need help with loading .SO file
- Previous by thread: Re: how to limit the usable canvas area
- Next by thread: Twapi get primary domain controller
- Index(es):