@@ -39,19 +39,15 @@ def preparewindow():
3939 root .resizable (True , True )
4040 editor .build (cfg , theme , root )
4141
42- def openfile ():
42+ def openfile (path ):
4343 preparewindow ()
44- tabmanager .openfile ()
45-
46- def openlast ():
47- preparewindow ()
48- tabmanager .openfile (path = content )
44+ tabmanager .openfile (path = path )
4945
5046title = tkinter .Label (root , text = "Onyx Editor" , font = ("Segoe UI" , 20 , "bold" )).pack (anchor = "nw" , padx = 20 , pady = 20 )
5147btncreatenew = ttk .Button (root , text = "Create New File" , command = preparewindow ).pack (anchor = "nw" , padx = 20 )
52- btnopenfile = ttk .Button (root , text = "Open File" , command = openfile ).pack (anchor = "nw" , pady = 10 , padx = 20 )
48+ btnopenfile = ttk .Button (root , text = "Open File" , command = lambda : openfile ( path = "" ) ).pack (anchor = "nw" , pady = 10 , padx = 20 )
5349btnopendir = ttk .Button (root , text = "Open Directory" , state = "disabled" ).pack (anchor = "nw" , padx = 20 )
54- btnopenlast = ttk .Button (root , text = "Open last file" , command = openlast )
50+ btnopenlast = ttk .Button (root , text = "Open last file" , command = lambda : openfile ( path = content ) )
5551btnopenlast .pack (anchor = "nw" , padx = 20 , pady = 20 )
5652
5753file = open ("lastfile.txt" , "r" )
0 commit comments