Calling wxToolbar.GetToolBitmapSize() on Linux returns
numbers like (135473984,135474032) instead of something
more reasonable like (32,32). Windows correctly returns
a sensible size. A small program is attached that
demonstrates this.
Does anybody have any suggestions for a workaround? I
have to call the function since the toolbars use different
sizes on the different platforms, and I need to feed the
size into wxArtProvider.
but you
can call SetToolBitmapSize with whatever size you want on any of the
platforms.
I want to use the "natural" size for each platform, and get most of the
icons from wxArtProvider. Consequently I expect wxToolbar to pick the
correct size
Calling wxToolbar.GetToolBitmapSize() on Linux returns
numbers like (135473984,135474032) instead of something
more reasonable like (32,32). Windows correctly returns
a sensible size. A small program is attached that
demonstrates this.
I suspect the problem is that the toolbar does not have a BitmapSize
yet, as you havn't put any tools on it yet. On wxGTK, the toolbar seems
to size itself to what you put on it. wxMSW does not behave the same
way.
Does anybody have any suggestions for a workaround? I
have to call the function since the toolbars use different
sizes on the different platforms, and I need to feed the
size into wxArtProvider.
Why not use
wxToolBar.SetToolBitmapSize()
And set the size to what you want on all platforms, then you can use the
same bitmap everywhere. THis has worked just fine for me.
Note that there is a short note about his in the Wiki:
And set the size to what you want on all platforms, then you can use the
same bitmap everywhere. THis has worked just fine for me.
You missed my earlier point. I want each platform to use whatever is their
normal size! I want it to look normal to the user. I use wxArtProvider for
the bitmaps, which also allegedly have a more intimate knowledge of what
is normal for the platform.
I just ran all the programs supplied with Windows 98 that had toolbars
to see what size they used. In true Microsoft consistency about half
were the 16x15 that wxPython also defaults to, and half looked like
24x24. Then there is also the larger ones in Outlook Express and IE
that look like 32x32 with text below them. GTK apps seemed to all
use 32x32 but also have text below each button.
Basically with all that inconsistency, I don't want to make it any
worse. I want wxPython/wxWindows to make the intelligent choice
It also looks like wxTB_TEXT style has no effect on Windows 98.
You missed my earlier point. I want each platform to use whatever is their
normal size! I want it to look normal to the user. I use wxArtProvider for
the bitmaps, which also allegedly have a more intimate knowledge of what
is normal for the platform.
I just ran all the programs supplied with Windows 98 that had toolbars
to see what size they used. In true Microsoft consistency about half
were the 16x15 that wxPython also defaults to, and half looked like
24x24. Then there is also the larger ones in Outlook Express and IE
that look like 32x32 with text below them. GTK apps seemed to all
use 32x32 but also have text below each button.
Basically with all that inconsistency, I don't want to make it any
worse. I want wxPython/wxWindows to make the intelligent choice
This looks like evidence that you can't make it worse! Anyway, I suspect
that GTK does not have a "standard" size. GNOME might define 32X32 and
part of its user interface guidelines, but GTK doesn't seem to, and
therefore wxGTK doesn't. I'd pick a size that works well with your app
and your icons, and go with it.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
but you can call SetToolBitmapSize with whatever size you want on any of the platforms.
I want to use the "natural" size for each platform, and get most of the
icons from wxArtProvider. Consequently I expect wxToolbar to pick the
correct size
Currently you'll just have to use something like this:
if wxPlatform == '__WXGTK__':
tb.SetToolBitmapSize((32,32))
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
It should work in the demo if you uncomment the AddLabelTool line and
comment-out the one above it.
That worked for me. I can't find any documentation for the AddLabelTool
and AddSimpleTool as used in the toolbar demo. I presume these are
to cope with the overloaded AddTool, but that is normally noted in the
doc. There is also an inconsistency in the parameter names as in the
doc they are shortHelpString but the wxPython one is just shortHelp.