My 2 cents.

SW_* constants are not defined in GUI_constants.cpp (nor exported in GUI.pm). In general there are many constants missing.

Constant handling is, and will be a pain to get right. Personally, I don't like the way Win32::GUI exports all it's constants by default - it's a huge waste of memory. I create separate packages for each window, and I used to have "use Win32::GUI" at the top of each package to get access to the constants. From memory, this added around 100K per package where Win32::GUI was used. When using constants I now use the full name, i.e., Win32::GUI::WS_CLIPCHILDREN.

Using autoload to bring in the constants dynamically, is an alternative solution but all the constant strings will have to be in the dll - and if we're talking about adding *all* the constants, the dll could become quite large...

I'm not sure what the best solution is. Personally, I would prefer if no more constants where exported as a default (unless they are commonly used), but adding them to GUI_constants.cpp is fine by me.

I also like the idea of generating GUI_constants.cpp automatically from (say) a flat file of constants - it would certainly make adding constants easier! Even if we end up having thousands of autoloaded constants, I don't think we would need to change the current algorithm (even though it's far from optimal) as autoloader only needs to do the look up once for each constant used.

Cheers,

jez.



Reply via email to