Desktop events

Just starting out? Need help? Post your questions and find answers here.
BinoX
Posts: 7
Joined: Mon Aug 01, 2016 4:13 pm

Desktop events

Post 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))
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: Desktop events

Post by Fred »

You can use a window with the #PB_Window_Background flag and bind event on its resize, it should do the job.
juror
Posts: 12
Joined: Fri Aug 01, 2014 4:39 am

Re: Desktop events

Post 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?
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Desktop events

Post 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
juror
Posts: 12
Joined: Fri Aug 01, 2014 4:39 am

Re: Desktop events

Post by juror »

Thanks Peter, once again you come through :)
Post Reply