Page 1 of 1

gadget ID numbers

Posted: Tue Jun 03, 2003 6:17 am
by waffle
after trying everything to isolate a bug, i found out that i was using the same GadgetID number in two seperate windows. For some reason when i access the second window and then exit back to the main window, PB forgets that the gadget with the same ID exists in the first window and would no longer update it. It was a listicongadget while the second window was a text gadget. I thought each gadgetlist was unique to each window and did not think to worry much about each GadgetID.

just though I would help warn others about this potential problem with using the Visual Designer for generating constants for the gadgets.

Is this a bug or just a poorly executed great idea :?
I guess this goes back to my suggestion for manually setting constants in the visual editor.

or maybe a compiler warning about gadgets of the same ID :idea:

Re: gadget ID numbers

Posted: Tue Jun 03, 2003 12:36 pm
by tinman
waffle wrote:second window was a text gadget. I thought each gadgetlist was unique to each window and did not think to worry much about each GadgetID.
I think the manual states that each gadget ID must be unique across all gadgets. And if it doesn't it should (something that I also got caught with before).

Posted: Tue Jun 03, 2003 4:28 pm
by waffle
so this one was my fault as i expected.....
but the visual design tool automatically assigned the ID numbers.
Lots of things could be done to prevent this...

1 - compiler warning for duplicate gadget ID
2 - compiler warning for reassign constant values
3 - Permit user assigned constants in the visual designer
so I could pick a starting number like 1000 for the first window,
2000 for the next and so on. Each gadget ID would then enumerate
starting with the Window ID +1

but hey, can't expect perfection on the first draft of any idea,
including my own projects :D

Posted: Tue Jun 03, 2003 5:07 pm
by freak
1 - bad idea! It is a good feature. You can give all gadgets you never need
to change the same id (like textgadgets for example)

2 - also not a good idea (IMHO) This is good for creating enumerations of constants

Code: Select all

#Index = 1
#Const1 = #Index: #Index = #Index + 1
#Const2 = #Index: #Index = #Index + 1
#Const3 = #Index: #Index = #Index + 1
#Const4 = #Index: #Index = #Index + 1
#Const5 = #Index
3 - would be a good idea, but i recommend not stzarting at number 1000
for the first window, as PB reserves memory for items 0-999 as well.

btw: the Visual Designer supports multiple windows, so just create both your windows in one project, and you should not have a conatant problem
any more.

Timo

Re: gadget ID numbers

Posted: Tue Jun 10, 2003 8:29 pm
by Berikco
waffle wrote:just though I would help warn others about this potential problem with using the Visual Designer for generating constants for the gadgets.
Fixed in today's release
A user in German forum gave me an exact discription of this problem.

http://users.pandora.be/berikco/download/vd.zip