Loop through controls
User (firstname.lastname@example.org) posted:
Can someone tell me if it's possible to loop through all the controls
in a window and get the label of each? Is it possible if the window
is not in the gui map?
Re: Loop through controls
User Richard Weber (email@example.com) posted:
Yes it's possible and depending on what type of coding you do, it can come
up a lot. If the window is not in the GUI map then the objects will not be
either. This is possible too, but could get kinda difficult.
I suppose there are several ways of doing it. One would be to dynamically
create a GUI entry for the window and add all of its objects on the fly,
assuming you have the physical descriptions of these objects ahead of time.
The rest of the function would then be very similar to the get_focus()
function found in "[WR]\samples\flight\tabordck", except you would be
getting whatever value you wanted (label) and not exit when the 1st item is
Here's the easy part... (the hard part is not having GUI entries)
# This will create an array of logical object names
# Alternately you could use physical descriptions here instead of logical
names, if the objects are not in the GUI map
GUI_list_win_objects(guimap,window, object_array, object_count );
for( i in object_array )
if ( obj_exits( object_array [ i ] ) == E_OK )
obj_get_info ( object_array [ i ], "label", label_array[i] );