Created
March 22, 2016 09:11
-
-
Save anaselli/2b32620a938053e184e9 to your computer and use it in GitHub Desktop.
YItemCollection issue in python bindings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yui | |
# enable logging for debug | |
log = yui.YUILog.instance() | |
log.setLogFileName("debug.log") | |
log.enableDebugLogging( True ) | |
factory = yui.YUI.widgetFactory() | |
dialog = factory.createMainDialog() | |
VBox = factory.createVBox(dialog) | |
yTableHeader = yui.YTableHeader() | |
yTableHeader.addColumn("package") | |
yTableHeader.addColumn("version") | |
yTableHeader.addColumn("release") | |
yTableHeader.addColumn("arch") | |
myTableMinSize = factory.createMinSize(VBox, 50, 12) | |
myTable = factory.createTable(myTableMinSize, yTableHeader) | |
myOK = factory.createPushButton(VBox, "OK") | |
# note YItemCollection have problems | |
# uncomment (1) to see the layout (10 elements is not so slow with addItem) | |
# and comment (2) to remove addItems | |
ic = yui.YItemCollection() | |
for pkg in range(1,10): | |
name = "name-{0}".format(pkg) | |
item = yui.YTableItem(name , "1.0", "1", "i585") | |
#myTable.addItem(item) # (1) | |
ic.push_back(item) # (2) | |
myTable.addItems(ic) #(2) | |
event1 = dialog.waitForEvent() | |
dialog.destroy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To fix this issue item must be disowned the syntax is
item.this.own(False)