Gadget setup question

Just starting out? Need help? Post your questions and find answers here.
PhilR1
New User
New User
Posts: 4
Joined: Mon Apr 15, 2013 4:31 pm

Gadget setup question

Post by PhilR1 »

Why does this work . ..

If OpenWindow(0, 0, 0, 270, 160, "TextGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(0, 10, 10, 250, 20, "TextGadget Standard (Left)")
TextGadget(1, 10, 70, 250, 20, "TextGadget Center", #PB_Text_Center)
TextGadget(2, 10, 40, 250, 20, "TextGadget Right", #PB_Text_Right)
TextGadget(3, 10, 100, 250, 20, "TextGadget Border", #PB_Text_Border)
TextGadget(4, 10, 130, 250, 20, "TextGadget Center + Border", #PB_Text_Center | #PB_Text_Border)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Delay (5000)
EndIf

And this only shows a blank window (for 5 seconds) . . ..

If OpenWindow(0, 0, 0, 270, 160, "TextGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
TextGadget(0, 10, 10, 250, 20, "TextGadget Standard (Left)")
TextGadget(1, 10, 70, 250, 20, "TextGadget Center", #PB_Text_Center)
TextGadget(2, 10, 40, 250, 20, "TextGadget Right", #PB_Text_Right)
TextGadget(3, 10, 100, 250, 20, "TextGadget Border", #PB_Text_Border)
TextGadget(4, 10, 130, 250, 20, "TextGadget Center + Border", #PB_Text_Center | #PB_Text_Border)
;Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Delay (5000)
EndIf

I don't see any references to checking for window events being required to display a textgadget.

Thanks.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Gadget setup question

Post by ts-soft »

Checking Events is required for all gadgets and windows, allways on all OS.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
rrpl
Enthusiast
Enthusiast
Posts: 121
Joined: Fri Apr 18, 2008 7:22 am
Location: Australia

Re: Gadget setup question

Post by rrpl »

On mine it displays the window with text gadgets for 5 seconds then ends as expected [Purebasic version 5.11 on WindowsXP(SP3)].
"What you are is what you have been. What you’ll be is what you do now.” -Buddha
Post Reply