0

I am following this example https://github.com/cztomczak/cefpython/blob/master/examples/wxpython.py for cefpython3 and wxpython. However I am looking to disable the windows border so the program can no longer be adjusted size wise and their is no title bar. But I would like to keep it so the program can be moved around the screen. I have done some research but not come across a way to successfully do this.

Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60
Tron
  • 115
  • 2
  • 7

1 Answers1

0

The following appears to do the job on Linux.
Your mileage may vary.

import wx

class MyFrame(wx.Frame):
    def __init__(self, parent, id=wx.ID_ANY, title="", size=(360,100)):
        super(MyFrame, self).__init__(parent, id, title, size, style = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX))
        self.panel = wx.Panel(self)
        self.panel.SetBackgroundColour('palegreen')
        self.Show()

if __name__ == "__main__":
    app = wx.App()
    frame = MyFrame(None,title="Non-Resizeable Frame")
    app.MainLoop()
Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60
  • It does stop it being resized however does not remove the Windows bar – Tron Mar 30 '20 at 13:17
  • You can always use `style = wx.BORDER_NONE` but then you had better add a `Close` button. It's that pesky "Window Bar" as you refer to it, that gives you something to grab for repositioning. That too, can be coded by you but I feel that that isn't part of your question. – Rolf of Saxony Mar 30 '20 at 15:35
  • Try `style = wx.BORDER_THEME`, on my box I get the thinnest line at the top of the window to grab, which enables me to move it. – Rolf of Saxony Mar 30 '20 at 15:42
  • Both BORDER_NONE and BORDER_THEME turn my app into a grey box – Tron Mar 30 '20 at 16:55
  • Then unless someone else comes up with a better idea, run with my answer, until such time as a better solution comes up. You haven't mentioned your OS, add it to your question, you may get a more targeted reply. – Rolf of Saxony Mar 30 '20 at 18:30
  • There is a cefpython tag, I've added it to your question. – Rolf of Saxony Mar 31 '20 at 08:56