![]() ![]() Here's the definition of the parent display control - using a Tkinter Treeview with added scoll bars and an action binding for when a row is selected. ![]() I won't cover the SQLite parts, so I'm assuming the simple SQL SELECT statements are familiar - but do ask if you'd like those explained. I'll let the README at the respository speak for itself, but will here discuss some of the vital parts. As you will have to release your click eventually :P my code looks like something below: from tkinter import from tkinter import ttk TreeView.bind ('', function1) If you want bind function1 on double click TreeView.bind ('', myfunction2) If you want bind function2 on single click (on release click) Share.But then I decided it was unfair of me to moan about examples having unnecessary things in them - unless I tried doing that myself. ![]() I first made my own rebuild as a way to test what I'd gleaned - using my usual stock interfacing (that's elsewhere in my GitLab presence). this make desordre in the treeview, the first new string on a column, and the new second string on the next column of the treeview which is reserved for. When i print datas from a MySQL table on a Tkinter treeview, if the data which is a string contains space, it divide the string into two strings. I also felt a chance was missed to enact a parent-child behaviour between the two tables. Tkinter treeview string with space issue. My many thanks to them for sharing that, but I wasn't pleased with the amount of code I had to wade through just to find the parts that made and loaded the records and then responded to which was clicked. It came about after I recently watched a YouTube video by Data Analytics Ireland. In short: you can find the code at this online Git repository where there's really just the one Python file. The idea here is to show a minimal-imports method of displaying parent-child records using the stock Tkinter and SQLite Python libraries. I've made an example Python program that does nothing more than load two tables into a form and then lets you filter the "child" records by selecting rows in the "parent" table. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |