Re: tiny little question about win32lib
- Posted by Icy_Viking May 23, 2019
- 1261 views
jessedavis said...
Herewith follows a short example program
-- code generated by Win32Lib IDE v1.0.4 Build July-06-2008 constant TheProgramType="exw" include Win32lib.ew without warning constant win = createEx( Window, "DEMONSTRATION WINDOW", 0, Default, Default, 474, 326, 0, 0 ) constant pb_2 = createEx( PushButton, "QUIT", win, 20, 232, 124, 28, 0, 0 ) setFont( pb_2,"Arial",14,Normal+Bold) constant pb_1 = createEx( PushButton, "generate", win, 268, 232, 124, 28, 0, 0 ) setFont( pb_1,"Arial",14,Normal+Bold) procedure pb_2_onClick (integer self, integer event, sequence params) closeApp () end procedure setHandler( pb_2, w32HClick, routine_id("pb_2_onClick")) procedure pb_1_onClick (integer self, integer event, sequence params) setFont (win, "Consolas",12,Normal) wPuts({win,15,20},"Hello to the world, yet Again!") wPuts({win,15,40},"Now that text is on screen grab Window") wPuts({win,15,55},"Top bar & Move it so part of text") wPuts({win,15,70},"Leaves the monitor (off the edge)") wPuts({win,15,85},"Now, move it back to starting position.") wPuts({win,15,120},"Notice vanishing text AND unaffected control...") end procedure setHandler( pb_1, w32HClick, routine_id("pb_1_onClick")) WinMain( win,Normal )
procedure pb_1_onClick (integer self, integer event, sequence params) setFont (win, "Consolas",12,Normal) wPuts({win,15,20},"Hello to the world, yet Again!") wPuts({win,15,40},"Now that text is on screen grab Window") wPuts({win,15,55},"Top bar & Move it so part of text") wPuts({win,15,70},"Leaves the monitor (off the edge)") wPuts({win,15,85},"Now, move it back to starting position.") wPuts({win,15,120},"Notice vanishing text AND unaffected control...") end procedure setHandler( pb_1, w32HClick, routine_id("pb_1_onClick")) --Add this (it might work) setHandler(pb_1,w32HPaint,routine_id("pb_1_onClick"))
The w32HPaint will keep drawing graphics on screen. I've also had issues with win32lib when trying to draw text using CText, or LText, the text will not show up at all or will be cut-off or look weird. Not sure if the w32HPaint will work, but its worth a shot.