frame_tab.py 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import tkinter
  2. from tkinter import *
  3. from tkinter.ttk import *
  4. from config import conf
  5. class FrameTabsStart(Frame):
  6. def __init__(self, parent):
  7. super().__init__(parent)
  8. self.__frame()
  9. # self.tk_label_lab_api_base = self.__tk_label_lab_api_base(self)
  10. # self.tk_input_api_base = self.__tk_input_api_base(self)
  11. # self.tk_label_lab_api_key = self.__tk_label_lab_api_key(self)
  12. # self.tk_input_api_key = self.__tk_input_api_key(self)
  13. self.tk_label_lab_token = self.__tk_label_lab_token(self)
  14. self.tk_input_token = self.__tk_input_token(self)
  15. self.tk_button_save = self.__tk_button_save(self)
  16. self.tk_button_start = self.__tk_button_start(self)
  17. self.tk_button_pause = self.__tk_button_pause(self)
  18. self.tk_button_version = self.__tk_button_version(self)
  19. def __frame(self):
  20. self.place(x=0, y=0, width=675, height=510)
  21. # def __tk_label_lab_api_base(self, parent):
  22. # label = Label(parent, text="API_BASE", anchor="center", )
  23. # label.place(x=30, y=30, width=60, height=30)
  24. # return label
  25. #
  26. # def __tk_label_lab_api_key(self, parent):
  27. # label = Label(parent, text="API_KEY", anchor="center", )
  28. # label.place(x=30, y=80, width=60, height=30)
  29. # return label
  30. #
  31. # def __tk_input_api_base(self, parent):
  32. # ipt = Entry(parent, )
  33. # ipt.insert(0, conf().get("api_base"))
  34. # ipt.place(x=100, y=30, width=520, height=30)
  35. # return ipt
  36. #
  37. # def __tk_input_api_key(self, parent):
  38. # ipt = Entry(parent, )
  39. # ipt.insert(0, conf().get("api_key"))
  40. # ipt.place(x=100, y=80, width=520, height=30)
  41. # return ipt
  42. def __tk_input_token(self, parent):
  43. ipt = Entry(parent, )
  44. ipt.insert(0, conf().get("token"))
  45. ipt.place(x=100, y=30, width=520, height=30)
  46. return ipt
  47. def __tk_label_lab_token(self, parent):
  48. label = Label(parent, text="TOKEN", anchor="center", )
  49. label.place(x=30, y=30, width=60, height=30)
  50. return label
  51. def __tk_button_save(self, parent):
  52. btn = Button(parent, text="保存", takefocus=False, )
  53. btn.place(x=30, y=80, width=80, height=30)
  54. return btn
  55. def __tk_button_start(self, parent):
  56. btn = Button(parent, text="启动", takefocus=False, )
  57. btn.place(x=130, y=80, width=80, height=30)
  58. return btn
  59. def __tk_button_pause(self, parent):
  60. btn = Button(parent, text="暂停", takefocus=False, state=tkinter.DISABLED)
  61. btn.place(x=230, y=80, width=50, height=30)
  62. return btn
  63. def __tk_button_version(self, parent):
  64. btn = Button(parent, text="版本", takefocus=False)
  65. btn.place(x=530, y=80, width=50, height=30)
  66. return btn