Routines (alphabetical) > Routines: X > XREGISTERED

# XREGISTERED

The XREGISTERED function returns the number of instances of the widget named as its argument that are registered with XMANAGER in the current IDL session. The registered widget is brought to the front of the desktop unless the NOSHOW keyword is set.

If the specified widget is not currently registered with XMANAGER, XREGISTERED returns zero.

This routine is written in the IDL language. Its source code can be found in the file `xregistered.pro` in the `lib` subdirectory of the IDL distribution.

## Examples

Suppose that you have a widget program that registers itself with the XMANAGER with the command:

XMANAGER, 'mywidget', base

You could limit this widget to one instantiation by adding the following line as the first line (after the procedure definition statement) of the widget creation routine:

IF ( XREGISTERED('mywidget') NE 0 ) THEN RETURN

## Syntax

Result = XREGISTERED(Name [, /NOSHOW] )

## Return Value

The result is an integer containing the number of instances of the named widget that are registered with XMANAGER in the current IDL session.

## Arguments

### Name

A string containing the name of the widget in question.

Note: XREGISTERED checks for Name in a COMMON block created by XMANAGER. The stored name is case-sensitive.

## Keywords

### 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.

## Version History

Pre-4.0 | Introduced

## See Also

XMANAGER