G4P: How do you draw a rect or image on top of a GUI window?

edited August 2014 in Library Questions

I know you can use something like win_draw(GWinApplet appc, GWinData data) to draw to a GUI window before it draws, but can you draw something on top of the GUI window after it is done drawing?

Tagged:

Answers

  • In the main sketch window you have the draw() method, in a G4P window the win_draw(GWinApplet appc, GWinData data) does exactly the same thing but for the window.

    If there is a way to draw on top of the main applet window after draw() has finished then the same technique can be used for the the G4P window. :)

    Perhaps you can explain what you are hoping to achieve.

  • edited August 2014

    I've created a control panel window using the GUI builder tool. I'm now trying to draw an image inside that window on top of a (non moving) panel. If I draw the image in win_draw, the panel draws on top of the image. I'm trying to find a way to draw that image after the panel has drawn, so the image sits on top of the panel.

  • Answer ✓

    All G4P controls are drawn after draw so that they cannot become hidden, that includes GPanel. There is no way round it. The only alternative is to use the GSketchPad control. Have a look at the example that comes with the library.

  • That will work. Thank you for the help and for your library quark!

Sign In or Register to comment.