ITT Rule IDL Version 7.0 Instrukcja Użytkownika Strona 353

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 430
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 352
Chapter 15: Creating a Custom iTool Widget Interface 353
iTool Developer’s Guide Handling Callbacks
PRO example2_wdtool_callback, wBase, strID, messageIn, userdata
; Retrieve a pointer to the state structure.
wChild = WIDGET_INFO(wBase, /CHILD)
WIDGET_CONTROL, wChild, GET_UVALUE = pState
; Handle the message that was passed in.
CASE STRUPCASE(messageIn) OF
'FILENAME': BEGIN
filename = FILE_BASENAME(userdata)
newTitle = (*pState).title + ' [' + filename + ']'
WIDGET_CONTROL, wBase, TLB_SET_TITLE = newTitle
END
ELSE: ; Do nothing
ENDCASE
Your callback routine may be more complex, handling any number of messages sent
to the user interface. In practice, the callback routine for a user interface is often quite
simple — the standard user interface used by the iTools in IDL 6.2 handles only three
messages.
Note
Your callback routine is also free to quietly ignore any messages. For example, you
may choose to do nothing when the FILENAME message is received.
Przeglądanie stron 352
1 2 ... 348 349 350 351 352 353 354 355 356 357 358 ... 429 430

Komentarze do niniejszej Instrukcji

Brak uwag