manoj Posted September 24, 2017 Report Share Posted September 24, 2017 Hi, I am planning to to show a random images as screen saver but upon any touch on screen I want to render a page, How can I do the detecting the touch part ? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted September 25, 2017 Report Share Posted September 25, 2017 The easiest way is to use the existing pushbutton widget and using the existing image rendering routine for it. You pass a pointer to a gdispImage object via the parameter of the custom rendering function. Just use gwinSetCustomDraw() to change the parameter whenever you want to change the random picture. Then just listen to the pushbutton even that gets fired when the button gets pushed. Easy as that. You can simply use gwinHide() and gwinShow() to control the visibility of your screen saver widget (button). Link to comment Share on other sites More sharing options...
inmarket Posted September 25, 2017 Report Share Posted September 25, 2017 Another alternative is to setup your own listener to listen for mouse events. Your main loop would then pick up the touch events. If you are gwin (and it sounds like you are) then Joels method above is easiest. If you are not using gwin then setting up your own listener is the appropriate way. Link to comment Share on other sites More sharing options...
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