new user & some (possibly) old questions

Hello!

After not so successful attempt to use D as the programming language
for our multi-platform desktop application, mainly due to lack of
decent GUI bindings, we're very strongly considering to abandon D and
use Python + Cython +wxPython.

Seeing about Phoenix project and considering that we would like to
start with Python3 code, I'm curious if there is some estimation when
wxPython with its python-3/wx-2.9.x support will be available?

Do you recommend using XRC for GUI in wxpython or generating the code
using something like wxFormBuilder?

We'll also need to generate Cython extensions for our custom code as
well as for some 3rd party C library, so can you recommend some
build/packaging tool for wxpython project?

Personally, I consider Bento...

Sincerely,
Gour

···

--
A person is considered still further advanced when he regards honest
well-wishers, affectionate benefactors, the neutral, mediators, the
envious, friends and enemies, the pious and the sinners all with an
equal mind.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Hi,

Hello!

After not so successful attempt to use D as the programming language
for our multi-platform desktop application, mainly due to lack of
decent GUI bindings, we're very strongly considering to abandon D and
use Python + Cython +wxPython.

Welcome to the only real GUI world :wink:

Seeing about Phoenix project and considering that we would like to
start with Python3 code, I'm curious if there is some estimation when
wxPython with its python-3/wx-2.9.x support will be available?

Phoenix is already operational, and binaries are available for Windows
and Mac, and I believe it can be easily compiled on Linux. The binary
are currently available for Python 2.7 and Python 3.2, but only on 32
bit architectures (on Windows at least, I know nothing of Mac).

That being said, speaking of Windows, it's fairly easy to rebuild the
whole of Phoenix for whatever architecture you have (I use Python 2.7
and Python 3.2, both 64 bit, on Windows 7).

As far as I can see, you can already build fairly complex GUIs with
Phoenix, as most (all?) of the core classes are ported and a couple of
sub-packages (dataview and adv) should be in a fairly advanced state.
However, everything related to wx.lib (i.e., fancy owner-drawn
widgets, mixins, and so on) has yet to be ported, so you may not enjoy
the full power of wxPython if you decide to stick with Python 3 only
(and then again, you must have an *extremely* pressing good reason to
go with Python 3 only - which one, I can't fathom for the life of me).

Do you recommend using XRC for GUI in wxpython or generating the code
using something like wxFormBuilder?

As a matter of personal taste, I would recommend you design your GUIs
by hand-coding them. I always found XRC cumbersome and I only rarely
use wxGlade for the most simple (and yet boring) layouts. But then
again, it is a matter of personal taste. As far as I can tell, none of
the GUI builders supporting wxPython can possibly already support
Python 3, as Phoenix itself is not officially out.

We'll also need to generate Cython extensions for our custom code as
well as for some 3rd party C library, so can you recommend some
build/packaging tool for wxpython project?

That's a relatively broad subject: Cython extensions (as far as I know
and I am no expert) are just another *.pyd file (on Windows, at least)
that you need for your program to work correctly. Tools like py2exe,
PyInstaller and py2app should work relatively well on most
applications (and I threw at them some complex ones, and I don't
remember py2exe or PyInstaller complaining about that).

···

On 7 July 2012 19:30, Gour wrote:

--
Andrea.

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

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

Welcome to the only real GUI world :wink:

:slight_smile:

Phoenix is already operational, and binaries are available for Windows
and Mac, and I believe it can be easily compiled on Linux. The binary
are currently available for Python 2.7 and Python 3.2, but only on 32
bit architectures (on Windows at least, I know nothing of Mac).

OK. I'm interested for x86_64 Linux.

As far as I can see, you can already build fairly complex GUIs with
Phoenix, as most (all?) of the core classes are ported and a couple of
sub-packages (dataview and adv) should be in a fairly advanced state.

Very nice.

