Sadly nothing seems to work...
What im doing wrong ?
Code (SpiderBasic Demo 2.10):
Code: Select all
DeclareModule CHESS
Declare.i Init(Title.s)
EndDeclareModule
Module CHESS
Structure GUI_STRUCT
Window.i
WindowHandle.i
EndStructure
Structure CHESS_STRUCT
GUI.GUI_STRUCT
EndStructure
Procedure.i CallbackWindowClose()
Debug 123
CloseWindow(EventWindow())
EndProcedure
Procedure.i Init(Title.s)
Protected *Chess.CHESS_STRUCT
*Chess = AllocateMemory(SizeOf(CHESS_STRUCT))
If *Chess
*Chess\GUI\Window = OpenWindow(#PB_Any,#Null,#Null,600,460,Title,#PB_Window_SizeGadget|#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
If IsWindow(*Chess\GUI\Window)
*Chess\GUI\WindowHandle = WindowID(*Chess\GUI\Window)
WindowBounds(*Chess\GUI\Window,600,460,#PB_Ignore,#PB_Ignore);Does not work!
BindEvent(#PB_Event_CloseWindow,@CallbackWindowClose(),*Chess\GUI\Window);Callback does not get called!
;BindEvent(#PB_Event_CloseWindow,@CallbackWindowClose());Callback does not get called!
ProcedureReturn *Chess
EndIf
FreeMemory(*Chess)
EndIf
EndProcedure
EndModule
Debug CHESS::Init("Test Window 1")
Debug CHESS::Init("Test Window 2");2nd Window wont open!