@@ -17,7 +17,9 @@ def check_for_changes():
17
17
18
18
19
19
def get_text_widget ():
20
- text_widget = notebook .nametowidget (notebook .select ())
20
+ current_tab = notebook .nametowidget (notebook .select ())
21
+ text_widget = current_tab .winfo_children ()[0 ]
22
+
21
23
return text_widget
22
24
23
25
@@ -65,16 +67,19 @@ def confirm_quit():
65
67
66
68
67
69
def create_file (content = "" , title = "Untitled" ):
68
- text_area = tk .Text (notebook )
70
+ container = ttk .Frame (notebook )
71
+ container .pack ()
72
+
73
+ text_area = tk .Text (container )
69
74
text_area .insert ("end" , content )
70
75
text_area .pack (si
8000
de = "left" , fill = "both" , expand = True )
71
76
72
- notebook .add (text_area , text = title )
73
- notebook .select (text_area )
77
+ notebook .add (container , text = title )
78
+ notebook .select (container )
74
79
75
80
text_contents [str (text_area )] = hash (content )
76
81
77
- text_scroll = ttk .Scrollbar (text_area , orient = "vertical" , command = text_area .yview )
82
+ text_scroll = ttk .Scrollbar (container , orient = "vertical" , command = text_area .yview )
78
83
text_scroll .pack (side = "right" , fill = "y" )
79
84
text_area ["yscrollcommand" ] = text_scroll .set
80
85
@@ -122,7 +127,6 @@ def show_about_info():
122
127
123
128
124
129
root = tk .Tk ()
125
- root .geometry ("600x400" )
126
130
root .title ("Teclado Text Editor" )
127
131
root .option_add ("*tearOff" , False )
128
132
<
3218
code class="diff-text-cell hunk">
0 commit comments