Functions | |
void | Show_Selection (char *segment) |
void Show_Selection | ( | char * | segment | ) |
Returns the name of the segment that was selected by the user.
segment | - The "simple" name---not including the segment's owner, the owner's owner, etc.---of the segment that includes the window or piece of geometry that gave rise to the current selection-type event. Passed by reference always. Returned to user. |
The simplest detail of a selection event is the name of the segment selected. If the "selectability" attribute of this part of the segment tree was set to just "window", or if geometry was selectable too, but there wasn't anything appropriate within range, the segment named is the segment that had the relevant window. If an element of geometry was selected, the segment named is the one within the window that contained the particular geometry. (You can determine which is the case by calling Show_Selection_Element() .)
The Show routines can be called repeatedly on the same current event without harm, if that's convenient to your program.
If the segment selected was originally created as a "no-name" segment, then the string returned will be in form of "@hex", where "hex" is the hexadecimal encoding of the segment's key. Note that this style of segment name is acceptable as input to all the various HOOPS segment routines.
If the current event is not a selection-type event, or if there is no current event, Show_Selection() will complain.