Functions | |
void | Get_Selection (char *segment) |
void Get_Selection | ( | char * | segment | ) |
Performs all the work needed to have the user point at something on the screen.
segment | - The "simple" name---not including the segment's owner, the owner's owner, and so on---of the segment that includes the window or piece of geometry selected. Passed by reference always. Returned to user. |
In pseudo-C, Get_Selection() corresponds to the following:
Enable_Selection_Events ("?locater", "?Picture") do Await_Event (&type) until (strcmp (type, "selection") == 0) Disable_Selection_Events ("?locater", "?Picture") Show_Selection (&segment)
The "segment" is then returned to the original caller. The various Show Selection routines can then be called to gain extra information about the selected item.
Get_Selection() does not verify that the event received matches the type of selection event enabled.
Get_Selection() and Show_Selection() both return the same information to your program. Get_Selection() is a high-level routine that does a variety of work. Show_Selection() is a low-level routine whose only function is to extract one existing piece of information from the database.
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 back into HOOPS.