Page 1 of 1

Desktop events

Posted: Mon Aug 01, 2016 4:16 pm
by BinoX
I was hoping that there would be a way of capturing desktop events (so that, for example, anything that needs to be the width/height of the "desktop" can be resized without having to check it with a timer (i.e. a full width menubar on the desktop or a full height widget bar))

Re: Desktop events

Posted: Wed Aug 03, 2016 6:56 am
by Fred
You can use a window with the #PB_Window_Background flag and bind event on its resize, it should do the job.

Re: Desktop events

Posted: Thu Jun 27, 2019 7:28 pm
by juror
Fred wrote:You can use a window with the #PB_Window_Background flag and bind event on its resize, it should do the job.
How do you know when it is resized? Is there an event?

Re: Desktop events

Posted: Thu Jun 27, 2019 7:34 pm
by Peter

Code: Select all

Procedure SizeWindowEvent()
  Debug "SizeWindowEvent"
EndProcedure

Procedure SizeDesktopEvent()
  Debug "SizeDesktopEvent"
EndProcedure

OpenWindow(0, 0, 0, 0, 0, "", #PB_Window_Background)

BindEvent(#PB_Event_SizeWindow, @SizeWindowEvent(), 0)
BindEvent(#PB_Event_SizeDesktop, @SizeDesktopEvent(), 0)
(in this example PB_Event_SizeWindow seems to be the same as PB_Event_SizeDesktop)

Greetings ... Peter

Re: Desktop events

Posted: Thu Jun 27, 2019 8:00 pm
by juror
Thanks Peter, once again you come through :)