I think Im less than a half dozen lines of code to achieve a few seconds or several seconds to populate but have spent about 4 hours, maybe longer looking at this without success. Tried putting the beginupdate and endupdate within the loop above, it makes no difference. replace the current state tag but keeps the other tags. changestate(item, state) source Replace the current state of the item. init(masterNone, kw) source Create a CheckboxTreeview. _(ds.Tables(0).Rows(Z).Item("HierarchyName " ).ToString).Tag = ds.Tables(0).Rows(Z).Item("Product_Category_HierarchyID " ).ToString The checkboxes are done via the image attribute of the item, so to keep the checkbox, you cannot add an image to the item. Using da As New SQLite.SQLiteDataAdapter(SQLStr, SQLDB) SQLStr = SQLStr & " ORDER BY HierarchyName " The text of a button can span more than one line. When a button is pressed, Tkinter calls the associated function or method. SQLStr = SQLStr & " WHERE Product_Category_Hierarchy_ParentID= " & _child.Tag The Tkinter Checkbutton widget can contain text, but only in a single font, or images, and a button can be associated with a Python function or method. SQLStr = SQLStr & " FROM Product_Category_Hierarchy " SQLStr = SQLStr & " Product_Category_HierarchyID" Tk (screenNameNone, baseNameNone, className’Tk’, useTk1): To create a main window, tkinter offers a method ‘Tk (screenNameNone, baseNameNone, className’Tk’, useTk1)’. Private Function FindNode(ByVal _nodeCollection As TreeNodeCollection) As TreeNodeįor Each _child As TreeNode In _nodeCollection There are two main methods used which the user needs to remember while creating the Python application with GUI. So if anyone has any ideas of being able to reduce the 50 minutes or so to populate this down to a few seconds I would be in your debt :) I have approx 130,000 items and again, yes, I need to pre-populate rather than on-the-fly, the reason being I use this function to populate a checkbox type treeview which needs to be able to save what has been selected - and I want to keep things nice and tidy by utilising the same base-populating code. The sub that calls this function, first calls a Setup sub that populates the root nodes, sets beginupdate, calls the FindNode function below then when it eventually returns, calls endupdate on the treeview. So here is my function (its the recursive part). I know the answer will probably be just that - Dictionaries or an List Of but I cannot get it to function correctly. I have looked at the FastTreeView code elsewhere on CodeProject which utilises Dictionaries/Arrays to be populated then populate the treeview - the example the chap provides is lightning fast but I cannot get it to work with what I am trying to achieve. The SQL Queries and database format are irrelevant in the overall performance (there is a small bottleneck but its livable) - its the population of the Treeview itself. Once I start getting several thousand entries to populate, it starts taking a long time to populate, even with a beginupdate and endupdate on the treeview. I have a Product-Hierarchy which pre-populates a treeview (I cannot use population on the fly due to some other features of the application - so I have to go the pre-populate route).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |