hey there,
I'm stuck again, and need help !
I'm trying to have a 2 states button (active/inactive) so the
var buttons = new _buttons();
buttons.update = function () {
this.buttons.stop = new _button(100, 0, 35, 35, { char : chars.stop, colour: RGB(255, 250, 250)}, null, function () { console.log("foo");}, 'foo');
this.buttons.Text = new _button(150, 0, 35, 35, { char : chars.console, colour : RGB(255, 250, 250)}, null, function () { console.log("bar"); }, 'bar');
}
in the "Track info + Seekbar + Buttons.txt" example looks perfect for that as i can play with the "char" element.
Also, i have other buttons in the panel using the "SimpleThemedButton + Tooltip" example (i do prefer the round style of the buttons.
My issue is that i dont really understand how to trigger the function console.log("foo")
Here is the Left mouse button up function that is supposed to manage both buttons type :
function on_mouse_lbtn_up(x, y) {
g_down = false;
if (buttons.lbtn_up(x, y)) {
return;
}
if (cur_btn) {
if (cur_btn.func) cur_btn.func();
cur_btn.changeState(ButtonStates.hover);
window.Repaint();
}
}
As you can see, i didnt touch the original "SimpleThemedButton + Tooltip" function but i simply added
if (buttons.lbtn_up(x, y)) {
return;
}
to follow the example of "Track info + Seekbar + Buttons.txt"
Well, when i click on the this.buttons.stop, nothing happens.
Am i doing something wrong, is that feasible at all ?
thanks