One panel multiple popup menus



  • Is it possible to open a panel's popup menu from its mouse callback?

    Here's the situation, I need 12 menus and all menus will contain the same items. What each menu affects is handled by my script. I'd like to use a single panel to display all 12 menus rather than having to use 12 individual widgets. Is this possible?



  • @d-healey Why don't you go "zone detection" instead of using panel integrated menus?
    So one menu panel sliced in 12 zones, and a viewport for the items that align to the clicked zone maybe...



  • @ustk Zone detection is what I want, but how do you make the menu open from a mouse click?



  • @d-healey Actually I just discovered that if the item list is not empty, then event.clicked is bypassed, so you cannot perform zone detection (or mouse event) in conjunction with panel menus apparently...
    I am working on a solution with viewport instead, it's quite straight forward so I think it can be a solution



  • @d-healey Here's where I am:

    HiseSnippet 1362.3ocsW0uTabCDWGvkI9RoooSe.Tc+myAWxYBjOFZmBw.ILM.tXBk1NcxHemrOMbVxnSFhSFl1Gh9.1Gg9FztR2m1bIShmo1CbVq1c0u8Ks60QJ7owwBIxp1ISFQQVelc2IbUX6PBii1eGj0mae.IVQk3DROaxHRbLM.YYs3y0DrpsDx74e9gmQhHbeZAID5TAym9R1PlpfZms9QVTzdj.5Irgk3d8s12WvaKhDiA7rnsGZDw+bx.5gDMaKXirt0tALkP1UQTzXfmmIBlzMTbEOg+SYwrdQT8hVntfhRHiZGxhB5jYqwHj0RcJr7ESr7ux9.V.KmdgG3KLafKjnrOvZgogzRSAoVuOHsmHJPqf2C7rJAukRf28r65KYiTE6nw1cr2mCAm9DvsWFVI7hV3OssaK.N3pUGRNmtmDVjKg6i77Zh2vyqwlK6.rEKhnq5GQIRWMkjuPHIVgujHwcHbZTK72iyz3.ppsX3HAGV3VOY65ZIKj4TF8pQBo58KVNG0yNyBoeKvSLH4FaNK0elEnBgcRNTsJMTbafePhT43OkiXppCDPUGKFqXbpa+wbeESvcGzv4cN05KjXWFnPuMwL72kpCLakUZ7tkcpggOoOFnUURRp6ADU3pRBO.botqu1ieRqm58vGtQS75q8z0ep2Zds1ng1pLBpgNQRIvg7aElv8wrlXHJjSoIVExh0VzKnrAgJ2F+9l4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DCSJS.Bc10zuvxZWNAxxLYjn+CP18S.m
    

    Not entirely done, but I have to leave for an hour 😉



  • That's not too bad 🙂 Actually it might be better to use another panel instead of a viewport, then it can be styled. Thanks for the tip!



  • @Christoph-Hart There is a problem with the panel callbacks when using popup items. Basically you can't use any callbacks greater than ContextMenu. I understand why this is but I think there should be an exception to the callback levels system so that the popup menu only appears when ContextMenu is selected, if you select any levels above that it should not display the context menu when you click the panel (otherwise the click level is useless).



  • @d-healey In fact, they are working, but not with the click (left vs right) that is associated with the context menu (which does not make it really usable anyway...)



  • Yeah this example (built on your snippet) demonstrates the issue. Clicking on a menu item opens the popup but all I want is to trigger the callback. The work-around obviously is to not store the menu items in the panel, but this is the perfect place for them 🙂

    HiseSnippet 1528.3ocsWs2aaaCDWJMZn1cYcEXe.3LvJjZ7brcR5ikETm5jrZrkVu31thk0UvHQaSDYRAI5j3FDr9Ed.6av1QR8f1wIqv.k+CEui2wi+tG5X2XtOIIgGaYW5UShHV1eoSuILwv1CwTlUmcsr+JmCvIBRLRS5YShvIIj.Ka6a8SRB1kV1RM9mm9LbHl4SJHYY8FN0m7KzQTQA0ts9YZX393.xqniL18Fs53yYs4g7wf8bKm5VQX+SvCHu.K21RNV1ewdATAOtm.KHIV1K+LdvjdC4mwz6+MzD5wgD4hFV8.EoIuOOLPZwRpVsGRCC5lcuSr.szs.EtkFE9FmCnAzb5EnwWqXfJjvDOrW5lLuFllW8Ocyy1v7VVad2yomeLMRTvQZa2woCCbT8wfKvzrz60Zo+71Ns4vNXhZivmP1OFVjKg6CqWuJZy5081Zkxv1R3gjZ9gDbrqjxJkAWSh.cJNF0EyHgMPaixz1.hnMeTDmAKbqnYWYVo9.vNADZyslk5uQCDCANZAkZSQw0CslVJklR4lPDcAmg3P9XAkQb6Ol4Knbl6.uxWTtTedLxkBJq9VHJ5GSkGQWcUuKVobIDLRmFHUkNXy8.rXXsXLK.fC2MZ9nG23I0We8Mqh1n4S13I0aVuwldx6iRPoYiiIX3PNpv7e.h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