However, everything related to wx.lib (i.e., fancy owner-drawn
widgets, mixins, and so on) has yet to be ported, so you may not enjoy
the full power of wxPython if you decide to stick with Python 3 only
(and then again, you must have an *extremely* pressing good reason to
go with Python 3 only - which one, I can't fathom for the life of me).

I believe that all the libs we require (gui, sqlite3...) are available
in Python3 and considering we're starting our app from the scratch, by
using Python3 we might avoid later conversion which is, anyway,
inevitable.

I always found XRC cumbersome and I only rarely use wxGlade for the
most simple (and yet boring) layouts.

Hmm...

But then again, it is a matter of personal taste. As far as I can
tell, none of the GUI builders supporting wxPython can possibly
already support Python 3, as Phoenix itself is not officially out.

I understand about support for Python 3, but hopefully they will catch
on.

Now I've to investigate which ones support generation of Python or will
ask about it...

That's a relatively broad subject: Cython extensions (as far as I know
and I am no expert) are just another *.pyd file (on Windows, at least)
that you need for your program to work correctly. Tools like py2exe,
PyInstaller and py2app should work relatively well on most
applications (and I threw at them some complex ones, and I don't
remember py2exe or PyInstaller complaining about that).

OK. Deploying is certainly specific project...I'll investigate about
Bentoo and the above-mentioned applications creating stand-alone
executables.

Sincerely,
Gour

···

On Sat, 7 Jul 2012 21:49:30 +0200 Andrea Gavana <andrea.gavana@gmail.com> wrote:

--
As the embodied soul continuously passes, in this body,
from boyhood to youth to old age, the soul similarly passes
into another body at death. A sober person is not bewildered
by such a change.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Do you recommend using XRC for GUI in wxpython or generating the code
using something like wxFormBuilder?

As a matter of personal taste, I would recommend you design your GUIs
by hand-coding them.

I agree -- though one thing about hand-coding is that done right, you
don't hard-code much -- certainly not widget positions, rather, you
use Sizers to layout, and dynamically build quite a bit -- this is the
real advantage over GUI layout tools.

As far as I can tell, none of
the GUI builders supporting wxPython can possibly already support
Python 3, as Phoenix itself is not officially out.

well, XRC is generating XML, which the C++ wx reads, so it should work
with py3k and Phoenix, in theory.

We'll also need to generate Cython extensions for our custom code as
well as for some 3rd party C library, so can you recommend some
build/packaging tool for wxpython project?

building your Cython is independent form wxPython -- chances are you
don't need to build wxPython, or if you do, not re-build often.

plain old distutils does pretty well for building Cython code.

Welcome to wxPython!

-Chris

···

On Sat, Jul 7, 2012 at 12:49 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

--

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

Chris.Barker@noaa.gov

In GNUmed we (nearly) ONLY use a GUI builder (wxGlade, in
case it matters) -- but we've never done any absolute
positioning with it. We've always used sizers.

Maybe you were referring to some other distinction ?

Karsten

···

On Mon, Jul 09, 2012 at 10:53:43AM -0700, Chris Barker wrote:

On Sat, Jul 7, 2012 at 12:49 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

>> Do you recommend using XRC for GUI in wxpython or generating the code
>> using something like wxFormBuilder?
>
> As a matter of personal taste, I would recommend you design your GUIs
> by hand-coding them.

I agree -- though one thing about hand-coding is that done right, you
don't hard-code much -- certainly not widget positions, rather, you
use Sizers to layout, and dynamically build quite a bit -- this is the
real advantage over GUI layout tools.

--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

I guess Chris was referring to dynamically building a GUI layout,
especially when arrays of buttons/checkboxes/whatever are involved.
This gets tricky to do when using a GUI builder. But then again, I use
wxGlade myself as well, mostly to help me out with visual clues when
the layout is particularly boring or very deep.

My opinion is that both approaches should be combined, and you switch
from one to the other depending on the layout you are building.
Automatic GUI builders are hopelessly dumb when it comes to
dynamically constructed layouts, but can be invaluable otherwise.

The XRC point is moot, though. There is no wx.xrc in Phoenix yet. So
there is no GUI builder supporting wxPython Phoenix with Python 3.

