Re: Win32lib question - can I tell the calling control?

new topic     » goto parent     » topic index » view thread      » older message » newer message

> From: John Coonrod

> Let's say I set the onClick event for a dozen different
> controls to the same
> procedure.
> Is there a way that this procedure can find out the handle
> for the calling
> control?

No, since onClick (a la win32lib) doesn't pass any parameters.  I'd suggest
changing the routine you have to accept the id, and creating other
procedures to 'wrap' it:

procedure all_onClick( integer id )
        if id = Control1 then
        ...
        elsif ...
        ...
        end if
        ...
end procedure

procedure Control1_onClick()
        all_onClick( Control1 )
end procedure
onClick[Control1] = routine_id("Control1_onClick")

etc...


Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu