MaxGui Labels block interaction

BlitzMax Forums/MaxGUI Module/MaxGui Labels block interaction

AdamRedwoods(Posted 2010) [#1]
Say you CreateLabel onto a panel that has a width of the panel. Then you try to get mouse events from that panel.

Looks like the label blocks any mouse interactions, and per manual, doesn't emit any interactions.

I know that SetGadgetSensitivity solves this, but why are labels absorbing interactions anyways? I think interactions should propagate through to the parent panel.

Is this worth putting into the bugs section?


ima747(Posted 2010) [#2]
I think because even though you can't see a label's area it blocks off the size you specify when you make it... try making a label next to a button and make the label too wide so it overlaps. I personally just chalk it up as a limitation of maxgui and spend some time resizing my labels. A bit of a hassle but nothing too bad.

As for when you might want a label to absorb an interaction: say you want a label to look like a web link and underline when the user mouses over. You set the gadget color, set it's font, and then catch mouseenter to set the font to be underlined, mouseleave sets it back to normal. if the user clicks maybe you change the font to the hit link color... Another example would be to have hidden info available for power users. An example is in iTunes if you plug in an iPhone/iPod/etc. and click on your device ID, it toggles to the UDID needed for developers to sign test apps for your device... It's obscure but more options are always nice.

Perhaps maxgui could be updated to only absorb interactions when a gadget is sensitive to them, so by default it would pass the action up to the parent. e.g. labels by default don't do anything so clicking just passes the event up to the parent gadget. But if you enable sensitivity to mouse then the label catches mouse actions and doesn't pass them up... This could also be useful for say canvases. By default they should catch mouse actions, but if you desensitize them to the mouse, then they pass mouse actions up to the parent...