Disable event handling 
Author Message
 Disable event handling

Hi!

I have a canvas where I want to do some graphical work, but
I don't want the user to see what's happening before everything
is set up. I.e. I would like to disable the update of the canvas.
Can this be done?

I'm using Tcl7.6/Tk4.2.

Cheers,
Emil

--
-----------------------------------------------------------------

The Knowledge Technology and Methodology group,
Swedish Institute of Computer Science



Mon, 20 Mar 2000 03:00:00 GMT  
 Disable event handling


Quote:
>I have a canvas where I want to do some graphical work, but
>I don't want the user to see what's happening before everything
>is set up. I.e. I would like to disable the update of the canvas.
>Can this be done?

When you issue a Tk command the user does not immediately see what you've
just done.  The screen is not updated until you issue and update, vwait or
"finish" an event binding.  So if you have a procedure that is doing lots of
changes the user will not see them until you are done.

If, however, you are building up your canvas from something like file events
coming in, you have to do a bit of work.  Use of one or more of the
following techniques should do the trick:

    1) Build up all your commands in a variable (using list commands and
append) then execute it when you want the update.
        Note - if you have to query objects are creating/modifying this will
not work.

    2) Un-pack/place/grid the canvas while you are making changes.  You may
want to put a blank one in its place while you are doing your work.

    3) Create a "background" rectangle which you do all of your work under
(see lower and raise commands) then raise all of your work when you are
ready for the user to see it.

****************************************************************************
* Gerald W. Lester                       | Voice:  +1 (504)-889-2784       *
* Computerized Processes Unlimited, Inc. | FAX:    +1 (504)-889-2799       *

* Metairie, LA 70001                     | Web:    http://www.cpu.com      *
****************************************************************************



Tue, 21 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Handling file events in the event loop

2. Acting on Property Events; Event Handling Nitty Gritty

3. Extend TK event loop to handle user defined event

4. Handling Tk-Events in Motif-Event Loop

5. event window who disabled the X in top right

6. Disable doesn't prevent EVENT:Accepted

7. Labview events and disabled controls on a tab control

8. disabling events

9. How to disable all user interface events temporarily?

10. iconwindow disables button events

11. How to disable X events in tk4.2?

12. Timer ticked event uses a Process with disabled interrupts

 

 
Powered by phpBB® Forum Software