Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
YItemCollection issue in python bindings
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()
@anaselli

This comment has been minimized.

Copy link
Owner Author

commented Apr 14, 2016

To fix this issue item must be disowned the syntax is
item.this.own(False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.