Re: list box

william Gunnells <[email protected]> Fri, 12 Mar 2010 10:12:26 +0000
Newsgroups gmane.comp.python.pythoncard
Message-ID <[email protected]>
def on_initialize(self, event):
                l=['1','2','3']
                self.components.List1.clear()
                for i in l:
                        print i
                        #self.components.List1.clear()
                        self.components.List1.append(i)

I figured it out:

if its just going to console: l=[1,2,3] works fine
but to append to the list component it: l=['1','2','3']

But thanks for the quick response anyways.



Thank you

William Gunnells

* 918-830-7300
* cell 918-615-2397
* [email protected]
* [email protected]



On Thu, Mar 11, 2010 at 3:10 PM, Neil Hughes <[email protected]> wrote:
>
>
> On 10/3/10 23:24, william Gunnells wrote:
>>
>> I know I'm butchering thel list component. Could someone provide an exmple
>> as you can see below I can print the list but not add it to List1
>> =name type=List
>> I though I understood: but evidently not.
>>
>>  def on_initialize(self, event):
>>                l=[1,2,3]
>>                for i in l:
>>                        print i
>>                        self.components.List1.InsertItem(i)
>>                self.update()
>>                #self.components.List1.stringSelection(i)
>>
>
> You should be able to use append(i) instead of InsertItem(i) to add items to
> the list control.
>
> --
> Neil Hughes
>
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev