Page 1 of 1

Re: Newbe Q Giant IdNumbers

Posted: Fri Dec 24, 2010 3:30 pm
by Trond
The dynamic numbers are very big to prevent them from clashing with the static numbers.

So if you do this it will work perfectly:

Code: Select all

ButtonGadget(0, ....)
ButtonGadget(1, ....)
StringGadget(#PB_Any, ...)
StringGadget(2, ...) ; <- Notice that this does not clash with the other string gadget, because #PB_Any selected a huge number.
Be aware that you can't re-use dynamic numbers, but you can re-use static numbers:

Code: Select all

CreateImage(12, ....)
CreateImage(12, ....) ; Frees the old image #12 and creates a new one

i = CreateImage(#PB_Any, ....)
; CreateImage(i, ...) ; <- RE-USE OF DYNAMIC NUMBER NOT ALLOWED
; Do this:
FreeImage(i)
i = CreateImage(#PB_Any, ....)

Re: Newbe Q Giant IdNumbers

Posted: Fri Dec 24, 2010 6:49 pm
by IdeasVacuum
I suggest that your dynamic code also defines the Gadget IDs rather than using PB_Any.

Re: Newbe Q Giant IdNumbers

Posted: Fri Dec 24, 2010 8:28 pm
by SiggeSvahn
Thanks all! Trond had the solution. I must have tried to re-use some dynamic handle numbers. Thanks to you guys i did dare to rewrite the rather big code and it is now working. Lesson learned - don't try to create (re-create) gadgets with already used handle numbers which was created by #PB_Any.