I'm going through a number of wxPython examples and building a GUI for
a small application. So far everything pretty much makes sense and I'm
kind of wow'd by the power of this tool.
I put a toolbar on my main frame and added some buttons to it. It
works fine, but the buttons seem a bit crowded. I think it would look
better if I could increase the spacing between the buttons by about 5
pixels or so. I don't see any methods in the documentation on doing
this, unless I'm overlooking something that's staring me in the face.
Any hints, or tricks that I should try? I thought of editing the icons
themselves to give them transparent buffers on either side, but that
would kind of mess up the appearance that the button border takes when
the mouse focus moves over one. I want to keep the square icons, in
other words, but space them out a little from each other.
I'm going through a number of wxPython examples and building a GUI for
a small application. So far everything pretty much makes sense and I'm
kind of wow'd by the power of this tool.
I put a toolbar on my main frame and added some buttons to it. It
works fine, but the buttons seem a bit crowded. I think it would look
better if I could increase the spacing between the buttons by about 5
pixels or so. I don't see any methods in the documentation on doing
this, unless I'm overlooking something that's staring me in the face.
Nope, there isn't anything in the API for setting space between tools. The native toolbars are used on each platform (mostly, there is an exception on OSX in certain circumstances) and so the toolbars should look like the platofrm designers intended and also the same as the toolbars in other applications on the platform. That includes the layout of the tools.
Any hints, or tricks that I should try? I thought of editing the icons
themselves to give them transparent buffers on either side, but that
would kind of mess up the appearance that the button border takes when
the mouse focus moves over one. I want to keep the square icons, in
other words, but space them out a little from each other.
You could use labels on your tools, that should spread them out a bit to make room for the labels. If you are on a platform that just uses empty space for the separators then you can add a separator between each tool, but that would look pretty bad on the platforms that use a line.
Thanks, Robin. Actually, I think I just need slightly larger buffers
on my icons, because on second look they're kind of crowded to the top
and bottom borders too. Thanks for the response, and I'm really
liking the things I can easily do with wxPython.
···
On Mar 2, 10:20 am, Robin Dunn <ro...@alldunn.com> wrote:
On 3/1/11 9:23 PM, llanitedave wrote:
> I'm going through a number of wxPython examples and building a GUI for
> a small application. So far everything pretty much makes sense and I'm
> kind of wow'd by the power of this tool.
> I put a toolbar on my main frame and added some buttons to it. It
> works fine, but the buttons seem a bit crowded. I think it would look
> better if I could increase the spacing between the buttons by about 5
> pixels or so. I don't see any methods in the documentation on doing
> this, unless I'm overlooking something that's staring me in the face.
Nope, there isn't anything in the API for setting space between tools.
The native toolbars are used on each platform (mostly, there is an
exception on OSX in certain circumstances) and so the toolbars should
look like the platofrm designers intended and also the same as the
toolbars in other applications on the platform. That includes the
layout of the tools.
> Any hints, or tricks that I should try? I thought of editing the icons
> themselves to give them transparent buffers on either side, but that
> would kind of mess up the appearance that the button border takes when
> the mouse focus moves over one. I want to keep the square icons, in
> other words, but space them out a little from each other.
You could use labels on your tools, that should spread them out a bit to
make room for the labels. If you are on a platform that just uses empty
space for the separators then you can add a separator between each tool,
but that would look pretty bad on the platforms that use a line.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org
On Mar 2, 10:20 am, Robin Dunn<ro...@alldunn.com> wrote:
You could use labels on your tools, that should spread them out a bit to
make room for the labels. If you are on a platform that just uses empty
space for the separators then you can add a separator between each tool,
but that would look pretty bad on the platforms that use a line.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I created a blank png file 5x22 pixels in dimensions, and used this
slightly modified line from your link:
toolbar.AddControl(wx.StaticBitmap(toolbar, -1,
wx.Image('blankspace.png', wx.BITMAP_TYPE_PNG).ConvertToBitmap(),
wx.DefaultPosition, wx.DefaultSize))
Works perfectly, increasing the spacing very subtly.
Thanks!
···
On Mar 2, 1:18 pm, Christopher Barker <Chris.Bar...@noaa.gov> wrote:
On 3/2/11 11:44 AM, llanitedave wrote:
> On Mar 2, 10:20 am, Robin Dunn<ro...@alldunn.com> wrote:
>> You could use labels on your tools, that should spread them out a bit to
>> make room for the labels. If you are on a platform that just uses empty
>> space for the separators then you can add a separator between each tool,
>> but that would look pretty bad on the platforms that use a line.
you can make your own separator, which could be a blank bitmap. See the
examples here:
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception