Ian Mallett | 1 Aug 2007 01:01
Picon

Re: Select a File...


I think you want the file picker from here:
http://www.imitationpickles.org/pgu/docs/gui.dialog.html

Laura
OK, but "gui.FileDialog()" gives

Traceback (most recent call last):
  File "C:\dev\Python24\Projects\Pygame Programs\Music Player.py", line 19, in ?
    if __name__ == "__main__": main()
  File "C:\dev\Python24\Projects\Pygame Programs\Music Player.py", line 12, in main
    gui.FileDialog()
  File "C:\dev\Python24\Lib\site-packages\pgu\gui\dialog.py", line 82, in __init__
    self.dir_img = basic.Image(app.App.app.theme.get(cls1+'.folder', '', 'image'))
AttributeError: class App has no attribute 'app'


Luke Paireepinart | 1 Aug 2007 05:13
Picon
Gravatar

Re: Select a File...

Ian Mallett wrote:
>
>     I think you want the file picker from here:
>     http://www.imitationpickles.org/pgu/docs/gui.dialog.html
>
>     Laura
>
> OK, but "gui.FileDialog()" gives
>
> Traceback (most recent call last):
>   File "C:\dev\Python24\Projects\Pygame Programs\Music Player.py", 
> line 19, in ?
>     if __name__ == "__main__": main()
>   File "C:\dev\Python24\Projects\Pygame Programs\Music Player.py", 
> line 12, in main
>     gui.FileDialog()
>   File "C:\dev\Python24\Lib\site-packages\pgu\gui\dialog.py", line 82, 
> in __init__
>     self.dir_img = basic.Image(app.App.app.theme.get(cls1+'.folder', 
> '', 'image'))
> AttributeError: class App has no attribute 'app'
>
That's a link to docs about Phil Hassey's PyGameUtilities (PGU)
It's a GUI you use through pygame, but it's an external package (You 
have to download/install it, but you could
include it with your game/program assuming the license allows that.)

Ian Mallett | 1 Aug 2007 06:16
Picon

Re: Select a File...

On 7/31/07, Luke Paireepinart <rabidpoobear-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:


That's a link to docs about Phil Hassey's PyGameUtilities (PGU)
It's a GUI you use through pygame, but it's an external package (You
have to download/install it, but you could
include it with your game/program assuming the license allows that.)

I've installed it.  "from pgu import *" passes, but "pgu.FileDialog()" then crashes with "pgu is not defined"!
René Dudfield | 1 Aug 2007 06:29
Picon
Gravatar

Re: Select a File...

Maybe try using
import pgu

Does the example work?

On 8/1/07, Ian Mallett <geometrian@...> wrote:
> On 7/31/07, Luke Paireepinart <rabidpoobear@...> wrote:
> >
> > That's a link to docs about Phil Hassey's PyGameUtilities (PGU)
> > It's a GUI you use through pygame, but it's an external package (You
> > have to download/install it, but you could
> > include it with your game/program assuming the license allows that.)
> >
>
> I've installed it.  "from pgu import *" passes, but "pgu.FileDialog()" then
> crashes with "pgu is not defined"!
>

Ian Mallett | 1 Aug 2007 06:34
Picon

Re: Select a File...

"import pgu" works.  I'll look into example functionality.

Ian Mallett | 1 Aug 2007 06:40
Picon

Re: Select a File...

Tutorial 1 work in python shell.  The magic line appears to be "from pgu import gui"

Ian Mallett | 1 Aug 2007 06:54
René Dudfield | 1 Aug 2007 07:19
Picon
Gravatar

Re: Select a File...

Hi,

check out the examples directory that comes with the download pgu download.

You need an App class.

Kind of like this...

from pgu import gui
app = gui.App()
e = gui.Button("Hello World")
app.run(e)

Check out the examples/gui*.py files for more.

Cheers,

On 8/1/07, Ian Mallett <geometrian@...> wrote:
> title = gui.Label("My Title")
> main = gui.Container()
> #add stuff to the container...
>
> d = gui.FileDialog(title,main)
> d.open()
>
>
> ...doesn't crash, but I don't see anything, just a print: "gui.widget:
> creating an App"
>
>

René Dudfield | 1 Aug 2007 07:20
Picon
Gravatar

Re: Select a File...

This example shows you how to use the file dialog.

examples/gui12.py

cheers,

On 8/1/07, René Dudfield <renesd@...> wrote:
> Hi,
>
> check out the examples directory that comes with the download pgu download.
>
> You need an App class.
>
> Kind of like this...
>
> from pgu import gui
> app = gui.App()
> e = gui.Button("Hello World")
> app.run(e)
>
>
> Check out the examples/gui*.py files for more.
>
>
> Cheers,
>
>
> On 8/1/07, Ian Mallett <geometrian@...> wrote:
> > title = gui.Label("My Title")
> > main = gui.Container()
> > #add stuff to the container...
> >
> > d = gui.FileDialog(title,main)
> > d.open()
> >
> >
> > ...doesn't crash, but I don't see anything, just a print: "gui.widget:
> > creating an App"
> >
> >
>

Ian Mallett | 1 Aug 2007 07:29
Picon

Re: Select a File...

Excellent.  That's perfect!  My thanks!
Ian

On 7/31/07, René Dudfield <renesd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
This example shows you how to use the file dialog.

examples/gui12.py

cheers,

On 8/1/07, René Dudfield <renesd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> check out the examples directory that comes with the download pgu download.
>
> You need an App class.
>
> Kind of like this...
>
> from pgu import gui
> app = gui.App()
> e = gui.Button("Hello World")
> app.run(e)
>
>
> Check out the examples/gui*.py files for more.
>
>
> Cheers,
>
>
> On 8/1/07, Ian Mallett <geometrian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > title = gui.Label("My Title")
> > main = gui.Container()
> > #add stuff to the container...
> >
> > d = gui.FileDialog(title,main)
> > d.open()
> >
> >
> > ...doesn't crash, but I don't see anything, just a print: " gui.widget:
> > creating an App"
> >
> >
>


Gmane