modal window

9 views
Skip to first unread message

DR0ID

unread,
Mar 12, 2009, 7:18:03 PM3/12/09
to pyglet...@googlegroups.com
Hi

I have been trying to write a modal win lately. Any idea how it could be
done better? Should a ModalWindow class have a show_modal(...) method?
Or maybe some events shouldn't be forwarded... not sure. It should work
on any platform since it doesn't use any platform specific code. Let me
know if you have any trouble on a certain platform.

The example opens a window, press 'M' for another modal window or press
'R' for a window that redirects its events to a single function. You can
open hierarchical modal windows.

Any feedback appreciated.

~DR0ID

modalwin.py

Tristam MacDonald

unread,
Mar 12, 2009, 7:34:09 PM3/12/09
to pyglet...@googlegroups.com
To my mind, modality is a state of the event dispatch system, rather than an attribute of a window.

This doesn't precisely translate into pyglet's framework, but it is something worth keeping in mind while you are designing.

DR0ID

unread,
Mar 13, 2009, 2:08:45 AM3/13/09
to pyglet...@googlegroups.com
Hi

You are right, modality is a state of the event dispatch system. That's
why there is the Redirector class which can be used on any Dispatcher.
It is the only way I see to make modality in pyglet. Or is there a
better way I don't know?

This solution works, but might not be the best/most elegant way doing it.

~DR0ID

Tristam MacDonald schrieb:
Reply all
Reply to author
Forward
0 new messages