tkwait win .widget.print.menu or even destroy .widget.print.menu
before calling a routine to
capture the window. But no matter, the menu always winds up in the GIF
file. I've also tried
to just select the canvas that is part of the widget, but the menu
when activated extends
over the canvas and shows up in the GIF file.
Is there some technique that could be used to make sure the menu
disappears before I try
to capture the canvas?
set info2 "$m add command -label \"Make Plot & Print \"\
-command { destroy .$GAUGE.but.pri.menu; windowToFile .
$GAUGE }"
This is the menu option that initiates the capture and print process
via windowToFile .
I can't seem to get rid the menu from the plotfile. I suppose I could
hack windowToFile
(written by D. Easton) to ignore any subwindow with "menu" in it, but
I was wondering if
there was a more "elegant" solution.
Stuart
<snip>
> I can't seem to get rid the menu from the plotfile. I suppose I could
> hack windowToFile
> (written by D. Easton) to ignore any subwindow with "menu" in it
Well even that won't work, since I'm just trying to capture the canvas
part of the widget.
Stuart
Well I tried this modification:
-command {after 500 windowToFile .$GAUGE }"
That worked. Does this mean the menu widget doesn't disappear until
the "command" is completed?
I'm not sure how robust this will be, but so far I've tried it on a
busy system and I haven't
had the menu appear in any of the plots.
Stuart
In short, yes. Tk puts off redrawing things until after the currently-
ready events have all been processed so that all updates to the screen
can be done at once. Usually this works really well and makes Tk feel
really snappy and fast, but occasionally (e.g., this time) it matters.
> I'm not sure how robust this will be, but so far I've tried it on a
> busy system and I haven't had the menu appear in any of the plots.
It can go wrong on a *very* busy system where there's a lot going on
at once, so it's better to use:
after idle after 10 windowToFile .$GAUGE
The [after idle] postpones things until Tk's done its internal
redrawing, and the [after 10] gives a moment for any queued external
events (especially certain kinds of window-system initiated redraws)
to be handled.
Donal.
Thanks for the info.
Yours,
Stuart