Win32Lib - What to do?
- Posted by David Cuny <dcuny at DSS.CA.GOV> Feb 23, 1998
- 956 views
[Jacques' Font Code in Win32Lib] I've gone through Jacques' code and made the appropriate corrections to Win32Lib (mainly some stoopid stuff on my part). I hope to be posting an update to Win32Lib in a couple of days. I've got a couple of questions, so I figured I'd toss them out and get some opinions: [Persistent Graphics] Graphics in DOS are persistant. That is, once you write text or display graphics on the screen, you can count on them remaining until you clear the screen. This is not the case in Windows. If another window temporarily obscures your window, and then moves away, it is the responsibility of *your application* to recreate the content in the area that was covered. Windows will only manage the redraw of the elements of the window, such as buttons and such. Visual Basic gets around this by allocating a bitmap the size of the window, and using this to refresh the window when the image is obscured. But there is another wrinkle - resizing a window. In this case, even Visual Basic requires that you recreate the window. So my question is: how should Win32Lib handle refreshing the window? My current scheme *seems* to work fairly well for text. It accumulates a queue of all display events in the form: { x, y, text, font_data } When a refresh request comes along, it clears the window and regenerates it by walking through the queue. If you are continually updating a string on the screen, I've added a function that removes the old string from the queue: wRemoveText( x, y ) I planned on a similar scheme with graphics: graphic events are saved in a queue, and the window can be recreated with that information. I was thinking of adding a function: wClearGraphics( x1, y1, x2, y2 ) that would remove all graphics on the window (and in the queue) within the given bounding box. For effiency, I may also add a window-sized bitmap in the style of Visual Basic, so the graphics only need to be recreated on a resize. Comments? Is there a better way of doing this? [Mac GUI in DOS?] I've got the bits and pieces for a monochrome Mac "classic" interface coded - drop down menus, fonts, icons, etc. (I've got a real soft spot for the Mac). I was considering creating a Mac32Lib that would be able to run Win32Lib programs with little modification, but in DOS with a Mac interface, for those few who might want to create non-Win32 apps. Would there be any interest in this, or should I not waste my time with this? Thanks. -- David Cuny