Hook Unhook?

BlitzMax Forums/BlitzMax GUI Programming/Hook Unhook?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

So I have a program that creates a window with basic gadgets and all. And I use AddHook so that the main program can still have control. Kind-of like the window is a tool. So I press a key to open the window and it sets up fine, everything works great. But when I close it, and try and open it again I get an UE on a NULL OBJECT error, and its called on my event.id line for parsing through what called it. I'm assuming its a problem with removehook and then trying to add it again.

Btw the window is created and controlled through a type class in a method. Just like the tutorial.

So I would like to know, how do I destroy the type instance along with the hook so I can easily start it again clean later?