-
Notifications
You must be signed in to change notification settings - Fork 19
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
Button event not trigger when child of Panel #37
Comments
How did you add the child specifically? |
I used this code : _panel = new mint.Panel ({
parent: canvas,
name: 'panel1',
x: 10, y: 100, w: 200, h: 200,
options: {
color: new Color().rgb(RefColor.CARROT),
}
});
new mint.Button({
parent: _panel,
name: 'btn_index2',
x: 10, y: 52, w: 60, h: 32,
text: 'Index',
text_size: 14,
options: {
label: { color: new Color().rgb(RefColor.CLOUDS)},
color_hover: new Color().rgb(RefColor.AMETHYST)
},
onclick: function(e,c) { trace('clicked');}
}); |
https://gist.github.com/Blist/e852d419c734418ff202 Is it a piece of code Who isolate the bug. The panel does not transmit its signals(click, focus, input) to these children. Works with the empty_luxe project. |
Just to add a little info, I had a similar problem before with panels being the parent of an interactive element like Buttons and Sliders. A discussion with @underscorediscovery revealed that the parent element may not be maintaining a list of children properly when the child element is parented and that telling the container/parent element to set the Button/Slider as a child should work (it didn't for me). Here's @underscorediscovery 's words:
Parenting the interactive element to something other than a panel, like a Window, is the workaround I ended up using. |
Ok I had a quick look, and my first guess was close:
Note the addition of In the meantime enable mouse input on the panel and it should work. I should note though, the default mouse_input is false, specific controls that use the mouse (like windows) set it to true, because they expect mouse events for things like moving and closing and so on. (So the behaviour is somewhat expected to not receive mouse events on a panel, I am looking into if that makes sense for its children) |
It looks like this issue would be solved by #44 |
Hi,
I am not sure if this is a bug or not. But if I add a button inside a panel then the button don't react to mouse input.
However, if I place it inside a window then it act correctly.
Is it the intended behavior ?
The text was updated successfully, but these errors were encountered: