[GUI] GUIs and events

Alastair Reid alastair@reid-consulting-uk.ltd.uk
Thu, 13 Mar 2003 13:27:28 +0000


Nick Name <nick.name@inwind.it> writes:
> GUI libraries wich make the application hang when a dialog is
> created are a bad idea. We need to have a way, even in hugs, to
> control the events that are to be sent to the underlying parent
> window when a dialog is created.

Note that the HGL successfully does this on Hugs so we know that this
can be implemented.  A demonstration would be something like:

- One window running an animation serviced by its own Haskell thread.
- One window running a dialog box asking if you want to quit.

Obviosuly, we'd need to make any reactive widgets in the animation
window unresponsive while the dialog box is open.  This isn't quite
the same as blocking all events though because, for example, the
animation window should still respond to redraw events.

[What can't be implemented on Hugs is to have a thread doing some big
calculation (like factoring large numbers) in one thread while other
threads continue to run.  The difference is because threads can only
be preempted when in the IO monad (and, at least for now, only at
certain places in the IO monad).]

--
Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/