Getting the active window when resizing [PB5.20]
Posted: Thu Sep 26, 2013 4:46 am
This code works as expected under Windows.
The active window is the same for 'normal' events and resizing.
Under Linux (Kubuntu 12.04), the active window during resizing is -1
The other events return '0' which is correct.
Is this a normal Linux thing and is there a solution?
Jim
The active window is the same for 'normal' events and resizing.
Under Linux (Kubuntu 12.04), the active window during resizing is -1
The other events return '0' which is correct.
Code: Select all
If OpenWindow(0, 0, 0, 230, 190, "Event handling example...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered |#PB_Window_SizeGadget)
ButtonGadget (1, 10, 10, 200, 20, "Click me")
CheckBoxGadget(2, 10, 40, 200, 20, "Check me")
If CreateMenu(0, WindowID(0))
MenuTitle("Menu")
MenuItem(1, "Item 1")
MenuItem(2, "Item 2")
MenuItem(3, "Item 3")
EndIf
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_SizeWindow
Debug "Window resized, Window: "+GetActiveWindow()
Case #PB_Event_Gadget
Select EventGadget()
Case 1 : Debug "Button 1 clicked!, Window: "+GetActiveWindow()
Case 2 : Debug "Button 2 clicked!, Window: "+GetActiveWindow()
EndSelect
Case #PB_Event_Menu
Select EventMenu()
Case 1 : Debug "Menu item 1 clicked!, Window: "+GetActiveWindow()
Case 2 : Debug "Menu item 2 clicked!, Window: "+GetActiveWindow()
Case 3 : Debug "Menu item 3 clicked!, Window: "+GetActiveWindow()
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIfJim