Thankyou. It does help, except I realized that opening windows from outside the main dialog is not always a good idea. If the user closes a window then it can't be reopened unless the program is restarted - not very user friendly.

DB

Thanks for the tip.  If I wanted to have these sub-windows created
automatically (and not rely on a particular event), would it be better
to create the windows from within the "initially" method or the
"init_dialog"method?



Actually, neither! The problem with that approach is that show_modal blocks the other windows after both initially and init_dialog have been called, so any other windows will be blocked - not what you want.

However, there is a way to do this by using the show_child() method, which is a sort of cross between show_modal and show_modeless. It doesn't block other windows (like show_modeless), but also it doesn't return until the window has closed (like show_modal). So, if the main method of my example program was as follows :-

procedure main()
  d := dialog()
  d.show_modeless()
  d2 := dialog()
  d2.show_modeless()
  d3 := dialog()
  d3.show_child()
end

..then you start off with all three dialogs on the screen and accepting input. The last line only returns when d3 is closed, and the program exits. This does mean that you can't close d3 and leave d and d2 open. To allow that, with all three dialogs on an "equal footing", custom code is needed :-

procedure main()
  d1 := dialog()
  d1.show()
  d2 := dialog()
  d2.show()
  d3 := dialog()
  d3.show()

  dispatcher.add(d1)
  dispatcher.add(d2)
  dispatcher.add(d3)

  while *dispatcher.dialogs > 0 do
     dispatcher.message_loop(?dispatcher.dialogs)

end

"dispatcher" is the single instance of the class Dispatcher, which is the gui toolkit's event handling system.

Hope this helps

R





------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ Unicon-group mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to