Posted: Thu May 22, 2008 1:11 pm
Exactly. Read the part that Trond quoted from the manual.Seldon wrote:What do you mean exactly ?? If I do something like this:freak wrote:The IDs are allocated in an array, so using them sparsely is a waste of memory.Does PB create an arrary of 2000 elements although I only use one gadget ?Code: Select all
#ID_GADGET=2000 ButtonGadget(#ID_GADGET,9,9,33,33,"Button",#PB_Button_Toggle)
Thats why there is a debugger check in place to warn about very high object numbers.
> so it's recommend to use Enumeration /EndEnumeration or PB_Any i mean ?
If you know how many gadgets you create (like for the usual gui), i recommend
the Enumeration, as you do not have to keep track of the generated IDs yourself.
If you have a variable number of objects to create (for example if there can be a
variable number of withdows with the same gui), then #PB_Any is the way to go.
Using fixed numbers and using them sparsely to allow for the dynamic number is not
the best solution as noted above.
Some people also use #PB_Any exclusively simply because they find it more intuitive.
Its a matter of preference really.