Andrea.

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

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 9 July 2012 20:01, Karsten Hilbert wrote:

On Mon, Jul 09, 2012 at 10:53:43AM -0700, Chris Barker wrote:

On Sat, Jul 7, 2012 at 12:49 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:

>> Do you recommend using XRC for GUI in wxpython or generating the code
>> using something like wxFormBuilder?
>
> As a matter of personal taste, I would recommend you design your GUIs
> by hand-coding them.

I agree -- though one thing about hand-coding is that done right, you
don't hard-code much -- certainly not widget positions, rather, you
use Sizers to layout, and dynamically build quite a bit -- this is the
real advantage over GUI layout tools.

In GNUmed we (nearly) ONLY use a GUI builder (wxGlade, in
case it matters) -- but we've never done any absolute
positioning with it. We've always used sizers.

Maybe you were referring to some other distinction ?

Could not have said it any better and that's how we do it.

Karsten

···

On Mon, Jul 09, 2012 at 08:13:12PM +0200, Andrea Gavana wrote:

I guess Chris was referring to dynamically building a GUI layout,
especially when arrays of buttons/checkboxes/whatever are involved.
This gets tricky to do when using a GUI builder. But then again, I use
wxGlade myself as well, mostly to help me out with visual clues when
the layout is particularly boring or very deep.

My opinion is that both approaches should be combined, and you switch
from one to the other depending on the layout you are building.
Automatic GUI builders are hopelessly dumb when it comes to
dynamically constructed layouts, but can be invaluable otherwise.

--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

I agree -- though one thing about hand-coding is that done right, you
don't hard-code much -- certainly not widget positions, rather, you
use Sizers to layout, and dynamically build quite a bit -- this is the
real advantage over GUI layout tools.

Hmm...GUI layout tools cannot use sizers?

I do not want to underestimated need to know doing layout by hand, but I
still believe that good GUI can save time and help, especially in the
beginning.

plain old distutils does pretty well for building Cython code.

I read that Scientific community had lot of trouble using distutils.

Moreover, we'd have to include some 3rd party C library, build some
Cython extensions, generate nice docs etc., so I believe we'll use
waf (Bento).

Welcome to wxPython!

Thanks a lot!!

Sincerely,
Gour

···

On Mon, 9 Jul 2012 10:53:43 -0700 Chris Barker <chris.barker@noaa.gov> wrote:

--
He who is satisfied with gain which comes of its own accord, who
is free from duality and does not envy, who is steady in both
success and failure, is never entangled, although performing actions.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Hello Karsten,

isn't it interesting that after tinkering for quite some time with
GNUmed, suggesting all kinds of tools/languages etc., I'm ending up with
(wx)Python and even started using Git. :wink:

It must be due to your kindness that I've finally comme to my senses
understanding what are real productivity tools. :slight_smile:

Thank you!

In GNUmed we (nearly) ONLY use a GUI builder (wxGlade, in
case it matters) -- but we've never done any absolute
positioning with it. We've always used sizers.

That's what my (small) experience playing with DialogBlocks showed me as
well...

Sincerely,
Gour

···

On Mon, 9 Jul 2012 20:01:18 +0200 Karsten Hilbert <Karsten.Hilbert@gmx.net> wrote:

--
Even the intelligent are bewildered in determining what is action
and what is inaction. Now I shall explain to you what action is,
knowing which you shall be liberated from all misfortune.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

And at the and it's better to deal with the native code than loading
XRC, right?

Sincerely,
Gour

···

On Mon, 9 Jul 2012 20:13:12 +0200 Andrea Gavana <andrea.gavana@gmail.com> wrote:

My opinion is that both approaches should be combined, and you switch
from one to the other depending on the layout you are building.

--
One who is not disturbed in mind even amidst the threefold
miseries or elated when there is happiness, and who is free
from attachment, fear and anger, is called a sage of steady mind.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

This is just my personal preference, there are others who enjoy using
XRC. I like having all my code (whether GUI-related or not) in a
Python-readable form, not in XML.

