Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSW toolbar doesn't use native toolbar background #964

Open
v-rob opened this issue Aug 15, 2018 · 1 comment
Open

MSW toolbar doesn't use native toolbar background #964

v-rob opened this issue Aug 15, 2018 · 1 comment

Comments

@v-rob
Copy link

v-rob commented Aug 15, 2018

Operating system: Windows 7 Ultimate 64-bit
wxPython version: 4.0.3, stock, installed with pip
Python version: 3.7.0, stock

Description of the problem:
Under Windows 7, the native toolbar background should be a silver gradient similar to the menu bar, but when I make a toolbar, it appears flat.

This is an image of the result:

toolbar_test

Instead, it should appear like this (not my own picture):

toolbar_test

The code I used is as follows (the menubar exists for comparison):

import wx

root = wx.App()

window = wx.Frame(None, title = "Toolbar Test")

menubar = wx.MenuBar()
filemenu = wx.Menu()
fileitem = filemenu.Append(wx.ID_EXIT, 'Quit')
menubar.Append(filemenu, '&File')
window.SetMenuBar(menubar)
window.Bind(wx.EVT_MENU, lambda x: window.Close(), fileitem)

toolbar = window.CreateToolBar()
tool = toolbar.AddTool(wx.ID_ANY, label = 'Tool', bitmap = wx.Bitmap('save.png'))
toolbar.Realize()

window.SetSize(300, 200)
window.Centre()
window.Show()

root.MainLoop()

If I use wx.ToolBar(window) instead of window.CreateToolBar(), it still appears flat. Styles do not affect the flat look in either of the methods.

@RobinD42
Copy link
Member

The wxWidgets Toolbar sample behaves the same, so this isn't wxPython specific. It may be that wxWidgets is using a different native toolbar widget than the one in the other screenshot, or perhaps using non-default options, in order to be able provide all the features of the wxToolbar.

Creating a ticket about this (if there isn't already one there) at https://trac.wxwidgets.org/ might shed some more light on this. Please reply here with the link to the ticket for tracking purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants