kcvinker/Nimforms

why not auto run object.createHandle()?

Closed this issue · 1 comments

In the sample program, I found that someobj.createHandle() needs to be executed every time a new control is created. Why didn't these codes be automatically executed? Is there any particular reason?

Yeah, the createHandle function is repeating so many times if you use many different controls. It is in that function that the CreateWindowEX function is executed. So that function is important. But if you want to avoid its repeated calls, there is a hack. When doing so the controls will be created with default values. I am adding a boolean parameter in the constructors of all controls. Then users can create controls with default values if they don't want to use the createHandle function.