ChrisS85 / CGUI

An object-oriented GUI library for AutoHotkey
22 stars 19 forks source link

class control-initiators support for instance variables #40

Closed infogulch closed 12 years ago

infogulch commented 12 years ago

This allows class initiators to use instance variables instead of being forced to use static variables.

It's also backwards-compatible with static variables as initiators.

The reason this is a problem to begin with is because __new() would be called before the actual control exists. This fixes the problem by removing the __new key from the base class, and calling it manually after going through ahk's normal x := new Class instantiating method.

infogulch commented 12 years ago

Btw, this includes commits from pull request/issue #39.

ChrisS85 commented 12 years ago

Good idea! Maybe a bit hackish, but as long as it works...

infogulch commented 12 years ago

I think all solutions to this would be hacks, this one is just from a different angle and a tiny bit less of a hack than was was there before. :P