I would like to build a GUI like the picture but without the red part. Is it possible?
Hi @js6033! Welcome to the forum!
I’m new to GUI design, but I’ve been developing a small project with wxPython framework.
What you wanna do is possible, as I have just checked. Try the following:
import wx class Example(wx.Frame): def __init__(self, parent, style, size): super(Example, self).__init__(parent, style=style, size=size) self.InitUI() self.Centre() def InitUI(self): panel = wx.Panel(self) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox2 = wx.BoxSizer(wx.HORIZONTAL) vbox = wx.BoxSizer(wx.VERTICAL) button1 = wx.Button(panel, label="Start") button2 = wx.Button(panel, label="Stop") hbox1.Add(button1) hbox2.Add(button2) vbox.Add( hbox1, 0, wx.CENTER) vbox.Add(hbox2, 0, wx.CENTER) panel.SetSizer(vbox) def main(): app = wx.App() ex = Example(None, style= wx.CAPTION | wx.RESIZE_BORDER, size = (200, 100)) ex.Show() app.MainLoop() if __name__ == '__main__': main()
It should display something like this:
The trick to do what you want is in defining the style of the frame.
This might give you an idea, though the code could probably be written in a more efficient way. If you’re thinking of using this framework, check this tutorial:
Hope it helps!
Hi, and thanks for your code. However I found another code to do my works.
# Create instance
win = tk.Tk()
overrideredirect and geometry are great.
Nice. Looks really simple. I think I have to give Tkinter a try.