Re: uicontextmenu
- From: elmex <jk10@xxxxxx>
- Date: Sun, 27 Aug 2006 05:32:03 -0400
Jeremy Smith wrote:
I'm curious, why do you want to execute a function when the user
clicks next to an open context menu?
In our lab the computers synchronize via network. There is one for
the data analysis running Matlab 7.1 with the instrumental control
toolbox for the network stuff. After each experimental cycle this
computer is triggerd by UDP packets to collect the data, do some
image processing and some fits and plots. The user can change the
analysis process with a gui - which is using uicontextmenus.
Now the problem. When I watched people using the program, I realized
that they where confused when a new analysis cycle was triggered via
network while they were changing parameters in the gui - also leading
to wrong results. What I needed to do was to postpone the execution
of a network event while the user is doing something in the gui.
I tried the 'Interruptible' property for the gui, but this does not
seem to work for network events. So I introduced a small
task-scheduler which is called periodically by a timer object. It
takes tasks from the gui and the network an has got a few semaphores
to control the execution.
This worked quite well and even speeded up the execution. But there
is one unsolved situation left:
1) the user opens an uicontextmenu - a semaphore is set to
stop the network trigger.
2) the user changes its mind (which happens surprisingly often ;-))
and clicks next to the menu to do something else.
3) the task-scheduler is waiting for the semaphore and nothing
happens. It would have been nice to have a callback when the menu is
closed to clear the semaphore.
Thanks for the 'WindowButtonDownFCN' idea. I will try it out on
monday but I fear that that it will be quite hard to distinguish the
different mouse clicks since the are a lot of buttons and a couple of
windows. Perhaps I can find a way to periodically check the
visibility of the contextmenu once it is open.
Thanks, Elmex
.
- References:
- uicontextmenu
- From: elmex
- uicontextmenu
- Prev by Date: Sources in Simulink
- Next by Date: Re: Latex interpreter -> No bounding box for eps files
- Previous by thread: Re: uicontextmenu
- Next by thread: signal processing function (signal splitting)
- Index(es):
Relevant Pages
|