i want to define a custom behaviour for the button control
the goal is to have a button that has a particular image on hover, when it is pushed, and when it is released
i also want to be able to define a toggle state wich allows the button to remain down (among a group of buttons)
a bit like windows/X interface buttons
so as i checked the ButtonControl class, i see that it is deprecated and suggested to use de.lessvoid.nifty.controls.Button
but i can’t find any class that implements that interface
do i have to use this, or can i just rewrite/override the ButtonControl class ?
what is the best practice here ?
The ButtonControl class is the correct class, it was deprecated to get people to switch to accessing the interface as the interface was added later. It is actually the class in use and live though.
thx for your answers
but the basic implementation of the nifty button is really weird
the button styles seems to use onfocus to change the image with imageChange effect
so the buttons gets focused as i click on it …
and then it keeps focused, then it does not remove the imageChange
wich leads to a really ackward behaviour, : as the button gets clicked, it changes color(image) and remains that way…
the controller seems to call the onclick when it receives the Activate event
and when it receives mouse buttons event, it only seems to change the focus status
wich makes me wonder about the meaning of Activate and Focus status/events (??)
is it alright if i use the mouse clicks to change the images and call onclick when the mouse button is released ?
i mean why is it not implemented that way ?
as i use imageMode="sprite-resize… how do i change the sprite id of the current backgroundImage when i hover/click the button ?