You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.5 KiB

  1. import wx
  2. import wx.lib.inspection
  3. from gooey.gui.components.widgets.textfield import TextField
  4. from gooey.gui.components.widgets.textarea import Textarea
  5. from gooey.gui.components.widgets.password import PasswordField
  6. from gooey.gui.components.widgets.choosers import FileChooser, FileSaver, DirChooser, DateChooser
  7. from gooey.gui.components.widgets.dropdown import Dropdown
  8. from gooey.gui.components.widgets.listbox import Listbox
  9. class CCC(wx.Frame):
  10. def __init__(self, *args, **kwargs):
  11. super(CCC, self).__init__(*args, **kwargs)
  12. x = {'data':{'choices':['one', 'tw'], 'display_name': 'foo', 'help': 'bar', 'commands': ['-t']}, 'id': 1, 'options': {}}
  13. a = TextField(self, x)
  14. c = Textarea(self, x)
  15. b = PasswordField(self, x)
  16. d = DirChooser(self, x)
  17. e = FileChooser(self,x)
  18. f = FileSaver(self, x)
  19. g = DateChooser(self, x)
  20. h = Dropdown(self, x)
  21. i = Listbox(self, x)
  22. s = wx.BoxSizer(wx.VERTICAL)
  23. s.Add(a, 0, wx.EXPAND)
  24. s.Add(b, 0, wx.EXPAND)
  25. s.Add(c, 0, wx.EXPAND)
  26. s.Add(d, 0, wx.EXPAND)
  27. s.Add(e, 0, wx.EXPAND)
  28. s.Add(f, 0, wx.EXPAND)
  29. s.Add(g, 0, wx.EXPAND)
  30. s.Add(h, 0, wx.EXPAND)
  31. s.Add(i, 0, wx.EXPAND)
  32. self.SetSizer(s)
  33. app = wx.App()
  34. frame = CCC(None, -1, 'simple.py')
  35. frame.Show()
  36. app.MainLoop()
  37. # import wx
  38. #
  39. # class MainWindow(wx.Frame):
  40. # def __init__(self, *args, **kwargs):
  41. # wx.Frame.__init__(self, *args, **kwargs)
  42. #
  43. # self.panel = wx.Panel(self)
  44. #
  45. # self.label = wx.StaticText(self.panel, label="Label")
  46. # self.text = wx.TextCtrl(self.panel)
  47. # self.button = wx.Button(self.panel, label="Test")
  48. #
  49. # self.button1 = wx.Button(self.panel, label="ABOVE")
  50. # self.button2 = wx.Button(self.panel, label="BELLOW")
  51. #
  52. # self.horizontal = wx.BoxSizer()
  53. # self.horizontal.Add(self.label, flag=wx.CENTER)
  54. # self.horizontal.Add(self.text, proportion=1, flag=wx.CENTER)
  55. # self.horizontal.Add(self.button, flag=wx.CENTER)
  56. #
  57. # self.vertical = wx.BoxSizer(wx.VERTICAL)
  58. # self.vertical.Add(self.button1, flag=wx.EXPAND)
  59. # self.vertical.Add(self.horizontal, proportion=1, flag=wx.EXPAND)
  60. # self.vertical.Add(self.button2, flag=wx.EXPAND)
  61. #
  62. # self.panel.SetSizerAndFit(self.vertical)
  63. # self.Show()
  64. #
  65. #
  66. # app = wx.App(False)
  67. # win = MainWindow(None)
  68. # app.MainLoop()