If I close the window and reopen it the program crashes.
I think I have to free the class on closing the window, but I don't know how?
Code: Select all
Procedure SubclassGadget(gadget.i, newClassName.s)
Protected gadgetClass.i = CocoaMessage(0, GadgetID(gadget), "class")
Protected newGadgetClass.i
newGadgetClass = objc_allocateClassPair_(GadgetClass, newClassName, 0)
objc_registerClassPair_(newGadgetClass)
object_setClass_(GadgetID(gadget), newGadgetClass)
ProcedureReturn newGadgetClass
EndProcedure