On the GUI-builders side, of course wxGlade, Boa and almost all the
others can (and do) use sizers to position and size the various
widgets. None of the GUI-builders I know of use absolute/brute force
positioning anymore.

···

On 9 July 2012 21:36, Gour wrote:

On Mon, 9 Jul 2012 20:13:12 +0200 > Andrea Gavana <andrea.gavana@gmail.com> wrote:

My opinion is that both approaches should be combined, and you switch
from one to the other depending on the layout you are building.

And at the and it's better to deal with the native code than loading
XRC, right?

--
Andrea.

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

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

You are welcome.

Regardless of whether I truly played any role in it - I wish
you success in your endeavour(s).

Karsten

···

On Mon, Jul 09, 2012 at 09:34:02PM +0200, Gour wrote:

Hello Karsten,

isn't it interesting that after tinkering for quite some time with
GNUmed, suggesting all kinds of tools/languages etc., I'm ending up with
(wx)Python and even started using Git. :wink:

It must be due to your kindness that I've finally comme to my senses
understanding what are real productivity tools. :slight_smile:

Thank you!

--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Sorry -- not what I intended to say -- I was comparing hand codidng to
what I thought might be one's impression of the nightmare of
hand-coding -- not really to GUI layout tools...

But they dynamic -- data-driven GUI building is a real advantage of hand-coding.

Also -- much easier to use custom classes with hand-coding -- None of
the GUI layout tools I've played with over the years have worked well
for this (though I did give up a couple years back -- so maybe some of
them handle it well now)

-Chris

···

On Mon, Jul 9, 2012 at 12:30 PM, Gour <gour@atmarama.net> wrote:

On Mon, 9 Jul 2012 10:53:43 -0700 > Chris Barker <chris.barker@noaa.gov> wrote:

I agree -- though one thing about hand-coding is that done right, you
don't hard-code much -- certainly not widget positions, rather, you
use Sizers to layout, and dynamically build quite a bit -- this is the
real advantage over GUI layout tools.

Hmm...GUI layout tools cannot use sizers?

--

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

Chris.Barker@noaa.gov

Well, I’m just starting on wxPython, and I even have a lot of newbie questions in another thread. Yet I’ve so far found out the best combination for me is using a wysiwyg with code generation, plus pure code.

I use the wysiwyg for a way to kickstart my learning of wxPython widgets and sizers (I’m using wxFormBuilder which supports sizers), but I end up prefering code as it is more maleable and versatile when trying to modify/hook things by hand. So instead of XRC I produce code wich then I move and edit around to reach my goal (wxFormBuilder also comits a few mistakes in the code, I’ve found out. Like setting growable rows/cols in code before they’ve been declared/used which causes GridBagSizer to error out. etc etc), I find both methods combined are the best so far in my very little experince, and the only way to do those for me was code generation, rather than XRC

···

El lunes, 9 de julio de 2012 15:06:03 UTC-4:30, Gour escribió:

On Mon, 9 Jul 2012 20:13:12 +0200 > > Andrea Gavana andrea.gavana@gmail.com wrote:

My opinion is that both approaches should be combined, and you switch

from one to the other depending on the layout you are building.

And at the and it’s better to deal with the native code than loading

XRC, right?

Sincerely,

Gour


One who is not disturbed in mind even amidst the threefold
miseries or elated when there is happiness, and who is free
from attachment, fear and anger, is called a sage of steady mind.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Well, I'm just starting on wxPython, and I even have a lot of newbie
questions in another thread. Yet I've so far found out the best
combination for me is using a wysiwyg with code generation, plus pure
code.

Thanks.

I find both methods combined are the best so far in my very little
experince, and the only way to do those for me was code generation,
rather than XRC

Thank you...I also feel the same. :wink:

Sincerely,
Gour

···

On Tue, 10 Jul 2012 15:08:42 -0700 (PDT) Lars Goldschlager <lars.gold@gmail.com> wrote:

--
Even the intelligent are bewildered in determining what is action
and what is inaction. Now I shall explain to you what action is,
knowing which you shall be liberated from all misfortune.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810