Mac: wx.TextCtrl: fails to resize height after setting a larger font.

See attached.
After setting a larger font on wx.TextCtrl, it does not change its height sufficiently to see the contents.

The height is changed correctly on Windows/Linux.

Details:

OSX: Mavericks

python: 2.7.5

wxPython: 2.9.5.0

Is this problem related to wx.Button not changing its height with a larger font?

As you might has guessed, I am trying to make a keypad that is touch-screen friendly.

As I am porting this app from Windows/Linux, I am trying to avoid redesign to use common help/documentation etc.

Ideas?

keypadTest.py (1.67 KB)

I just found wx.lib.editor, which is a generic written in wxPython (not system dependent).
I am going to see if I can use that editor to address the problem.

···

On Sunday, November 17, 2013 9:32:55 AM UTC-5, Edward Sitarski wrote:

See attached.
After setting a larger font on wx.TextCtrl, it does not change its height sufficiently to see the contents.

The height is changed correctly on Windows/Linux.

Details:

OSX: Mavericks

python: 2.7.5

wxPython: 2.9.5.0

Is this problem related to wx.Button not changing its height with a larger font?

As you might has guessed, I am trying to make a keypad that is touch-screen friendly.

As I am porting this app from Windows/Linux, I am trying to avoid redesign to use common help/documentation etc.

Ideas?

Scratch that idea. The generic editor is pretty old, and does not support SetFont.
Anyone have an idea?

···

On Sunday, November 17, 2013 4:57:15 PM UTC-5, Edward Sitarski wrote:

I just found wx.lib.editor, which is a generic written in wxPython (not system dependent).
I am going to see if I can use that editor to address the problem.

On Sunday, November 17, 2013 9:32:55 AM UTC-5, Edward Sitarski wrote:

See attached.
After setting a larger font on wx.TextCtrl, it does not change its height sufficiently to see the contents.

The height is changed correctly on Windows/Linux.

Details:

OSX: Mavericks

python: 2.7.5

wxPython: 2.9.5.0

Is this problem related to wx.Button not changing its height with a larger font?

As you might has guessed, I am trying to make a keypad that is touch-screen friendly.

As I am porting this app from Windows/Linux, I am trying to avoid redesign to use common help/documentation etc.

Ideas?

After setting a larger font on wx.TextCtrl, it does not change its height
sufficiently to see the contents.

You shouldn't have to do this, but you can set the size yourself to match
the font size:

        self.textCtrl = wx.TextCtrl( self,
                                     size=(-1, fontPixels*1.2),
                                     style=wx.TE_RIGHT |
wx.TE_PROCESS_ENTER,
                                     value='' )
        self.textCtrl.SetFont( font )

The -1 for the width means "default", or "set automatically". The 1.2 seems
to look reasonable with very little testing!

Boy, wxMac does need some attention -- sorry about that!

This does seem different to the button problem, as buttons won't re-size
even if you give them an explicite size.

-Chris

···

On Sun, Nov 17, 2013 at 6:32 AM, Edward Sitarski <edward.sitarski@gmail.com>wrote:

The height is changed correctly on Windows/Linux.

Details:

OSX: Mavericks
python: 2.7.5
wxPython: 2.9.5.0

Is this problem related to wx.Button not changing its height with a larger
font?

As you might has guessed, I am trying to make a keypad that is
touch-screen friendly.
As I am porting this app from Windows/Linux, I am trying to avoid redesign
to use common help/documentation etc.

Ideas?

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython

Thanks for the tip.

I tried a similar idea with SetSize( (-1, fontSize*1.2) ), but it didn’t work (maybe I had something else wrong).

I will check if this makes a difference.

···

On Sunday, November 17, 2013 11:35:30 PM UTC-5, Christopher Barker wrote:

On Sun, Nov 17, 2013 at 6:32 AM, Edward Sitarski edward....@gmail.com wrote:

After setting a larger font on wx.TextCtrl, it does not change its height sufficiently to see the contents.

You shouldn’t have to do this, but you can set the size yourself to match the font size:

self.textCtrl = wx.TextCtrl( self,

size=(-1, fontPixels*1.2),

style=wx.TE_RIGHT | wx.TE_PROCESS_ENTER,

value=‘’ )

self.textCtrl.SetFont( font )

The -1 for the width means “default”, or “set automatically”. The 1.2 seems to look reasonable with very little testing!

Boy, wxMac does need some attention – sorry about that!

This does seem different to the button problem, as buttons won’t re-size even if you give them an explicite size.

-Chris

The height is changed correctly on Windows/Linux.

Details:

OSX: Mavericks

python: 2.7.5

wxPython: 2.9.5.0

Is this problem related to wx.Button not changing its height with a larger font?

As you might has guessed, I am trying to make a keypad that is touch-screen friendly.

As I am porting this app from Windows/Linux, I am trying to avoid redesign to use common help/documentation etc.

Ideas?

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Christopher Barker, PhD

Python Language Consulting

  • Teaching

  • Scientific Software Development

  • Desktop GUI and Web Development

  • wxPython, numpy, scipy, Cython