Moving a popup along with its pseudo-parent?


#1

hello again,

today my situation is as follows: i have some gui component which lets the user inflate a context menu / popup for advanced options. this context menu is not a child component of the original gui component, because it must extend beyond its boundaries. instead, i use addToDesktop, etc. like the pop-bubbles and popup-menus do (a juce::PopupMenu is not suitable for me here, because my context menu must have sliders, buttons, etc. on it). now if i move the whole app (or plugin, in this case) - the context menu stays where it is. Component::moved will not get called, because the pseudo-parent’s relative position did not change. what i need would be something like Component::movedAbsolute() or something. is there a way, or if not would it be possible to add such a callback to Component?

thanks, robin


#2

Take a look at the ComponentMovementWatcher class. That should do what you need…


#3

thanks jules - will do that.