[Implemented] CreateGadgetList() suggestion

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

[Implemented] CreateGadgetList() suggestion

Post by netmaestro »

Note: There is no separate administration of the gadget lists for every opened window in PureBasic. Therefore you should use ongoingly numbered 'GadgetID's also for several windows. Or use the new #PB_Any constant as 'GadgetID'.
When I read this I wondered if it would be possible for the compiler to just look at the first already-open window ID and use that in the CreateGadgetList() command, rather than having the programmer supply it. Since it is the same list across all windows, it's a bit confusing to pass it a specific window ID. Plus it's more (unnecessary?) typing. Gadgets would automatically be assigned to the last opened window unless a UseGadgetList() was issued, just like happens now.

Plus, if you did that, you could rename the command to InitGadgets() for conformity with InitSound(), InitSprite(), etc. What do you think?
BERESHEIT