|
From: william G. <gun...@gm...> - 2010-03-10 23:25:05
|
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)
Thank you
William Gunnells
* gun...@gm...
* co...@qi...
|
|
From: william G. <gun...@gm...> - 2010-03-12 02:44:52
|
I tried with append and got the following error: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 13535, in <lambda> lambda event: event.callable(*event.args, **event.kw) ) File "horsewx.py", line 16, in on_initialize self.components.List1.append(i) File "/usr/lib/pymodules/python2.5/PythonCard/components/list.py", line 100, in append self.Append(aString) File "/usr/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 11156, in Append return _core_.ItemContainer_Append(*args, **kwargs) TypeError: String or Unicode type required ************************************************************************* oh and this does not work either: self.components.List1.items = l Thank you William Gunnells 450 W. 7th Street Suite # 303 Tulsa, OK 74119 * 918-830-7300 * cell 918-615-2397 * gun...@gm... * co...@qi... |
|
From: Thomas L. <tho...@go...> - 2010-03-16 13:33:34
|
william Gunnells <gunnells <at> gmail.com> writes: > > oh and this does not work either: self.components.List1.items = l > For me self.components.items = ['a', 'b', 'c'] worked fine. For integers i would suggest self.components.items = [str(i) for i in a] with a = [1,2,3] # or some other in array |
|
From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2010-03-11 15:44:22
|
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. -- XXXXXXXXXXX |
|
From: Brian D. <deb...@ho...> - 2010-03-11 15:51:03
|
Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from <deb...@ho...>) id 1Npkf9-0006Qb-GK for pyt...@li...; Thu, 11 Mar 2010 15:51:03 +0000 Received-SPF: pass (sfi-mx-1.v28.ch3.sourceforge.com: domain of hotmail.com designates 65.55.90.141 as permitted sender) client-ip=65.55.90.141; env...@ho...; helo=snt0-omc3-s2.snt0.hotmail.com; Received: from snt0-omc3-s2.snt0.hotmail.com ([65.55.90.141]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Npkf8-0004iz-CB for pyt...@li...; Thu, 11 Mar 2010 15:51:03 +0000 Received: from SNT114-W65 ([65.55.90.135]) by snt0-omc3-s2.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 11 Mar 2010 07:50:56 -0800 Message-ID: <SNT...@ph...> Content-Type: multipart/alternative; boundary="_5fe43b91-a27f-4276-b5fa-4e5bba119328_" X-Originating-IP: [200.124.230.68] From: Brian Debuire <deb...@ho...> To: python users <pyt...@li...> Date: Thu, 11 Mar 2010 15:50:56 +0000 Importance: Normal In-Reply-To: <4B9...@su...> References: <13f...@ma...>, <4B9...@su...> MIME-Version: 1.0 X-OriginalArrivalTime: 11 Mar 2010 15:50:56.0886 (UTC) FILETIME=[A37CA160:01CAC132] X-Sender-Verify: failed, postmaster X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.5 VA_SENDER_VERIFY_POSTMASTER Unable to Verify pos...@do... -0.0 SPF_PASS SPF: sender matches SPF record 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1Npkf8-0004iz-CB Subject: Re: [Pythoncard-users] list box X-BeenThere: pyt...@li... X-Mailman-Version: 2.1.9 Precedence: list List-Id: <pythoncard-users.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/pythoncard-users>, <mailto:pyt...@li...?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=pythoncard-users> List-Post: <mailto:pyt...@li...> List-Help: <mailto:pyt...@li...?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/pythoncard-users>, <mailto:pyt...@li...?subject=subscribe> X-List-Received-Date: Thu, 11 Mar 2010 15:51:03 -0000 |
|
From: william G. <gun...@gm...> - 2010-03-12 10:12:32
|
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
* gun...@gm...
* co...@qi...
On Thu, Mar 11, 2010 at 3:10 PM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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.
>
> --
> XXXXXXXXXXX
>
>
|