Checkbox- text on the left Mac + Combined Statictext-TextCtrl already existing ?

Hello Everyone,

1) I want to put a checkbox with the text on the left
and the box on the right hand side.
But it doesn't seem to work on Mac OSX: the text remains
on the right...
Is it a known bug or perhaps my config which is involved ?

2) Do you know if a combined staticText and a TextCtrl
already exists (something that would look like a checkbox
but with a textctrl instead of the box) ?

Thanks in advance
Dominique

Hi Dominique,

Hello Everyone,

1) I want to put a checkbox with the text on the left
and the box on the right hand side.
But it doesn't seem to work on Mac OSX: the text remains
on the right...
Is it a known bug or perhaps my config which is involved ?

2) Do you know if a combined staticText and a TextCtrl
already exists (something that would look like a checkbox
but with a textctrl instead of the box) ?

I have no idea on the first problem (never used a Mac). I assume you
tried the wx.ALIGN_RIGHT style for the wx.CheckBox.
For the second question, you might try to adapt the code I wrote for
the wxPython Wiki page here:

http://wiki.wxpython.org/CreatingCustomControls

It's really not that hard :smiley:

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

On 6/26/07, DomDom wrote:

This is a know limitation/bug on OS X. Has been for some time.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com

···

On Jun 26, 2007, at 10:33 AM, DomDom wrote:

1) I want to put a checkbox with the text on the left
and the box on the right hand side.
But it doesn't seem to work on Mac OSX: the text remains
on the right...

DomDom wrote:

Hello Everyone,

1) I want to put a checkbox with the text on the left
and the box on the right hand side.
But it doesn't seem to work on Mac OSX: the text remains on the right...
Is it a known bug or perhaps my config which is involved ?

The native widget does not support this feature.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I have a wx.App that's running in MainLoop(). The user hits
CTRL-C/CTRL-BREAK in the console window (on Windows). I want to catch
that event and run some cleanup code before exiting. Nothing I can find
will allow me to know that CTRL-C happened so I can run my cleanup - the
python proces just ends immediately.

I've tried using the atexit() function, and fiddling with
signal.signal(signal.SIGBREAK, signal.default_int_handler), both of
which work quite nicely outside of wx-enabled python apps. Sadly,
neither works for apps in wx-land.

So, anyone got any ideas?

Thanks,
Matt Drew

This electronic message transmission is a PRIVATE communication which
contains information which may be confidential or privileged. The
information is intended to be for the use of the individual or entity
named above. If you are not the intended recipient, please be aware that
any disclosure, copying, distribution or use of the contents of this
information is prohibited. Please notify the sender of the delivery
error by replying to this message, or notify us by telephone
(877-633-2436, ext. 0), and then delete it from your system.

Solution 1:

try:
  App.MainLoop()
except KeyboardInterrupt:
  App.CleanUp()

Solution 2:

Don't use a console window, so they can't hit ^C in
it.

Gre7g

···

--- "Drew, Matt" <Matt.Drew@arraybiopharma.com> wrote:

I have a wx.App that's running in MainLoop(). The
user hits
CTRL-C/CTRL-BREAK in the console window (on
Windows). I want to catch
that event and run some cleanup code before exiting.
Nothing I can find
will allow me to know that CTRL-C happened so I can
run my cleanup - the
python proces just ends immediately.

I've tried using the atexit() function, and fiddling
with
signal.signal(signal.SIGBREAK,
signal.default_int_handler), both of
which work quite nicely outside of wx-enabled python
apps. Sadly,
neither works for apps in wx-land.

So, anyone got any ideas?

      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7

signal.signal should work if you pass clearSigInt=False to your wxApp
constructor.

···

On 6/26/07, Drew, Matt <Matt.Drew@arraybiopharma.com> wrote:

I have a wx.App that's running in MainLoop(). The user hits
CTRL-C/CTRL-BREAK in the console window (on Windows). I want to catch
that event and run some cleanup code before exiting. Nothing I can find
will allow me to know that CTRL-C happened so I can run my cleanup - the
python proces just ends immediately.

I've tried using the atexit() function, and fiddling with
signal.signal(signal.SIGBREAK, signal.default_int_handler), both of
which work quite nicely outside of wx-enabled python apps. Sadly,
neither works for apps in wx-land.

So, anyone got any ideas?

Also, note that ctrl-c is SIGINT, not SIGBREAK

···

On 6/26/07, Chris Mellon <arkanes@gmail.com> wrote:

On 6/26/07, Drew, Matt <Matt.Drew@arraybiopharma.com> wrote:
> I have a wx.App that's running in MainLoop(). The user hits
> CTRL-C/CTRL-BREAK in the console window (on Windows). I want to catch
> that event and run some cleanup code before exiting. Nothing I can find
> will allow me to know that CTRL-C happened so I can run my cleanup - the
> python proces just ends immediately.
>
> I've tried using the atexit() function, and fiddling with
> signal.signal(signal.SIGBREAK, signal.default_int_handler), both of
> which work quite nicely outside of wx-enabled python apps. Sadly,
> neither works for apps in wx-land.
>
> So, anyone got any ideas?
>

signal.signal should work if you pass clearSigInt=False to your wxApp
constructor.

Gre7g Luterman wrote:

Solution 2:

Don't use a console window, so they can't hit ^C in
it.

That's my vote. Handling signals in the console window from the GUI app has always been problematic, and success varies widely across platforms.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn <robin <at> alldunn.com> writes:

DomDom wrote:
> Hello Everyone,
>
> 1) I want to put a checkbox with the text on the left
> and the box on the right hand side.
> But it doesn't seem to work on Mac OSX: the text remains
> on the right...
> Is it a known bug or perhaps my config which is involved ?

The native widget does not support this feature.

That's what I thought.
Thanks for the answers.

Andrea, Writing a new widget doesn't seem impossible when reading your (great)
tutorial.
Not impossible doesn't means easy... for someone like me with only a basic
knowledge of python and wxpython.
I'll try when I have more time and post the code, to get your critics.
As a first try, I'll combine the statictext and the textctrl.
I have to think how.

All, Thanks so much for your answers which help me improve
Dominique