8000 Updated function · ccaj007/complete-python-course@c9171cc · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit c9171cc

Browse files
authored
Updated function
Updated function to make it match the one in the video.
1 parent 0e345ab commit c9171cc

File tree

  • course_contents/19_gui_development_tkinter/lectures/15_closing_individual_tabs

1 file changed

+3
-2
lines changed

course_contents/19_gui_development_tkinter/lectures/15_closing_individual_tabs/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def close_current_tab():
3434

3535

3636
def current_tab_unsaved():
37-
current_tab_name = notebook.tab("current")["text"]
38-
return current_tab_name[-1] == "*"
37+
text_widget = get_text_widget()
38+
content = text_widget.get("1.0", "end-1c")
39+
return hash(content) != text_contents[str(text_widget)]
3940

4041

4142
def confirm_close():

0 commit comments

Comments
 (0)
0