ITT Rule IDL Version 7.0 User Manual Page 307

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 306
Chapter 13: Creating a User Interface Service 307
iTool Developer’s Guide Example: Changing a Property Value
; Create the dialog.
wBase = WIDGET_BASE(/COLUMN, TITLE = dialogTitle, $
GROUP_LEADER = groupLeader)
wText = WIDGET_TEXT(wBase, YSIZE = 3, $
VALUE=['The original NAME is:', origName, $
'Enter a new name:'])
wEdit = WIDGET_TEXT(wBase, VALUE = origName, /EDITABLE)
wSubBase = WIDGET_BASE(wBASE, /ROW)
wOK = WIDGET_BUTTON(wSubBase, VALUE='OK', $
EVENT_PRO='wdSrvExample_ok')
wCancel = WIDGET_BUTTON(wSubBase, VALUE='Cancel', $
EVENT_PRO='wdSrvExample_cancel')
; Create a state structure to hold important values.
state = { wOK:wOK, $
wCancel:wCancel, $
wEdit:wEdit, $
pName:PTR_NEW(/ALLOCATE) }
; Store the original property name attribute in the
; state structure.
*state.pName = origName
; Store the state structure in the user value of the
; top-level widget base.
WIDGET_CONTROL, wBase, SET_UVALUE = state
; Realize the widget hierarchy.
WIDGET_CONTROL, wBase, /REALIZE
; Call XMANAGER.
XMANAGER, 'wdSrvExample', wBase
; After XMANAGER exits, retrieve the value of the name
; property attribute from the state structure.
result = (N_ELEMENTS(*state.pName)) ? *state.pName : origName
; Free the pointer.
PTR_FREE, state.pName
; Return the new value of the name property attribute.
RETURN, result
END
Page view 306
1 2 ... 302 303 304 305 306 307 308 309 310 311 312 ... 429 430

Comments to this Manuals

No comments