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

Home » Public Forums » archive » Re: Object Widgets
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Object Widgets [message #17688 is a reply to message #17680] Wed, 10 November 1999 00:00 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
More on Struan's widgets. Sorry for thinking aloud on the group but I find
it all quite interesting.

I have thought of a simple (and in hindsight obvious) solution for the heap
cleanup problem for blocking widgets. Just have the Init method for blocking
widgets always return 0. That way the object exists (in some sense) while
the widget application is running but when the widget application exits it
returns to the Init method, which tells IDL that initialisation was not
successful. Sounds dodgy, but seems to work! So the Init method in Struan's
code becomes (additions in capitals):

function SLFow_minimal::init, BLOCK=BLOCK, _ref_extra=extra

if not (self->SLFoWid::init(BLOCK=BLOCK, _extra=extra)) then begin
print, 'SLFow_minimal: failed to initialise SLFoWid'
return, 0
endif

self.myWidID = widget_base(uvalue=self, title=self.title, /column,
xsize=200)
temp = widget_button(self.myWidID, value='Undefined')
self.quitbut = widget_button(self.myWidID, value='Quit')

widget_control, self.myWidID, /realize

self -> xmanage

IF KEYWORD_SET(BLOCK) THEN RETURN, 0 ELSE return, 1

end ; function SLFow_minimal::init

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Two widget questions
Next Topic: Re: Center of mass???

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

Current Time: Sun Oct 12 07:13:24 PDT 2025

Total time taken to generate the page: 0.16121 seconds