W> How can I process both mouse events and network input
W> in Unicon's class windowing mechanism?

Good question. I too have had cause to peel apart the GUI's main loop,
named message_loop() which lives in class Dispatcher.

One politically correct way to do what you want is to subclass Dispatcher
and override its message_loop() with extra (say, network) capabilities.

If you use modeless dialogs, you could instead just write your own main
loop procedure, doing the networking stuff you need to do and calling the
following example procedure on a frequent/regular basis to do GUI stuff.
You'd need to wire this up with select()-based networking code in order
to have a complete solution to your needs.  I think select() allows a
combination of network connections and windows in its connection list.
Maybe Shamim remembers if this is true. :-)

Clint


procedure my_process_events()

# Processes events in modeless windows

local bag, d, e
         bag := []
         if * dispatcher.dialogs = 0 then stop("no more dialogs; exiting.")
         every d := !dispatcher.dialogs do {
            if *Pending(d.win) > 0 then {
               if /d.is_blocked_flag then {
                  put(bag, d)
              }
               else {
                  while *Pending(d.win) > 0 do {
                     #
                     # Discard the event and beep in the window.
                     # A close on a blocked window is a bad situation,
                     # probably the application should terminate in response
                     # to a process_event(), but if not,
                     # use the hidden offscreen window until it is unblocked.
                     #
                     e := Event(d.win)
                     if integer(e) = -11 then {
                        d.win := d.buffer_win
                        d$process_event(e)
                        }
                     else if not(integer(e) = (&lrelease | &rrelease | &mrelease | 
&ldrag | &rdrag | &mdrag)) then
                        Alert(d.win)
                  }
               }
            }
         }
         if d := ?bag then {
            d$process_event(Event(d.win))
            }
         else {
            delay(500)
         }
end


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to