As they define a lot of buttons, I want to use a single event for the clicks, and identify them by their handle.
When I define everything "flat" by using labels, it works as it should.
This sample open a second button when the button "Open" is pressed, and when the second button is pressed, prints it's handle value.
It works as expected.
Code: [Local Link Removed for Guests]
gosub Page0
gui.autorefresh 30,1
wait
Page0:
numpadrunning = 0
GUI.init 50, blue
but_Value = gui.button(10,35,70,40,"Open",4,0,0,1,black,white,red,red)
gui.setevent but_Value,1,Valueclick
Return
Valueclick:
If NOT numpadrunning Then
x=10
y=80
gosub numpad
Endif
Return
numpad:
numpadrunning = 1
num_1 = gui.button(x, y,70,40,"Close",4,4,0,10,black,white,red,black)
gui.setevent num_1, 1, numclick
Return
numclick:
wlog(num_1)
Return
Code: [Local Link Removed for Guests]
gosub Page0
gui.autorefresh 30,1
wait
Page0:
numpadrunning = 0
GUI.init 50, blue
but_Value = gui.button(10,35,70,40,"Open",4,0,0,1,black,white,red,red)
gui.setevent but_Value,1,Valueclick
Return
Valueclick:
If NOT numpadrunning Then
x=10
y=80
numpad x, y
Endif
Return
sub numpad(x, y)
numpadrunning = 1
num_1 = gui.button(x, y,70,40,"Close",4,4,0,10,black,white,red,black)
gui.setevent num_1, 1, numclick
end sub
numclick:
wlog(num_1)
Return
How can I avoid/circumvent it?
Is there another method to put such functionality inside a subroutine?