Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use gLabel, goto or gosub on a neutron Button? #8

Open
ghost opened this issue Feb 22, 2021 · 1 comment
Open

how to use gLabel, goto or gosub on a neutron Button? #8

ghost opened this issue Feb 22, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 22, 2021

Hello, guys
Have any way to do it?
I'm needing to take the form, break the Neutron window and start other things

@dpalay
Copy link

dpalay commented Mar 22, 2021

There's a number of ways to do this, but the simplest is that you're just replacing the gLabel with the onclick in the html.
In the html, you have an onclick element, and pass it ahk.yourFunctionNameHere(event)
Then in your AHK code, you define that same function:

yourFunctionNameHere(neutron, event) {
;stuff you want your function to do
}

And that's it. Clicking the button will trigger the "yourFunctionNameHere" code to run.
If you still want to make use of the goto & gosub, you can just add those into your function. This is an example of a function being passed to the button in the html that uses a dynamic array variable to tell it which subroutine to run

Button1(neutron,event){
    global 
    gosub %mainArr_sub_1%
    return
    }

the html:
<button id="b1" type="button" onclick="ahk.Button1(event)">Click me!</button>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant