comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: What's the id of that widget?

What's the id of that widget?
type: item
description: I've been developing a pretty complex app in IDL. Several widgets are managed by the xmanager and do not return their id to the calling program. What if I want to unmap, hide, control that widget and all I know is the name that was registered with the xmanager? Below is a quick hack I did of the xregistered routine. I've added two keywords, NOMAP and GET_ID. NOMAP prevents remapping of the found widget and get_id will return the id of the found widget rather than 1. Use: ... Xmanager, 'Something',... . . . id = xregistered('something',/get_id) widget_control, id, map = 0 . . . Hope others find this useful. Regards, Phil --------------------------------------------- function XRegistered, NAME, NOSHOW = NOSHOW, NOMAP = NOMAP, GET_ID = GET_ID ;+ ; NAME: ; XREGISTERED ; ; PURPOSE: ; This function returns true if the widget named as its argument ; is currently registered with the XMANAGER as an exclusive widget, ; otherwise this routine returns false. ; ; CATEGORY: ; Widgets. ; ; CALLING SEQUENCE: ; Result = XREGISTERED(Name) ; ; INPUTS: ; Name: A string containing the name of the widget in question. ; ; KEYWORD PARAMETERS: ; NOSHOW: If the widget in question is registered, it is brought ; to the front of all the other windows by default. Set this ; keyword to keep the widget from being brought to the front. ; NOMAP: Set this keyword to prevent remapping of the found ; widget. ; GET_ID: Set this keyword to have XREGISTERED return the widget ; id. ; ; OUTPUTS: ; If the named widget is registered, XREGISTERED returns the number ; of instances of that name in the list maintained by XMANAGER. ; Otherwise, XREGISTERED returns 0. ; ; COMMON BLOCKS: ; MANAGED ; ; SIDE EFFECTS: ; Brings the widget to the front of the desktop if it finds one. ; ; RESTRICTIONS: ; None. ; ; PROCEDURE: ; Searches the list of exclusive widget names and if a match is found ; with the one in question, the return value is modified. ; ; MODIFICATION HISTORY: ; Written by Steve Richards, November, 1990 ; …
creator: Phil Williams
date: 1996-12-20T08:00:00-00:00