[wxPython-users] is there an example of a "widget" that reads a
file onto it?
D. Scott Katzer
grunculus at gmail.com
Sun Mar 2 13:40:36 PST 2008
Hi Gary and All
On Sun, Mar 2, 2008 at 4:23 PM, Gary Kline <kline at thought.org> wrote:
>
> > Have you seen the ticker in the demo? Sounds like that might do it for
> > scrolling text. It uses a textCtrl. You can just read a text file in the
> > normal Python way, and set what text you want as the value of the textCtrl,
> > and use that textCtrl in the ticker.
>
>
> I think I saw that, "textCtrl," but nothing about ticker.
> I'm not clear on how to use the wxPython pages, so yes, I
> may be jumping the gun here. I typed "text" into the search
> area; then "file", then "file, read".
You sound like you haven't downloaded and installed the wxpython package yet.
Inside the wxpython package is an extensive set of demos, including a
GUI file picker. Once you have picked a file, you can use python to
read the contents in, and then use a TextCtrl (careful about the
capitalization - it can be significant) to display it as you wish.
Take a look at the "Ticker" demo in the "More Windows/Controls"
section of the Demo.
You can get the wxpython package for your OS of choice here:
http://www.wxpython.org/download.php
Note that you want a version of wxpython that matches your installed
version of python.
Once you've been through the relevant wxpython demos, post a small bit
of code to illustrate your problem.
HTH a bit!
Cheers,
Scott.
More information about the wxpython-users
mailing list