Changing the position/location of a ControlP5 ControlWindow [SOLVED]
in
Contributed Library Questions
•
1 year ago
I am positioning a ControlWindow at the top right corner of the screen at creation. Is there a way to dynamically move it if the main screen is moved. I tried both ControlWindow.setLocation and ControlWindow.setPosition neither seems to work. I currently have it show() when the mouse is moved to the top/right corner in the mouseMove Event. Ideally I'd like to find a Window/Frame move event for the new positioning but this will do if I can get it to work.
- void mouseMoved(MouseEvent mouseEvent) {
- if ((mouseEvent.getPoint().x > width - 50) && (mouseEvent.getPoint().y < 50) ) {
- controlWindow.setUndecorated(true);
- controlWindow.setPosition(pntMainScreenXY.x + width - 400, pntMainScreenXY.y + (frame.getBounds().height-height));
- controlWindow.show();
- }
- }
1