Help with aspect image aspect ratio.

Hi,

I'm writing my very first GUI, and so far it has been pretty enjoyable
to learn wxPython. However, I'm experiencing a problem in my program.
Here is how the GUI main window appear in my linux box:

http://dl.dropbox.com/u/4411725/CCCgistemp/GUI/GUI.png

but here is how it is displayed in a friend's mac:

http://dl.dropbox.com/u/4411725/CCCgistemp/GUI/guimac.png

Does anyone have some idea what I'm doing wrong?

The code for the GUI is hosted here (feel free to criticize other it.)

http://code.google.com/p/ccc-gistemp/source/browse/branches/2011-05-18/gsoc/gui/run_gui.py

Thanks, Filipe.

pic = wx.Image(name=HEADER_FILE, type=wx.BITMAP_TYPE_PNG)
         pic = pic.ConvertToBitmap()
         self.btn_source = wx.BitmapButton(parent=self.panel, id=-1,
                                           bitmap=pic,
                                           pos=(0, 0),
                                           style=wx.NO_BORDER)
         self.btn_source.Bind(wx.EVT_BUTTON, self.webSource)

Mac has some odd restrictions on sizes for the native bitmap buttons, so I expect that using a large wide image like that is causing it to go a little crazy. Instead you can use the GenBitmapButton in the wx.lib.buttons module, and fiddle with its attributes like bezel width, using the focus indicator, etc. to make it look like you want. Or if you would rather have it look more like just a bitmap and less like a button then using wx.lib.statbmp and binding a handler for the mouse events should do the trick for you too.

···

On 8/10/11 9:11 AM, Filipe Pires Alvarenga Fernandes wrote:

Hi,

I'm writing my very first GUI, and so far it has been pretty enjoyable
to learn wxPython. However, I'm experiencing a problem in my program.
Here is how the GUI main window appear in my linux box:

http://dl.dropbox.com/u/4411725/CCCgistemp/GUI/GUI.png

but here is how it is displayed in a friend's mac:

http://dl.dropbox.com/u/4411725/CCCgistemp/GUI/guimac.png

Does anyone have some idea what I'm doing wrong?

The code for the GUI is hosted here (feel free to criticize other it.)

Google Code Archive - Long-term storage for Google Code Project Hosting.

Thanks, Filipe.

--
Robin Dunn
Software Craftsman

Hi,

I'm writing my very first GUI, and so far it has been pretty enjoyable
to learn wxPython. However, I'm experiencing a problem in my program.
Here is how the GUI main window appear in my linux box:

http://dl.dropbox.com/u/4411725/CCCgistemp/GUI/GUI.png

but here is how it is displayed in a friend's mac:

http://dl.dropbox.com/u/4411725/CCCgistemp/GUI/guimac.png

Does anyone have some idea what I'm doing wrong?

The code for the GUI is hosted here (feel free to criticize other it.)

Google Code Archive - Long-term storage for Google Code Project Hosting.

Thanks, Filipe.

   pic = wx\.Image\(name=HEADER\_FILE, type=wx\.BITMAP\_TYPE\_PNG\)
   pic = pic\.ConvertToBitmap\(\)
   self\.btn\_source = wx\.BitmapButton\(parent=self\.panel, id=\-1,
                                     bitmap=pic,
                                     pos=\(0, 0\),
                                     style=wx\.NO\_BORDER\)
   self\.btn\_source\.Bind\(wx\.EVT\_BUTTON, self\.webSource\)

Mac has some odd restrictions on sizes for the native bitmap buttons, so I
expect that using a large wide image like that is causing it to go a little
crazy. Instead you can use the GenBitmapButton in the wx.lib.buttons
module, and fiddle with its attributes like bezel width, using the focus
indicator, etc. to make it look like you want. Or if you would rather have
it look more like just a bitmap and less like a button then using
wx.lib.statbmp and binding a handler for the mouse events should do the
trick for you too.

Thanks a lot, I just implemented the second suggestion and it looks
better even on my Linux machine. I did not wanted a button for that,
but buttons tutorials are easier to find than static bitmap events :slight_smile:

Thanks again, Filipe.

···

On Wed, Aug 10, 2011 at 12:36, Robin Dunn <robin@alldunn.com> wrote:

On 8/10/11 9:11 AM, Filipe Pires Alvarenga Fernandes wrote:

--
Robin Dunn
Software Craftsman
http://wxPython.org