Skip to content

Instantly share code, notes, and snippets.

@clystian
Created September 10, 2019 00:20
Show Gist options
  • Select an option

  • Save clystian/e3eed35ea7fa71b791577668ba361b7c to your computer and use it in GitHub Desktop.

Select an option

Save clystian/e3eed35ea7fa71b791577668ba361b7c to your computer and use it in GitHub Desktop.
Review without Sizer, wxPython Widgets with absolute position
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import wx
class Example(wx.Frame):
def __init__(self, parent, title):
super(Example, self).__init__(parent, title=title)
self.InitUI()
self.Centre()
self.Show()
def InitUI(self):
panel = wx.Panel(self)
title = wx.StaticText(panel, label="Title", pos=(50, 50))
author = wx.StaticText(panel, label="Author", pos=(50, 100))
review = wx.StaticText(panel, label="Review", pos=(50, 150))
tc1 = wx.TextCtrl(panel, pos=(100, 50))
tc2 = wx.TextCtrl(panel, pos=(100, 100))
tc3 = wx.TextCtrl(panel, pos=(100, 150), style=wx.TE_MULTILINE)
def main():
app = wx.App()
ex = Example(None, title='Review without Sizer')
ex.Show()
app.MainLoop()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment