8000 Merge pull request #28 from tecladocode/bug/27-tkinter-app-first-tab-… · VixyMan/complete-python-course@86418b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86418b7

Browse files
authored
Merge pull request tecladocode#28 from tecladocode/bug/27-tkinter-app-first-tab-not-closing
Fix not being able to close current tab as per issue tecladocode#27
2 parents f5a493a + 36955a3 commit 86418b7

File tree

1 file changed

+3
-1
lines changed
  • course_contents/19_gui_development_tkinter/lectures/17_adding_permanent_scrollbar

1 file changed

+3
-1
lines changed

course_contents/19_gui_development_tkinter/lectures/17_adding_permanent_scrollbar/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ def get_current_tab():
3030
def close_current_tab():
3131
if current_tab_unsaved() and not confirm_close():
3232
return
33+
34+
current_tab = get_current_tab()
3335

3436
if len(notebook.tabs()) == 1:
3537
create_file()
3638

37-
notebook.forget(get_current_tab())
39+
notebook.forget(current_tab)
3840

3941

4042
def current_tab_unsaved():

0 commit comments

Comments
 (0)
0