ITT Rule IDL Version 7.0 User Manual Page 374

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 373
374 Chapter 15: Creating a Custom iTool Widget Interface
Example: a Custom iTool Interface iTool Developers Guide
location = [(screen[0] - baseGeom.xsize)/2 - 10, $
((screen[1] - baseGeom.ysize)/2 - 100) > 10]
ENDIF
WIDGET_CONTROL, wBase, MAP = 0, $
TLB_SET_XOFFSET = location[0], $
TLB_SET_YOFFSET = location[1]
; Get the widget ID of the first child widget of our
; base widget. We'll use the child widget's user value
; to store our widget state structure.
wChild = WIDGET_INFO(wBase, /CHILD)
; Create a state structure for the widget and stash
; a pointer to the structure in the user value of the
; first child widget.
state = { $
oTool : oTool, $
oUI : oUI, $
wBase : wBase, $
title : title, $
basesize : [0L, 0L], $
wToolbar : wToolbar, $
wDraw : wDraw, $
wStatus : wStatus, $
wSlider : wSlider, $
wLineSize : wLineSize, $
wLineColor : wLineColor }
pState = PTR_NEW(state, /NO_COPY)
WIDGET_CONTROL, wChild, SET_UVALUE = pState
; Realize our interface. Note that we have left the
; interface unmapped, to avoid flashing.
WIDGET_CONTROL, wBase, /REALIZE
; Retrieve the starting dimensions and store them.
; Used for window resizing in event processing.
WIDGET_CONTROL, wBase, TLB_GET_SIZE = basesize
(*pState).basesize = basesize
; Register the top-level base widget with the UI object.
; Returns a string containing the identifier of the
; interface widget.
myID = oUI->RegisterWidget(wBase, 'Example 2 Tool', $
'example2_wdtool_callback')
; Register to receive messages from the iTool components
; included in the interface.
Page view 373
1 2 ... 369 370 371 372 373 374 375 376 377 378 379 ... 429 430

Comments to this Manuals

No comments