Page 1 of 1

Hopefully simple addition to AddGadgetItem()

Posted: Fri Oct 29, 2004 1:56 pm
by Lars
Working with the -1 position parameter of AddGadgetElement(), i realised
that it would be very cool, if AddGadgetElement() would simply return the
final position of the new element. I don't know how PB works internally,
but imho this shouldn't be much work to do, but it would be a great
improvement of comfort :)

For example, if you want to add an element to a listicongadget and want
to do something with this new added item later on. At the moment you
have to keep track of the positions on you own, which is not very cool.

Thanks,

Lars

Posted: Fri Oct 29, 2004 10:47 pm
by freak
If using -1 as position parameter, the new item will be at the position "CountGadgetItems()-1". Where's the problem?

Posted: Sat Oct 30, 2004 9:54 pm
by Lars
Errrrm, it's a shame, but i didn't realise this possibility yet :oops:

Whatever, it would be kind of usefull though, but it's not really important.

Posted: Sat Oct 30, 2004 10:37 pm
by Shannara
Well right now, if an item is added to a gadget, like a treeview or a listicon/view, that is sorted, the position number is automatically changed when a new item is added.

In order to get the position number of an item, you would need to cycle through all of the nodes/items to find which one is your item and grab the position number. Quite time consuming this way.. Is there another way?

This initially sounded like a great idea, but when the position changes the number initially aquired is outdated.

Posted: Tue Jan 17, 2006 6:55 am
by Shannara
Bump as a request for after PB 4.0 version.