naftilos76 Posted August 30, 2013 Report Posted August 30, 2013 Hi everyone, I have a problem with a window widget which contains a list. It shows up on the lcd just fine, it interracts with the touch panel well but when i call gwinSetVisible(window_handle, FALSE) i get a white area previously occupied by the window. Furthermore and most important i cannot draw anything outside this area. I even tried calling gwinDestroy() to destroy the window but still the problem persists.A simple few lines of code confirmed to me my sayings above: gdispFillArea(100, 60, 300, 250, Red); chThdSleepMilliseconds(2000); // The red rectangle area was filled with red as expected on the lcd gwinSetVisible(ghList1, TRUE); chThdSleepMilliseconds(2000); // The window containing a list of items was drawn as expected on the lcd covering partly the red rectangle area gwinSetVisible(ghList1, FALSE); chThdSleepMilliseconds(2000); // The area occupied by the window got white gdispFillArea(100, 60, 300, 250, Blue); chThdSleepMilliseconds(2000); // The blue rectangle area was drawn only on the area previously occupied by the window ghList1 gwinDestroy(ghList1); chThdSleepMilliseconds(2000); // Nothing changed on the lcd gdispFillArea(100, 60, 300, 250, Yellow); chThdSleepMilliseconds(2000); // The yellow rectangle area was drawn only on the area previously occupied by the window ghList1Am i doing anything wrong? What is the reason that i cannot draw outside the area of the window after setting its' status to invisible?Regards
Joel Bodenmann Posted August 31, 2013 Report Posted August 31, 2013 Making a widget unvisible using gwinSetVisible() will clear the entire widget area with the currently set background color. That's the reason why you get a differently colored rectangle there. Furthermore, a widget does have a clipped area using gdispSetClip(). However, destroying a widget should reset the clipper - I'll take a look into this. To draw anything on the screen, you should just create a plain GWIN window and draw to it using all the gwinDrawXxx(GHandle, ....) API calls (Take a look at /demos/modules/gwin/basic). This will workaround your clipping problem too.~ Tectu
naftilos76 Posted September 1, 2013 Author Report Posted September 1, 2013 Hi Tectu, You were absolutely right. That is probably the best method of doing things like drawing around, showing text etc. Everything must be an object with its' dedicated space to draw onto. I have tried so far creating a graph area and lots of labels which show various values. After struggling a little bit with the documentation and the uGFX website i got it working.Thanks a lot.Regardsnaftilos76
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now