Get widget handle from a procedure handle

Hi

Im trying to get the handle of a widget but cant seem to get any further than a window.

running the below will loop through all the procedures running but how would i get a handle to one of these so that i can chaneg the WINDOW-STATE

def var v-hand as handle no-undo.
def var v-hand2 as handle no-undo.

v-hand = session:first-procedure.

do while valid-handle(v-hand):
v-hand2 = v-hand:next-sibling.
MESSAGE v-hand2:TYPE VIEW-AS ALERT-BOX.
v-hand = v-hand2.
end.

any help is appreciated.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alonb's picture

if you're looking for

if you're looking for something look in the standard libraries first.

http://www.oehive.org/project/lib


{slib/slibwidget.i}



define var cWidgetList  as char no-undo.

define var wdgh         as widget no-undo.
define var i            as int no-undo.



cWidgetList = widget_getWidgetList( 

    input current-window,   /* parent to search in. the search will drill down all the levels. */

        /* you can also try the session handle */

    input ?,                /* type e.g. window, frame, fill-in */
    input ?,                /* name where applicable */
    input ? ).              /* label where applicable */



repeat i = 1 to num-entries( cWidgetList ):

    wdgh = widget-handle( entry( i, cWidgetList ) ).

    display
        wdgh:type
        wdgh:name.

end. /* repeat */


Thankyou, But..

Thankyou, But my enviroment doesnt allow me to install this libarary so just need a wasy to list all widgets if i know the name of the procedure.

Im afraid that progress use of siblings, childs and such is escaping me.

Thanks for your help


alonb's picture

well, you can think of them

well, you can think of them like other 4gl programs you or anyone else wrote on your system.

regarding these concepts or your coding problem ...

at some point you'll have to be independent.

maybe it doesn't help but there's no way around it.

if you have any specific questions you can't find in the help i'll try to help.

you can have a look the libraries or even the programming handbook.