Har
Har

Reputation: 3918

Enable Visual styles on windows and buttons for wxpython

In windows 7 there is a setting I can set called "Use visual styles on windows and buttons" however the change in there does not reflect on wxPython.

I am attempting to write a dialog box which would look as native as possible.

If I open a dialog in Windows 7 i.e. the "Run" dialog when visual styles are enabled the background of the dialog is white and there is a separator. When the visual style is off then the whole dialog is grey.

None of this is reflected in wxpython, wxpython produces a dialog with a grey background regardless of whether the visual styles are enabled or disabled.

Note: This is also true for wx.Panel where sub-classing it regardless of visual style defaults to always using a grey background (unless the user changes the default)

Is there a way to enable visual styles for wxpython applications? It seems that wx.Lua has this functionality: http://sourceforge.net/p/wxlua/svn/195/

Also the wxWidgets library states support for it: WxWidgets visual style this maybe a bug/missing functionality in the wxpython build taken from: wxPython

Visual styles http://msdn.microsoft.com/en-gb/library/windows/desktop/bb773187(v=vs.85).aspx

Windows XP and later operating systems support a feature called visual styles that enables the appearance of common controls to change based on the theme chosen by the user. Prior to Windows 8, you must specifically configure your application to use visual styles; otherwise, the application's common controls are always rendered in the style associated with the Windows Classic theme, regardless of the currently selected theme.

Visual style on

Visual style in enabled

Visual style off

Visual style is not enabled

Upvotes: 0

Views: 961

Answers (1)

Mike Driscoll
Mike Driscoll

Reputation: 33071

wxPython does what is native by default because it uses native widgets. There are some custom widgets in wx.lib that may or may not look native. I am guessing you are sub-classing wx.Dialog. This is probably normal / native behavior for a subclassed wx.Dialog. If you want something more generic, then you should use wx.MessageDialog.

Upvotes: 2

Related Questions