wxpython-users Digest, Vol 9, Issue 24

Hi, All
I think I’v found the solution of my question.
Well, the secret is to use Layer() method.
Thanks to Andrea and *Vlastimil as well

···

Roy*

2008/11/6 wxpython-users-request@lists.wxwidgets.org

Send wxpython-users mailing list submissions to

    wxpython-users@lists.wxwidgets.org

To subscribe or unsubscribe via the World Wide Web, visit

    [http://lists.wxwidgets.org/mailman/listinfo/wxpython-users](http://lists.wxwidgets.org/mailman/listinfo/wxpython-users)

or, via email, send a message with subject or body ‘help’ to

    wxpython-users-request@lists.wxwidgets.org

You can reach the person managing the list at

    wxpython-users-owner@lists.wxwidgets.org

When replying, please edit your Subject line so it is more specific

than “Re: Contents of wxpython-users digest…”

Today’s Topics:

  1. Re: Possible bug in FileConfig (Andrea Gavana)

  2. Re: AuiManager question (Andrea Gavana)

  3. MaskedNumCtrl - problem with using ChangeValue (Werner F. Bruhin)

  4. Re: AuiManager question (Vlastimil Brom)

  5. Re: wxPython crash on Gentoo (nulla.epistola@web.de)

  6. start work thread right after app mainloop start (jason zhang)

  7. Re: start work thread right after app mainloop start (jason zhang)


Message: 1

Date: Thu, 6 Nov 2008 09:04:28 +0000

From: “Andrea Gavana” andrea.gavana@gmail.com

Subject: Re: [wxpython-users] Possible bug in FileConfig

To: wxpython-users@lists.wxwidgets.org

Message-ID:

    <d5ff27200811060104y26056af5g663957a392292d1a@mail.gmail.com>

Content-Type: text/plain; charset=ISO-8859-1

Hi Paul,

On Thu, Nov 6, 2008 at 8:37 AM, Paul Scott wrote:

I have been using FileConfig for a couple of small applications to

store, well, configs for XML-RPC details.

What I have found is that in some cases, it is necessary to touch the

filename like so:

def GetConfig(self):

   """
   Reads the config file for the application if it exists and

return a configfile object for use later.

   """
   if not os.path.exists(self.GetDataDir()):
       os.makedirs(self.GetDataDir())
   if not os.path.exists(os.path.join(self.GetDataDir(),

“chisimbauploader”)):

       open(os.path.join(self.GetDataDir(), "chisimbauploader"),

‘w’).close()

   config = wx.FileConfig(
       localFilename=os.path.join(self.GetDataDir(),

“chisimbauploader”))

   return config

in order for the config to get written on config.write()

This seems to happen spuriously, which leads me to believe that it may

be a bug.

Is this indeed the case?

I don’t know on which platform this happens and which wxPython version

you are using, but I use exactly the same code (except the “touch”) on

Windows XP for my GUI2Exe and everything works fine. As I know of some

user of GUI2Exe using GTK and Mac without issues with wx.FileConfig, I

don’t suppose a bug exists.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/


Message: 2

Date: Thu, 6 Nov 2008 09:14:05 +0000

From: “Andrea Gavana” andrea.gavana@gmail.com

Subject: Re: [wxpython-users] AuiManager question

To: wxpython-users@lists.wxwidgets.org

Message-ID:

    <d5ff27200811060114g5bb8d2c1r7f5ba6f43d050c26@mail.gmail.com>

Content-Type: text/plain; charset=“iso-8859-1”

Hi Lionel,

On Thu, Nov 6, 2008 at 9:03 AM, Lionel Liu wrote:

This is a piece of sample code from aui.py.

My question is that when I run this code, I get a layout like this one,

, but I need it like this, .

Anyone can help me?

If you use the AddPane call which uses the wx.aui.AuiPaneInfo class it

is much easier to layout your panes in the most complex ways you wish.

See the attached file.

HTH.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/

-------------- next part --------------

import wx =

import wx.aui

class MyFrame(wx.Frame): =

def __init__(self, parent, id=3D-1, title=3D'wx.aui Test', =



             pos=3Dwx.DefaultPosition, size=3D(800, 600), =



             style=3Dwx.DEFAULT_FRAME_STYLE): =



    wx.Frame.__init__(self, parent, id, title, pos, size, style)



    self._mgr =3D wx.aui.AuiManager(self)



    # create several text controls

    text1 =3D wx.TextCtrl(self, -1, 'Pane 1 - sample text', =



                        wx.DefaultPosition, wx.Size(200,150), =



                        wx.NO_BORDER | wx.TE_MULTILINE)



    text2 =3D wx.TextCtrl(self, -1, 'Pane 2 - sample text', =



                        wx.DefaultPosition, wx.Size(200,150), =



                        wx.NO_BORDER | wx.TE_MULTILINE)



    text3 =3D wx.TextCtrl(self, -1, '', =



                        wx.DefaultPosition, wx.Size(200,150), =



                        wx.NO_BORDER | wx.TE_MULTILINE)



    # add the panes to the manager

                      =



    self._mgr.AddPane(text2, wx.aui.AuiPaneInfo().Caption('Pane Number =

Two’).Bottom())

    self._mgr.AddPane(text1, wx.aui.AuiPaneInfo().Caption('Pane Number =

One’).Left().

                      Layer(1))

    self._mgr.AddPane(text3, wx.CENTER)



    # tell the manager to 'commit' all the changes just made

    self._mgr.Update()



    self.Bind(wx.EVT_CLOSE, self.OnClose)





def OnClose(self, event): =



    # deinitialize the frame manager

    self._mgr.UnInit()

    # delete the frame

    self.Destroy()

app =3D wx.App()

frame =3D MyFrame(None)

frame.Show()

app.MainLoop()


Message: 3

Date: Thu, 06 Nov 2008 11:40:57 +0100

From: “Werner F. Bruhin” werner.bruhin@free.fr

Subject: [wxpython-users] MaskedNumCtrl - problem with using

    ChangeValue

To: wxPython-users@lists.wxwidgets.org

Message-ID: 4912C9B9.7090403@free.fr

Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Having a problem when using numCtrl.ChangeValue(floatValue).

Problem can be demonstrated in the wxPython demo, change line 335, i.e.

From:

    try:

        self.target_ctl.SetValue(numvalue)

    except:

        type, value, tb = sys.exc_info()

To:

    try:

        self.target_ctl.ChangeValue(numvalue)

    except:

        type, value, tb = sys.exc_info()

I get a exception “TypeError: object of type ‘float’ has no len()” when

trying to use the combobox "Programmatically set the above value entry

ctrl" and having set the “Fraction width” to e.g. “2” and using one of

the float values.

Proposed correction is to add the following to wx.lib.masked.numctrl.py:

def ChangeValue(self, value):

    """

    Sets the value of the control to the value specified.

    The resulting actual value of the control may be altered to

    conform with the bounds set on the control if limited,

    or colored if not limited but the value is out-of-bounds.

    A ValueError exception will be raised if an invalid value

    is specified.

    """

dbg(‘NumCtrl::ChangeValue(%s)’ % value, indent=1)

    BaseMaskedTextCtrl.ChangeValue( self, self._toGUI(value) )

dbg(indent=0)

If above is o.k. could it be included with the next version? If yes,

should I submit a patch or is above fine?

Werner


Message: 4

Date: Thu, 6 Nov 2008 11:53:34 +0100

From: “Vlastimil Brom” vlastimil.brom@gmail.com

Subject: Re: [wxpython-users] AuiManager question

To: wxpython-users@lists.wxwidgets.org

Message-ID:

    <9fdb569a0811060253u53992ad9hd8bf7d2354ad13ca@mail.gmail.com>

Content-Type: text/plain; charset=“iso-8859-1”

2008/11/6 Lionel Liu jingeelio@gmail.com

Hi, all

This is a piece of sample code from aui.py.

My question is that when I run this code, I get a layout like this one,

<[https://mail.google.com/mail/?tf=3D1&ui=3D2&ik=3D=

462a71053d&view=3Datt&th=3D11d7108b7c624d1a&attid=3D0.1](https://mail.google.com/mail/?tf=3D1&ui=3D2&ik=3D=462a71053d&view=3Datt&th=3D11d7108b7c624d1a&attid=3D0.1)>,

but I need it like this, <[https://mail.google.com/ma=

il/?tf=3D1&ui=3D2&ik=3D462a71053d&view=3Datt&th=3D11d7108b7c624d1a&attid=3D=](https://mail.google.com/ma=il/?tf=3D1&ui=3D2&ik=3D462a71053d&view=3Datt&th=3D11d7108b7c624d1a&attid=3D=)

0.2>.

Thanks & Best Regards,


Roy Liu

Email: Jingeelio@yahoo.com.cn

   Jingeelio@gmail.com

wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Hi,

I think, in this simple case using the following instead of the original

lines for adding the panes should do the trick:

self._mgr.AddPane(text1,

wx.aui.AuiPaneInfo().Left().Layer(1).Caption(u"Pane Number One"))

self._mgr.AddPane(text2,

wx.aui.AuiPaneInfo().Bottom().Layer(0).Caption(u"Pane Number Two"))

However, as there seem to be experts in AUI online, I’d like to ask a

related question regarding AuiManager:

Is it possible to set the dimensions of the docked panes (using

AuiPaneInfo() or otherwise - preferably, relative to size of the application

window?

Basically, I have a rather complex layout of panes in multiple columns and

their rows and I’d like to allmost hide the CenterPane filling the available

space with remaining panes.

It seemed to me, that the size… functions in AuiPaneInfo() all deal with

undocked panes, is it true?

Is there a way to set the columns to say 15, 1, 15, 15, 39 % of the

available width, then to divide the given column vertically in panes, e.g.

60, 30, 10 % of the height?

(I know, one can load the previously saved perspectives from a string, but

this isn’t usable for different monitor dimensions etc.)

Any help or hints would be much appreciated!

Thanks,

Vlasta

-------------- next part --------------

An HTML attachment was scrubbed…

URL: [http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200811=

06/7c1438f0/attachment-0001.htm](http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200811=06/7c1438f0/attachment-0001.htm)


Message: 5

Date: Thu, 06 Nov 2008 13:46:23 +0100

From: nulla.epistola@web.de

Subject: Re: [wxpython-users] wxPython crash on Gentoo

To: wxpython-users@lists.wxwidgets.org

Message-ID: 1577755787@web.de

Content-Type: text/plain; charset=iso-8859-15

-----Ursprüngliche Nachricht-----

Von: “Robin Dunn” robin@alldunn.com

nulla.epistola@web.de wrote:

I think I might wait. But the funny thing is that even with wxPython

2.8.8.0 or 2.8.7.? this works without crashing on Xubuntu and on Suse

11.0 (tried with a LiveCD). And the Dabo developers can’t reproduce

the problem. That’s why I put all that version and use flag info into

my first post: I really think it’s my installation. Could it be that

I need a newer GCC version or something like that?

Possibly. There does appear to be some compiler specific situation here

as on Windows I was only able to duplicate it on the Py 2.6 version

which uses the MSVC 9 compiler, but not on 2.5 which uses the MSVC 7.1

compiler.

That’s interesting. Do I understand correctly: what you could duplicate on Windows with the new Python using the newer compiler, but not on the older configuration, was the crash? Very ugly!

For my Dabo dGrid problem I got a workaround, so that’s ok for now. I’m thinking of changing distributions anyway, Gentoo takes much time.

Thank you,

Sibylle

Keine Signatur


Psssst! Schon vom neuen WEB.DE MultiMessenger gehört?

Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123


Message: 6

Date: Thu, 6 Nov 2008 23:19:48 +0800

From: “jason zhang” jason.gnu@gmail.com

Subject: [wxpython-users] start work thread right after app mainloop

    start

To: wxpython-users@lists.wxwidgets.org

Message-ID:

    <eb4c052c0811060719p7c56c1d6s15861264b11e4924@mail.gmail.com>

Content-Type: text/plain; charset=“iso-8859-1”

hi,

how can I create and start my work thread right after the gui main loop

started(when frame/main window shown). I need to start my work thread after

mainloop started because I need the value of the main window’s ID(got from

my_win.GetHandle() ) to initial/create the work thread instance, if I create

the workthread before the main_window shown, I’ll get the wrong value.

Best Regards,

Kevin

-------------- next part --------------

An HTML attachment was scrubbed…

URL: [http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200811=

06/c85ff642/attachment-0001.htm](http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200811=06/c85ff642/attachment-0001.htm)


Message: 7

Date: Thu, 6 Nov 2008 23:50:50 +0800

From: “jason zhang” jason.gnu@gmail.com

Subject: [wxpython-users] Re: start work thread right after app

    mainloop        start

To: wxpython-users@lists.wxwidgets.org

Message-ID:

    <eb4c052c0811060750k15b36fb7h368cf8944e5db391@mail.gmail.com>

Content-Type: text/plain; charset=“iso-8859-1”

found the wx.CallAfter

On Thu, Nov 6, 2008 at 11:19 PM, jason zhang jason.gnu@gmail.com wrote:

hi,

how can I create and start my work thread right after the gui main loop

started(when frame/main window shown). I need to start my work thread aft=

er

mainloop started because I need the value of the main window’s ID(got from

my_win.GetHandle() ) to initial/create the work thread instance, if I cre=

ate

the workthread before the main_window shown, I’ll get the wrong value.

Best Regards,

Kevin

-------------- next part --------------

An HTML attachment was scrubbed…

URL: [http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200811=

06/6a17aa32/attachment.htm](http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200811=06/6a17aa32/attachment.htm)



wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

End of wxpython-users Digest, Vol 9, Issue 24



Thanks & Best Regards,


Roy Liu
Moblie: 86-13959223936
MSN: Jingeelio@msn.com

Email: Jingeelio@yahoo.com.cn
Jingeelio@gmail.com