Tkinter - Treeview Edit Cells Directly

preview_player
Показать описание
I'll show you how to edit individual cells in the Treeview widget.

You will be able to double-click a cell and edit the value directly.

This involves placing an entry widget over top of a Treeview cell at the right time, which then allows the user to edit the text.

The treeview widget provides the methods we need to make this happen.

A reference site which lists some of the methods we will be using in the Treeview widget:

0:00 Intro
0:57 Demo app
1:18 Starter code
2:00 Create a treeview class
4:35 Create columns
5:19 Add text to heading
6:42 Insert rows
9:28 Bind to double-click
12:03 Identify region double-clicked
16:43 Identify which item was double-clicked
20:16 Difference between text and values
21:57 Get selected text or values
23:50 Get cell text
27:04 Get cell bounding box
30:43 Create entry widget
35:02 Demo app with entry widget
35:38 Entry focus out binding
37:49 Update treeview data
44:21 Final demo app
45:16 Closure

#tkinter #treeview #pythongui #python3
Рекомендации по теме
Комментарии
Автор

still the best tk tutorial that actually teaches instead of just showing

Googletrash
Автор

Best Tkinter channel I have found! Someone who actually explains real world intermediate/advanced scenarios instead of just "How to create a main window and place a button".

kristosy
Автор

excellent tutorial, straight to the point and addresses all needed. many thanks for sharing

mohammedabd-allah
Автор

Superb Tutorial, fabulous teacher. One of the most lucid demonstrations of TreeView.

prwbluz
Автор

Great tutorial. You are a very good teacher. Thank you.

vpo
Автор

Exactly what I needed, very well explained and easy to follow. If I can add a tip, the header height is determined by the first header column that tkinter creates. If you want to make the header taller you can add new line symbols to the beginning and end of the first column text like "\n Vehicle Type \n". This would give you a three line header for all columns. Thanks again for this, I will be checking out your other videos as well.

curtisu
Автор

Hi Jobin, and thank you for the nice tutorial. This was exactly what I needed. As I am french, I particularly appreciated the quality of the sound track and your crystal clear speech. About the topic, I would not have expected to have to dig in such details. I was hoping to find an editing feature out of the box in treeview. So, thank you again, Pierre.

pierreedelbruck
Автор

this was good, love to see a simple csv file opened and updated by this method

RaymondAlman
Автор

Great tutorial :) Only suggestion I have is to include the code from the video as a downloadable file to make adapting it for use in other projects easier. Thank you :D

bolt
Автор

Excellent Tutorial, the most advanced and Informative video I have seen. I personally learn best be example and this video taught me a lot and explained a lot of things I had questions about. Thank you for your effort. Hopefully there will be a follow up video to get into more details on developing an application. Thank You!

jbt
Автор

among most of the tutorials which scratch just surface.. i found this one very helpful and explains core aspects to deal with updating excel sheet abstractly. Sir ( auther) why don't we make a python module which can help us update excel sheet upend a row without worrying about excel sheet content ( i mean number of columns and number of rows)?. I wish to join hands.

harishvk
Автор

Really excellent tutorial that I haven't seen like it before. Thanks. Thanks again

ahmedsaliem
Автор

I've finished the tutorial, and it works perfectly! Thank you for your generosity!

ahmedragala
Автор

My word you are a genuine genius this was VERY impressive indeed! Thank you for sharing

bithepower
Автор

This was so helpful. Your tkinter videos are unrivalled on the internet. Thank you so much

lukepemberton
Автор

Thank you very much .. this is a genius solution to a problem that had me stumped for a while .. thank you
a quick update : if the tree is in a frame, the bbox return wrong co-ordinates and this whole arrangement just don't work .. the tree must be a child of the main window or it wont work .. can you look into it ? thanks again

ahmadhasan
Автор

Dall' italia sei un mito continua cosi, grazie 😀molte sto imparando molto (From Italy you are a legend, keep it up, thank you very much, I'm learning a lot)

antoniobuonomo
Автор

I ve been searching this for a week. you are my savior. Thank you very much SIR!

제주요망둥이
Автор

This is exactly what I need! Thank you for to this great video. It would be very helpful if you made the code available, its hard to type with the video

larrymarek
Автор

What an amazing tutorial.. Thank-you so much, I am looking forward to more of your videos..

kevinrauer