ITT Rule IDL Version 7.0 User Manual Page 342

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 341
342 Chapter 15: Creating a Custom iTool Widget Interface
Creating the Interface Routine iTool Developers Guide
compound widgets, we include the following statement after creating our top level
base widget:
oUI = OBJ_NEW('IDLitUI', oTool, GROUP_LEADER = wBase)
Note that we need the iTool object that was the argument to our interface creation
routine to create the user interface object. Note also that we specify our top level base
as the GROUP_LEADER of the interface object; this will ensure that any floating or
modal dialogs displayed by the interface appear in the correct place.
Widget Creation and Layout
Your custom iTool interface can include both iTool compound widgets and
traditional IDL widgets. These are created in the same way as in a traditional widget
application. The finer points of creating iTool compound widgets are discussed in
later sections of this chapter.
User Interface Registration
Near the end of the widget creation routine, after the widget hierarchy has been
realized, we must register the top-level base with the user interface object:
myID = oUI->RegisterWidget(wBase, 'Example 2 Tool', $
'example2_wdtool_callback')
Here we specify the name of the callback routine that will handle messages from the
iTool components. The return value from the RegisterWidget method is the iTool full
identifier of the widget interface. We next use the identifier to specify that the
interface is an observer (that is, that it can receive messages generated by iTool
components) for the associated iTool:
oUI->AddOnNotifyObserver, myID, oTool->GetFullIdentifier()
This ensures that messages generated by the iTool are handled by the specified
callback routine.
Handling Widget Destruction
Many complex interfaces rely on a state structure containing information about the
widgets in the interface. If you pass a reference to this state structure between
routines in your user interface code using one or more pointers, free the pointers
when the widget interface is destroyed. In our example interface, a pointer to the state
structure is stored in the user value of the first child widget of the top level base
widget. The following statement specifies a routine to be called when the widgets are
destroyed:
Page view 341
1 2 ... 337 338 339 340 341 342 343 344 345 346 347 ... 429 430

Comments to this Manuals

No comments