Loading...
 

GetCurrentWidget

GetCurrentWidget

GetCurrentWidget(windowID), GetCurrentWidget

parameters: Identifier of a Windows

Stack
Stack Position Description
Stack(In) Top -
Stack(Out) Top Window object

This is a special command for use within a SELECT event in a menu item.

If this item is called as a popup menu from a widget (via flag CONTEXTMENU or PopupMenu), GetCurrentWidget returns this window object.
The Widget command, which can be used in other actions with window objects, cannot be used here, because it would bring the item itself onto the stack when called from an item. The calling widget is not even active at the time of execution of the SELECT code of the item. To make item implementations reusable, GetCurrentWidget closes this gap.

In case an item has been called from the main menu (only possible if it has been defined in a structure with keyword Menu ), GetCurrentWidget returns NULL. This case can also be distinguished from the possible calls from a widget (so to say as "0. case").