Advertisement
Guest User

Untitled

a guest
Aug 14th, 2019
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import ttk
  3. from tkinter import messagebox as msg
  4.  
  5. # Establishes the GUI
  6. win = tk.Tk()
  7. win.title('MFF:Worlds Launcher (Version 001.2B)')
  8.  
  9. # Creating the labels
  10. a_label = ttk.Label(win, text='Username:')
  11. a_label.grid(column=0, row=0)
  12. b_label = ttk.Label(win, text="Password:")
  13. b_label.grid(column=1, row=0)
  14. c_label = ttk.Label(win, text='Select a Server:')
  15. c_label.grid(column=2, row=0)
  16.  
  17. # Creating the Entries
  18. a_entry = ttk.Entry(win, width=12)
  19. a_entry.grid(column=0, row=1)
  20. a_entry.focus() # sets the focus on the first entry
  21. b_entry = ttk.Entry(win, width=12, show='*') # 'show' hides the plaintext
  22. b_entry.grid(column=1, row=1)
  23.  
  24. # Creating the Combobox and its dependencies
  25. server = tk.StringVar()
  26. server_list = ttk.Combobox(win, width=14, textvariable=server, state='readonly') # 'readonly' makes it read only (duh)
  27. server_list['values'] = ('North America', 'Europe', 'Asia', 'Public Test')
  28. server_list.grid(column=2, row=1)
  29. server_list.current(0)
  30.  
  31. # Creating three check buttons
  32. chVarDis = tk.IntVar()
  33. check1 = tk.Checkbutton(win, text='Error Reporting', variable=chVarDis, state='disabled')
  34. check1.select()
  35. check1.grid(column=0, row=4, sticky=tk.W)
  36.  
  37. chVarUn = tk.IntVar()
  38. check2 = tk.Checkbutton(win, text='Safe Mode', variable=chVarUn)
  39. check2.deselect()
  40. check2.grid(column=1, row=4, sticky=tk.W)
  41.  
  42. chVarEn = tk.IntVar()
  43. check3 = tk.Checkbutton(win, text='Fullscreen', variable=chVarEn)
  44. check3.select()
  45. check3.grid(column=2, row=4, sticky=tk.W)
  46.  
  47.  
  48. # Button command def
  49. def clicked():
  50. a_button.configure(state='disabled')
  51. msg.showinfo('Error 001', 'No Server Found.\nPlease check your connection.')
  52.  
  53.  
  54. # Creating the Button
  55. a_button = ttk.Button(win, width=12, text='Play Now!', command=clicked)
  56. a_button.grid(column=3, row=1)
  57.  
  58. # Starts the GUI
  59. win.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement