Unexpected BindGadgetEvent() callback

Just starting out? Need help? Post your questions and find answers here.
Comfort
User
User
Posts: 32
Joined: Thu Jul 05, 2018 11:52 pm

Unexpected BindGadgetEvent() callback

Post by Comfort »

Is this a feature or an annoyance?

Code: Select all

Procedure Test()
  If GetGadgetText(EventGadget()) = "Binded Button"
    MessageRequester("Button Test","As it should be!")
    FreeGadget(0)
    UnbindedButton = ButtonGadget(0, 10, 10, 200, 20, "Unbinded Button")
  Else
    MessageRequester("Button Test","Not expected."+Chr(13)+Chr(13)+"UnbindGadgetEvent() needs to be called before freeing it.")
  EndIf  
EndProcedure

If OpenWindow(0, 0, 0, 222, 200, "Button Bind Check", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  BindedButton = ButtonGadget(0, 10, 10, 200, 20, "Binded Button")
  BindGadgetEvent(0, @Test())
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
PeDe
Enthusiast
Enthusiast
Posts: 305
Joined: Sun Nov 26, 2017 3:13 pm

Re: Unexpected BindGadgetEvent() callback

Post by PeDe »

The behavior has changed with PB v6.01b4, no second message box appears.
Tested with Windows 7 32-bit, PB 5.73/6.01b4
User avatar
mk-soft
Always Here
Always Here
Posts: 6327
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Unexpected BindGadgetEvent() callback

Post by mk-soft »

Fixed with PB v6.01 Beta 4. This means that UnbindGadgetEvent no longer has to be called for FreeGadget. Now cleans up PB internally automatically.
Was once reported as a bug.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Comfort
User
User
Posts: 32
Joined: Thu Jul 05, 2018 11:52 pm

Re: Unexpected BindGadgetEvent() callback

Post by Comfort »

So, not a feature then.

Thanks.
Post Reply