Re: David Win32lib
- Posted by "Cuny, David" <David.Cuny at DSS.CA.GOV> Jul 23, 1999
- 444 views
Bernie Ryan wrote (with minor editing): > How come the create() function in Win32Lib does not > pass all 12 parameters to CreateWindow? There are a couple of reasons: 1. Win32Lib is a simplication of the Win32 API. By definition, some information will be lost in that process. 2. Win32Lib does not attempt to wrap everything in the Win32 API. Unlike Llama, it was not built to be extensible by the user. 3. Some parameters, like the menu handle, simply don't make sense to use. 4. I'd never had the need to use some parameters, like extended style. If I had the need, I could always change the code (see below). 5. Some parameters, like the program instance handle, I never really understood that well. > If you want to implement new advanced features > in the library that use these extra parameters > then you have to go around the create function ... *shudder* No, it's actually much easier. Create a new set of class attributes - say, 'classExt' - that would hold the extended attributes for a class. Existing classes obviously have extended attributes of zero. To create a new class with extended attributes, you would write something like this: -- #40: NewClass className[ NewClass ] = <class name> classType[ NewClass ] = <class identifier> classStyle[ NewClass ] = <style flags> classExt[ NewClass ] = <extended style flags> The change to the create() code would be: -- create control window_handle[id] = c_func( xCreateWindow, { classExt[id], -- extended style buffer1, -- window class name ... NULL} ) -- creation parameters And there you have it - support for extended attributes. Pretty trivial, actually. -- David Cuny