Cannot create a pushbutton

Hello,

i managed to create a custom button
but as i use onClick it works
if i add onRelease, the onClick event gets discarded

so how do i create a button that reacts on mouse down/mouse released
to change the image as a user friendly feedback…

also if i use the onclick… events in my control definition, how can i override the onclick to have each control instance do domething particular ?

thx

stupid of me , i had 2 separate interact instead of one

this works : interact onPrimaryClickRepeat=“pushButton()” onPrimaryRelease=“releaseButton()” /

but how do i maintain the basic behaviour of my pushbuttons if i add another specialised interaction for each separate instance of button ?

the only way i managed to do this is to have a static reference to my application in the controller but it is really ugly

public void Click(String message)
    {
        Main.getApp().ProcessButton(message);
    }

is there another way ? i cannot assign a controller directly to a control and pass it user variables or listeners

is there no method like nifty.registerScreenController(controller); but for controls instead of screens ?

anyone ?

Create your own version of the button control and you can then set up your own controller for that.

@zarch said: Create your own version of the button control and you can then set up your own controller for that.

ok