Is it a system constraint or a bug.
On Windows or Linux, the event is not blocked.
Example
Code: Select all
;-TOP
Enumeration ;Window
#Main
EndEnumeration
Enumeration ; Menu
#Menu
EndEnumeration
Enumeration ; MenuItems
#MenuExit
EndEnumeration
Enumeration ; Gadgets
#List
EndEnumeration
Enumeration ; Statusbar
#Status
EndEnumeration
Enumeration ; Timer
#Timer
EndEnumeration
; Global Variable
Global exit
; ***************************************************************************************
; Functions
Procedure UpdateWindow()
Protected x, y, dx, dy, menu, status
menu = MenuHeight()
If IsStatusBar(#Status)
status = StatusBarHeight(#Status)
Else
status = 0
EndIf
x = 0
y = 0
dx = WindowWidth(#Main)
dy = WindowHeight(#Main) - menu - status
ResizeGadget(#List, x, y, dx, dy)
EndProcedure
; ***************************************************************************************
Procedure Logs(Text.s)
Protected sTemp.s, c
sTemp = FormatDate("%YYYY/%MM/%DD %HH.%II.%SS;", Date())
sTemp + Text
AddGadgetItem(#List, -1, sTemp)
c = CountGadgetItems(#List)
If c > 1000
RemoveGadgetItem(#List, 0)
c - 1
EndIf
c - 1
SetGadgetState(#List, c)
SetGadgetState(#List, -1)
EndProcedure
; ***************************************************************************************
Procedure EventTimerHandler()
Static c
c + 1
Logs("Conter " + Str(c))
EndProcedure
; ***************************************************************************************
Procedure Main()
Protected event, style, dx, dy
style = #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget
dx = 800
dy = 600
If OpenWindow(#Main, #PB_Ignore, #PB_Ignore, dx, dy, "Main", style)
; Menu
CreateMenu(#Menu, WindowID(#Main))
MenuTitle("&File")
MenuItem(#MenuExit, "Ex&it")
; Gadgets
ListViewGadget(#List, 0, 0, dx, dy)
; Statusbar
CreateStatusBar(#Status, WindowID(#Main))
AddStatusBarField(#PB_Ignore)
; For Mac
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
; Enable Fullscreen
Protected NewCollectionBehaviour
NewCollectionBehaviour = CocoaMessage(0, WindowID(#Main), "collectionBehavior") | $80
CocoaMessage(0, WindowID(#Main), "setCollectionBehavior:", NewCollectionBehaviour)
; Mac default menu´s
If Not IsMenu(#Menu)
CreateMenu(#Menu, WindowID(#Main))
EndIf
MenuItem(#PB_Menu_About, "")
MenuItem(#PB_Menu_Preferences, "")
CompilerEndIf
UpdateWindow()
AddWindowTimer(#Main, #Timer, 1000)
BindEvent(#PB_Event_SizeWindow, @UpdateWindow())
BindEvent(#PB_Event_Timer, @EventTimerHandler())
; Main Loop
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_Menu
Select EventMenu()
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
Case #PB_Menu_About
MessageRequester("Info", "Testing of Modul Logging")
Case #PB_Menu_Preferences
Case #PB_Menu_Quit
exit = #True
CompilerEndIf
Case #MenuExit
exit = #True
EndSelect
Case #PB_Event_CloseWindow
Select EventWindow()
Case #Main
exit = #True
EndSelect
EndSelect
Until exit
EndIf
EndProcedure : Main()
End