Looking at the wiki I read a couple of fairly old articles on using XRCed
to separate widgets from UI logic and want to take a stab at learning how to
use XRC for a new application I need to develop.
Installed here are Python2-2.7.14, Python3-3.6.4, wxPython-3.0.2.0, and
wxPython-4.0.1. When I look for XRCed I find it only in
/usr//lib/python2.7/site-packages/wx-3.0-gtk2/wx/tools/ and not in the
python3/site-packages/ directory. Perhaps I'm not looking for it in the
correct location.
Pointers to an XRCed version for Python3 and wxPython-4.x will help.
Some more research taught me that there is a /usr/bin/wxdemo installed
here. Running that produces this:
$ wxdemo
sys.version_info(major=3, minor=6, micro=4, releaselevel='final', serial=0) 3.6.4 (default, Dec 21 2017, 07:29:51) [GCC 5.3.0] ['/usr/bin/wxdemo']
Launch Demo for wxPython V4.0.1
Looking for wxPython-demo-4.0.1 at /home/rshepard/.wxPython
Looking for cached /home/rshepard/.wxPython/wxDocsDemoCache/4.0.1/wxPython-demo-4.0.1.tar.gz
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
I also get a prompt box that wxPython-demo-4.0.1 is not installed and
offers to get it for me. I told the dialog to go ahead and install it. The
display indicated that it found wxPython-demo-4.0.1.tar.gz and asked where I
wanted to have it save.
The problem is the downloaded file is empty (0 bytes) so it cannot be
untarred and installed.
Advice needed.
Rich
···
On Mon, 2 Apr 2018, Rich Shepard wrote:
Pointers to an XRCed version for Python3 and wxPython-4.x will help.
Installed here are Python2-2.7.14, Python3-3.6.4, wxPython-3.0.2.0, and
wxPython-4.0.1.
Well, remember that each wxPython is tied to one Python. Did you
install wxPython 3 for both Python 2 and Python 3?
When I look for XRCed I find it only in
/usr//lib/python2.7/site-packages/wx-3.0-gtk2/wx/tools/ and not in the
python3/site-packages/ directory.
Do you have a wx directory at all in python3.6/site-packages? If not,
then you haven't installed a Python 3 version.
Pointers to an XRCed version for Python3 and wxPython-4.x will help.
XRCed has not had any significant changes in quite some time. Any
version will work with any wxPython. You might consider whether
wxFormBuilder would be a more productive tool.
···
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Do you have a wx directory at all in python3.6/site-packages? If not,
then you haven't installed a Python 3 version.
/usr/lib/python3.6/site-packages/
XRCed has not had any significant changes in quite some time.
This I learned from my web research. When I try to invoke wxdemo it tells
me it cannot find a version for wxPython-4.0.1 and asks if I want to get it.
I respond, 'yes,' but the downloaded file has 0 bytes.
Any version will work with any wxPython.
Aren't widgets different between the classic and phoenix version?
You might consider whether wxFormBuilder would be a more productive tool.
Could be. I'll look at that. I'm not really happy with wxGlade-0.8.0. I
much prefer text based tools over GUIs but writing xml tags by hand is
painfully boring.
XRCed has not had any significant changes in quite some time.
This I learned from my web research. When I try to invoke wxdemo it tells
me it cannot find a version for wxPython-4.0.1 and asks if I want to
get it.
I respond, 'yes,' but the downloaded file has 0 bytes.
OK, but what does that have to do with XRCed?
Any version will work with any wxPython.
Aren't widgets different between the classic and phoenix version?
Yes, but all XRCed knows is the class name, and those have not changed:
You might consider whether wxFormBuilder would be a more productive
tool.
Could be. I'll look at that. I'm not really happy with wxGlade-0.8.0. I
much prefer text based tools over GUIs but writing xml tags by hand is
painfully boring.
Agreed. The .xrc model seems like a great idea, especially for someone
who is comfortable with the Windows Resource Compiler, but somehow it
doesn't work out that way. To be honest, the work flow that works best
for me is to do the initial layout in wxFormBuilder, generate code
(either C++ or Python), and then modify that code from then on without
using a layout tool.
···
On Tue, 3 Apr 2018, Tim Roberts wrote:
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
XRCed hasn’t been maintained in a long while, and hasn’t been included with wxPython4. There are other tools available that can produce XRC output, which can then be used from Python code. One I’ve played with recently is wxFormBuilder. That and some others are fairly nice, just search and experiment and see what works for you.
···
–
Robin
On Monday, April 2, 2018 at 8:56:36 AM UTC-7, Rich wrote:
Looking at the wiki I read a couple of fairly old articles on using XRCed
to separate widgets from UI logic and want to take a stab at learning how to
use XRC for a new application I need to develop.
Installed here are Python2-2.7.14, Python3-3.6.4, wxPython-3.0.2.0, and
wxPython-4.0.1. When I look for XRCed I find it only in
/usr//lib/python2.7/site-packages/wx-3.0-gtk2/wx/tools/ and not in the
python3/site-packages/ directory. Perhaps I’m not looking for it in the
correct location.
Pointers to an XRCed version for Python3 and wxPython-4.x will help.
The wxdemo and wxdocs scripts were a good idea, but in practice there are so many different networking scenarios it’s probably not worth the effort to get them working everywhere. I expect that I’ll remove them in 4.1. Instead you can just download the demo and docs archives from Index of /wxPython4/extras and unpack them wherever you want them.
···
On Monday, April 2, 2018 at 2:02:12 PM UTC-7, Rich wrote:
On Mon, 2 Apr 2018, Rich Shepard wrote:
Pointers to an XRCed version for Python3 and wxPython-4.x will help.
Some more research taught me that there is a /usr/bin/wxdemo installed
here. Running that produces this:
$ wxdemo
The problem is the downloaded file is empty (0 bytes) so it cannot be
Thanks very much. Will you take a couple of minutes and put this
information on the wiki?
Best regards,
Rich
···
On Tue, 3 Apr 2018, Robin Dunn wrote:
The wxdemo and wxdocs scripts were a good idea, but in practice there are
so many different networking scenarios it's probably not worth the effort
to get them working everywhere. I expect that I'll remove them in 4.1.
Instead you can just download the demo and docs archives from Index of /wxPython4/extras and unpack them wherever you
want them.
In the past I've written the wxPython classes in modules and it's worked
well for me. Reading the old articles in the wiki about XRC made sense
because it's mirroring the separation of parts as seen on static web sites
like mine with html5 describing content and css3 describing appearance. This
approach seems to be in line with the MVC design where writing both
appearance and content in a wxPython class isn't as clean.
Many years ago I looked at Glade but was not happy with it. My brief
excursion looking at the new wxGlade-0.8.0 still leaves me looking for the
details I want to use in my applications. So, I'll install wxFormBuilder and
take it for a test drive, then learn how to integrate the XRC file in the
View portion of the applications.
Best regards,
Rich
···
On Tue, 3 Apr 2018, Robin Dunn wrote:
XRCed hasn't been maintained in a long while, and hasn't been included
with wxPython4. There are other tools available that can produce XRC
output, which can then be used from Python code. One I've played with
recently is wxFormBuilder. That and some others are fairly nice, just
search and experiment and see what works for you.
Agreed. The .xrc model seems like a great idea, especially for someone who
is comfortable with the Windows Resource Compiler, but somehow it doesn't
work out that way. To be honest, the work flow that works best for me is
to do the initial layout in wxFormBuilder, generate code (either C++ or
Python), and then modify that code from then on without using a layout
tool.
I've not used anything Microsoft since early 1997, use emacs extensively
for writing and data munging (along with grep, sed, and awk). I also prefer
the CLI to GUIs (although LyX won me over writing LaTeX in emacs a very long
time ago), so I'll do as you do: initial layout in wxFormBuilder, then edit
either Python or xml in my editor.
Off the mail list since it involves wxFormBuilder, not wxPython itself.
By trial-and-error I've created a project with a main frame, menus, and a
status bar. I've elected to export both Python and XRC and yet both of those
files are 'noname.py' and 'noname.xrc'. I've not found where within
wxFormBuilder I can provide a name for these files. Do you know how to do
this?
Can you point me to some docs for wxFrameBuilder? The help menu has only
an About item and I've not found anything useful in my web searches.
Another question: when I tried to add a tabbed notebook to the main frame
wxFB balked because there was no panel present. In a prior wxPython project
the main module had the notebook as a separate class. Within wxFB, do I
create each class separately (in separate project files), then put them
together with python code in modules that make sense?
TIA,
Rich
···
On Tue, 3 Apr 2018, Tim Roberts wrote:
To be honest, the work flow that works best for me is to do the initial
layout in wxFormBuilder, generate code (either C++ or Python), and then
modify that code from then on without using a layout tool.