What is the default style for wxPython's wx.Panel?

Viewed 349

I'm writing a mini-toolkit to automate the creation of a wxPython UI, and while I have never actually used the style parameter (or, indeed, any of the other parameters than Parent) as yet, I'd like to keep my options open for later and have the ability to provide one. And the way things are set up in my code, I will need to provide a default. I'd like to just keep the wxPython default, but I don't know what that is. The documentation at https://docs.wxpython.org/wx.Panel.html just says to see the documentation at https://docs.wxpython.org/wx.Panel.html. So I looked at the parent class, wx.Window, and the documentation at https://docs.wxpython.org/wx.Window.html says to see the documentation at https://docs.wxpython.org/wx.Window.html. (The Phoenix documentation inherits the recursions from the original.)

1 Answers

First of all, the documentation specifies the default values of the wx.Panel constructor:

__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=TAB_TRAVERSAL, name=PanelNameStr)

However, when in doubt, you can find the value by yourself, by creating a wx.Panel without specifying the style parameter, and calling wx.Panel.GetWindowStyle, e.g.:

import wx

app = wx.App()
frame = wx.Frame(None, title="Panel Default Style Checker")
panel = wx.Panel(frame)
print("wx.Panel default Window style:", panel.GetWindowStyle())
print("wx.Panel default Extra style:", panel.GetExtraStyle())
frame.Show()
app.MainLoop()
Related