[Done] PB 5.20 - BindEvent() doesn't work with #PB_All

Just starting out? Need help? Post your questions and find answers here.
User avatar
STARGÅTE
Addict
Addict
Posts: 2315
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

[Done] PB 5.20 - BindEvent() doesn't work with #PB_All

Post by STARGÅTE »

BindEvent() doesn't work if I use #PB_All for Window instead of the real Window-Number.

Code: Select all

Enumeration
	#Window
	#Gadget
EndEnumeration


Procedure Test()
	Debug "Test"
EndProcedure

BindEvent(#PB_Event_Gadget, @Test(), #PB_All, #Gadget)
;BindEvent(#PB_Event_Gadget, @Test(), #Window, #Gadget)

OpenWindow(#Window, 0, 0, 800, 600, "WindowTitle", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
CanvasGadget(#Gadget, 20, 20, 200, 200)

Repeat
	
	Select WaitWindowEvent()
			
		Case #PB_Event_CloseWindow
			End
			
	EndSelect
	
ForEver
I know the function BindGadgetEvent(), but I need BindEvent() in combination with PostEvent()
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PB 5.20 - BindEvent() doesn't work with #PB_All

Post by eddy »

confirmed - PB5.2b8 win x64
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.20 - BindEvent() doesn't work with #PB_All

Post by Fred »

For now, it can't be used like that, if you specify #PB_All in one field, all the following fields needs to be #PB_All as well.
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.20 - BindEvent() doesn't work with #PB_All

Post by Fred »

Doc has been updated, and a runtime debugger check added to catch such errors.
Post Reply