Page 1 of 1
Smart way to determine poupmenu gets out of screen?
Posted: 09 Nov 2024 20:08
by eil
Is there a smart way to determine that popupmenu() is too long and some items are out of screen? Smth like a trigger determining that popupmenu is long enough to show those top/bottom arrow, or at least a screen-height variable.
Re: Smart way to determine poupmenu gets out of screen?
Posted: 10 Nov 2024 15:30
by admin
Counting?
Re: Smart way to determine poupmenu gets out of screen?
Posted: 10 Nov 2024 20:39
by eil
Yeah, that's the only variant i imagined: count how many items are visible, add counter check in menu forming code, put "extra" in nested menu. But that works only if menu position is the same. If menu is formed in various/mouse position, or if screen resolution(monitor) changed, such counter will "miss-calculate".
Re: Smart way to determine poupmenu gets out of screen?
Posted: 10 Nov 2024 21:14
by highend
Either create smaller hierarchies via popupnested() or use inputselect() (no, not a menu but no problems to display as many items as you want) instead...
Re: Smart way to determine poupmenu gets out of screen?
Posted: 11 Nov 2024 17:17
by eil
Thank you for the hint about inputselect(), didn't consider that initially. But in my case it can't do, as only popupmenu() works with b64icons, and that's the main point why i started using dynamic long menus in my workflow.
I was actually hoping that maybe some <get ..> variation could determine popupmenu's state(that those top/bottom arrows for scrolling menu got activated), but guess will try to work smth with <get "screen"> and cursor position.
I'd wish popupmenu could be simply scrollable with mouse.