comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » quit/close events on mac
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
quit/close events on mac [message #70876] Thu, 13 May 2010 23:39
Stewart Allen is currently offline  Stewart Allen
Messages: 3
Registered: May 2010
Junior Member
Hi all,

I'm running IDL 7.0 on a mac under leopard 10.5.8. I'm trying to
create a widget program, but I can't seem to get the window manager to
respond to quit events. Specifically, the window's default 'quit'
button is unresponsive to events.

For example consider the following simple code that creates a single
'done' button, along with event handlers
-----------------------------

; event handler for done button widget
PRO example_event, ev
help,/traceback
WIDGET_CONTROL, ev.top, /DESTROY
END

; dummy cleanup routine with a print statement so we know we are in
it.
PRO example_cleanup, base
help,/traceback
print,'cleaning: ',base
END
; End of the event handler part:

; This is the routine that creates the widget and registers it with
; the XMANAGER:
PRO example

; Create the top-level base for the widget:
base = WIDGET_BASE(TITLE='Example')

; Create a nice BIG Done button:
done = WIDGET_BUTTON(base, VALUE = 'Done',xsize=200,ysize=50)
; Realize the widget (i.e., display it on screen):
WIDGET_CONTROL, base, /REALIZE

; Register the widget with the XMANAGER, leaving the IDL command
; line active:
XMANAGER, 'example', base $
, cleanup='example_cleanup' $
, /NO_BLOCK

; End of the widget creation part:
END

-----------------------------

If I run example, it creates the widget correctly. Then, if I click
the done button, it calls the event handler, which in turn calls the
cleanup handler - as I expect. However, if I click the window's 'quit'
button (i.e. the default window quit button next to the minimize and
maximize buttons), the cleanup handler is not triggered... but I can't
understand why not!

If I run this code on a linux box, with X-forwarding back to my mac,
the quit button works as it should... This has me well puzzled.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Formatting WRITE_CSV output
Next Topic: Re: quit/close events on mac

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:26:23 PDT 2025

Total time taken to generate the page: 0.00424 seconds