May be this helps to get me an answer.
The following code shows a different behaviour under Windows and Linux.
Linux: After hitting the button "Delete menu entry" the Debugger outputs
Menu 0 is valid!
Menu 0 is deleted!
and below the code section in the error log
GTK(CRITICAL):IA_gtk_widget_destroy:assertion 'GTK_IS_WIDGET(widget)' failed
Windows: The output after hitting the button "Delete menu entry"
Menu 0 is invalid! > This is what I expected also under Linux
Code: Select all
If OpenWindow(0, 200, 200, 200, 100, "Menu Example")
ButtonGadget(0, 20, 30, 160, 25, "Delete menu entry")
OpenWindow(1, 300, 300, 200, 100, "Menu Example 2")
If CreateMenu(0, WindowID(0))
MenuTitle("Project")
MenuItem(1, "Test")
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0 And EventType() = #PB_EventType_LeftClick
CloseWindow(0)
If IsMenu(0)
Debug "Menu 0 is valid!"
FreeMenu(0)
Debug "Menu 0 is deleted!"
Else
Debug "Menu 0 is invalid!"
EndIf
EndIf
EndSelect
ForEver
EndIf
A different behaviour of the exact same code like this makes it difficult for cross platform development.
Therefore I would like to know, if there is a reason behind it.
PB 5.21, Windows 7 x64, openSUSE 13.1 x64
Thanks
gerd