PB 5.60b1

Just starting out? Need help? Post your questions and find answers here.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

PB 5.60b1

Post by DoubleDutch »

The UseGadgetList command doesn't work as it used to, gadgets created in it no longer generate events...

Code: Select all

 If OpenWindow(0, 0, 0, 500, 500, "Main Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ButtonGadget(0, 10, 10, 150, 25, "Button 1")    
    ; Create Window with #PB_Window_NoGadgets to prevent automatic GadgetList creation
    If OpenWindow(1, 0, 0, 300, 200, "Child Window", #PB_Window_TitleBar | #PB_Window_WindowCentered | #PB_Window_NoGadgets, WindowID(0))     
      OldGadgetList = UseGadgetList(WindowID(1)) ; Create GadgetList and store old GadgetList
      ButtonGadget(10, 10, 10, 150, 25, "Child Window Button")      
      UseGadgetList(OldGadgetList)               ; Return to previous GadgetList
    EndIf    
    ButtonGadget(1, 10, 45, 150, 25, "Button 2") ; This will be on the main window again
    Repeat    
    	event=WaitWindowEvent()
    	If event=#PB_Event_Gadget
    		gadget=EventGadget()
    		Debug(gadget)
    	EndIf
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
In this example you will see that the button with id '10' will not create an event.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Fred
Administrator
Administrator
Posts: 18397
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.60b1

Post by Fred »

You need to use UseGadgetList(WindowID(0, #PB_Window_GadgetList)) from now on, because we added new gadget container (they are not directly added to the window)
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.60b1

Post by DoubleDutch »

Ahh - Thanks for the help, everything else seems great so far. :)

(The example will need to be updated in the help system)

WindowID = WindowID(#Window) also doesn't mention this extra parameter yet.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
JHPJHP
Addict
Addict
Posts: 2279
Joined: Sat Oct 09, 2010 3:47 am

Re: PB 5.60b1

Post by JHPJHP »

Hi Fred,
Fred wrote:You need to use UseGadgetList(WindowID(0, #PB_Window_GadgetList)) from now on, because we added new gadget container (they are not directly added to the window)
I'm getting Constant not found: #PB_Window_GadgetList with the new PureBasic 5.60 Beta 2 build.

Thank you.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.60b1

Post by DoubleDutch »

yes, it's reverted back. Take it out and things will work as they did before.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
JHPJHP
Addict
Addict
Posts: 2279
Joined: Sat Oct 09, 2010 3:47 am

Re: PB 5.60b1

Post by JHPJHP »

Hi DoubleDutch,

Thank you for the response.

Did you read somewhere that this was permanent? I did a cursory search, but didn't find anything; otherwise I'll wait for the next release for it to be corrected.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Fred
Administrator
Administrator
Posts: 18397
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.60b1

Post by Fred »

It is permanent, sorry for the trouble.
Post Reply