@@ -4,7 +4,7 @@ import tkinter as tk
44import tkinterdnd2
55from tkinter .constants import ACTIVE , LEFT , RIGHT
66from tkinterdnd2 import *
7- from tkinter import Button , Label , Listbox , filedialog
7+ from tkinter import END , Button , Label , Listbox , filedialog
88from tkinter import messagebox
99
1010# OpenVPN GUI Version for Linux
@@ -40,13 +40,15 @@ def drags():
4040 Label (top ).pack ()
4141 def input (event ):
4242 lb .insert ("end" , event .data )
43- lb = Listbox (top , width = 37 , height = 6 )
43+ lb = Listbox (top , width = 37 , height = 5 )
4444 lb .pack ()
4545 lb .drop_target_register (DND_FILES )
4646 lb .dnd_bind ('<<Drop>>' , input )
47- # command
4847 def cmd ():
4948 os .popen ("xterm -e 'sudo openvpn --config " + lb .get (ACTIVE )+ "'" ).read ()
49+ def clear ():
50+ lb .delete (0 , END )
51+ Button (top , text = " Clear " , command = clear ).pack (pady = 8 )
5052 Button (top , text = " Select " , command = cmd ).pack (side = RIGHT , padx = 50 )
5153 Button (top , text = " Back " , command = top .destroy ).pack (side = LEFT , padx = 50 )
5254
@@ -62,7 +64,7 @@ def keluar():
6264
6365# menu awal
6466Label (root , text = "OpenVPN GUI Version for Linux\r \n Created by Mugi Fadilah\n http://github.com/mugi789" ).pack (pady = 20 )
65- Button (root , text = "-= Open Config =-" , command = click ).pack ()
67+ Button (root , text = " -= Open Config =- " , command = click ).pack ()
6668Button (root , text = "-= Drag and Drop =-" , command = drags ).pack ()
6769Button (root , text = "-== Exit ==-" , command = keluar ).pack (expand = True )
6870tk .mainloop ()
0 commit comments