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

Home » Public Forums » archive » Re: processing widget events from multiple hierarchies
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: processing widget events from multiple hierarchies [message #26340] Wed, 22 August 2001 14:02 Go to previous message
ronn is currently offline  ronn
Messages: 123
Registered: April 1999
Senior Member
Hi Rick,

It looks like the only mistake was that the event_pro keyword must be a
string. The fix is below...

-Ronn

--
Ronn Kling
KRS, inc.
email: ronn@rlkling.com
"Application Development with IDL"� programming book updated for IDL5.4!
"Calling C from IDL, Using DLM's to extend your IDL code" NEW BOOK!
http://www.rlkling.com/

-------------cut here--------------------------------
; Code fragment illustrating problems with event_pro specification.
; Events go to XWidTest_event( ), not XWidTest_Param( ),
;XWidTest_ParamAccept( ), XWidTest_Param2( ).

;////////////////////////////////////////////////////////
;/// modal dialog ///
pro xWidTest_param,event
print,'you pressed enter in the text widget'
return
end

pro XWidTest_ParamAccept,event
print,'you pressed the accept button'
return
end

pro XWidTest_Action3, event

widget_control, event.top, Get_UValue=info, /No_Copy

; If this widget already exists, then don't duplicate it
if (NOT widget_info(info.baseAID, /valid_id)) then begin
info.baseAID = widget_base(column = 1, title = 'parameters')

baseA1ID = widget_base(info.baseAID, column = 2)
labelA1ID = widget_label(baseA1ID, value = "parameter 1")
editA1ID = widget_text(baseA1ID, value="edit 1", uvalue = "PARAM1",$
/EDITABLE, event_pro ='XWidTest_Param')

; .... other base/label/text commands omitted for clarity

buttonAID = widget_button(info.baseAID, value="accept", $
event_pro ='XWidTest_ParamAccept')

widget_control, info.baseAID, /realize
endif ; (widget already exists test)

xmanager, 'XWidTest', info.baseAID, /NO_BLOCK, event_handler =
'XWidTest_Param2'

; restore the user data handle
widget_control, event.top, Set_UValue=info, /NO_COPY

end

;////////////////////////////////////////////////////////
;/// main program ///

pro XWidTest

base1ID = widget_base(column = 1, title = 'base 1')
menuID = WIDGET_BUTTON(base1ID, VALUE='Test', /MENU)
action3ID=WIDGET_BUTTON(menuID, VALUE='pop-up dialog', $
UVALUE='ACTION3', EVENT_PRO="XWidTest_Action3")

widget_control, base1ID, /realize

; place holder for dialog widget
baseAID = -1L

; pass pointer to window data
info = {baseAID:baseAID}
widget_control, base1ID, set_uvalue=info, /NO_COPY

xmanager, 'XWidTest', base1ID, /NO_BLOCK

end
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: a simple color question (very simple)
Next Topic: _ref_extra

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

Current Time: Wed Oct 08 20:13:33 PDT 2025

Total time taken to generate the page: 0.00425 seconds