Re: [gDesklets] accessing array element at run time



On 03/25/2013 06:28 PM, jkjunk lavabit com wrote:
Hi,

I am new to python and I am using gdesklets as a teaching tool. I have an
array of labels and I need to access one of them. I see that there is an
index-path. I have tried accessing it via element.index-path but no luck.
How do I get the specific element in the array at run time. Thanks.

Hi,

Let's say you have an array like this:

<array id="my_array" length="5">
  <label id="my_label"/>
</array>

You can access the labels in Python script by doing something like:

Dsp.my_label[0].value = "Hello world"

--
Joe


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]