It looks like you’ve set the Text property to be foo/bar/baz, but not Name (which it seems is what this keys off of):

 

import winforms

import System.Windows.Forms as WF

tc = WF.TabControl()

tp = WF.TabPage('test')

tp.Name = 'test'

tc.TabPages.Add(tp)

tp = WF.TabPage('foo')

tp.Name = 'foo'

tc.TabPages.Add(tp)

tp = WF.TabPage('bar')

tp.Name = 'bar'

tc.TabPages.Add(tp)

tc.TabPages['foo']

 

prints:

 

TabPage: {foo}

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jeff sacksteder
Sent: Monday, June 26, 2006 4:47 PM
To: [email protected]
Subject: [IronPython] TabPages - misunderstanding or bug?

 

The TabPages attribute of the TabControl class contains a collection of TabPage objects. I was under the impression that individual tabs would be accessable by index or key.  That is apparently not the case.
Is this a bug or a misunderstanding on my part?

>>> for p in tab_book.TabPages:
...     print p
...
TabPage: {foo}
TabPage: {bar}
TabPage: {baz}
>>> print tab_book.TabPages[1]
TabPage: {bar}
>>> print book.TabPages ['bar']
None

_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to