Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.70 KB | None | 0 0
  1. # import the library
  2. from appJar import gui
  3. from os import listdir
  4.  
  5.  
  6. # grid tip
  7. # "row=1 column=2 colspan=1 rowspan=2", 1, 2, 1, 2)
  8.  
  9. # handle button events
  10. def press(button):
  11.     if button == "Cancel" or button == "Выход":
  12.         app.stop()
  13.     elif button == "Info" or button == "Справка":
  14.         app.infoBox("Info", "Blablabla")
  15.     else:
  16.         usr = "123"
  17.         pwd = app.getEntry("Password")
  18.         print("User:", usr, "Pass:", pwd)
  19.  
  20. # create a GUI variable called app
  21. app = gui("Dictionary fiesta", "700x320")
  22. app.setFont(18)
  23. app.setResizable(canResize=False)
  24. app.setStretch("both")
  25.  
  26. # Name of the current file being processed
  27. app.addLabel("header", "Общий диктант на разные правила", row=0, column=0, colspan=2)
  28.  
  29. # Left column with files list and exit buttons
  30. app.startPanedFrame("select_window", row=1, column=0)
  31.  
  32. files = listdir("C:/Slovar/Slovar/slbase")
  33. mytxt = filter(lambda x: x.endswith('.txt'), files)
  34.  
  35. app.addListBox("list", [mytxt], 1,2,1,2)
  36. app.addButtons(["Справка", "Выход"], press, row=3, column=2)
  37. app.stopPanedFrame()
  38. app.getListBoxWidget("list").config(width=1)
  39.  
  40.  
  41. # Right column with main actions
  42. app.startLabelFrame("main_window", row=1, column=1)
  43. app.addLabel("main_phrase", "без_дейный")
  44. app.getLabelWidget("main_phrase").config(font="Times 30", width=30)
  45.  
  46. # variants buttons
  47. app.startPanedFrame("p1")
  48. app.addButtons(["ы", "и"], press)
  49. app.stopPanedFrame()
  50.  
  51. app.setLabelSticky("main_phrase", "wns")
  52. app.setPanedFrameSticky("p1", "ew")
  53. app.stopLabelFrame()
  54.  
  55. app.setPanedFrameSticky("select_window", "nsw")
  56. app.setLabelFrameSticky("main_window", "nsew")
  57.  
  58. # start the GUI
  59. app.go()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement