Build a reduced GUI

GUI_2
Hi,
I would like to build a GUI like the picture but without the red part. Is it possible?
Regards
Jonny

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:

image

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!

Cheers

1 Like

Hi, and thanks for your code. However I found another code to do my works.

# Create instance
win = tk.Tk()
win.overrideredirect(1)
win.geometry(“220x50+50-50”)

bild_1

overrideredirect and geometry are great.

Nice. Looks really simple. I think I have to give Tkinter a try.