SymbiSoft / appuifw2

Automatically exported from code.google.com/p/appuifw2
Apache License 2.0
0 stars 0 forks source link

Listbox2 constructor throws if nonempty item list given #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce:

appuifw2.Listbox2(items = ['a'])

throws, because self.__ui_insert(-1, item) is called
before self.__update_level instance variable gets created!

Original issue reported on code.google.com by antti%re...@gtempaccount.com on 12 Nov 2008 at 10:17

GoogleCodeExporter commented 8 years ago
ahem... should have been appuifw.Listbox2(items = [ appuifw2.Item(a) ])

The bug nevertheless exists.

Original comment by antti%re...@gtempaccount.com on 12 Nov 2008 at 10:19

GoogleCodeExporter commented 8 years ago
to fix this, the code should have been:

        self.__update_level = 0
        self.__update_mode = 0

        self.begin_update()
        for item in self:
            self.__item_check(item)
            self.__ui_insert(-1, item)
            item.add_observer(self)
        self.end_update()

Original comment by antti%re...@gtempaccount.com on 12 Nov 2008 at 10:22