Need help with Sunview programming (Notifier doesn't)

The Invisible Man actnyc!jsb at uunet.uu.net
Fri Feb 24 00:04:31 AEST 1989


In article <961 at ubu.warwick.UUCP> jmb%warwick.uucp at nss.cs.ucl.ac.uk (James M Beckett) writes:

)The draw routine is itself initially called from the notifier using the
)PANEL_NOTIFY_PROC argument to panel_create_item, (followed eventually by a
)window_main_loop(); ) and while drawing the fractal I want to give the
)notifier a look-in (so that on selection of the 'stop' button it will call
)a function which sets a global variable which is tested in the draw
)routine which causes the loop(s) to end etc etc...)...

Well, there are a couple of things I'd try here: First, don't use
window_main_loop() at all.  Use explicit dispatching.  I think its
described in the same section (17.6) or thereabouts.  Secondly, instead of
using the draw routine as a notify proc, try having the notify proc merely
set a flag and return.  Then, each time through your dispatching loop,
check this flag and call your draw routine if its set, making sure that
the draw routine also checks occasionally for pending events (or nothing
will change!)  If this sort of approach doesn't work, you can always have
the draw routine run as a separate process.  I've had to do something like
that once...

				jim (uunet!actnyc!jsb)



More information about the Comp.sys.sun mailing list