ResizeWindow() fires a #PB_Event_SizeWindow

Linux specific forum
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

ResizeWindow() fires a #PB_Event_SizeWindow

Post by uwekel »

Hi,

i you resize a window programmatically with ResizeWindow(), a #PB_Event_SizeWindow will be fired. This happen on Linux but not on Windows. PB never does fire events on programmical changes.

Here is some code to test:

Code: Select all

Procedure Resized()
  Debug "Resized"
EndProcedure
  
OpenWindow(0, 0, 0, 300, 300, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
ButtonGadget(0, 10, 10, 100, 32, "Resize")
BindEvent(#PB_Event_SizeWindow, @Resized(), 0)

Repeat
  Select WaitWindowEvent()
  Case #PB_Event_SizeWindow
    Debug "SizeWindowEvent"
  Case #PB_Event_Gadget
    ResizeWindow(0, #PB_Ignore, #PB_Ignore, 400, 400)
  Case #PB_Event_CloseWindow
    Break
  EndSelect
ForEver
Best regards
Uwe
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB5.30 x86:ResizeWindow() fires a #PB_Event_SizeWindow

Post by Fred »

The problem is on Linux the events are send after resizing the window, by the Window Manager so we get no clue if it's a programmic event of a user event.
Post Reply