[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Pygame w/ GUI

PatrickMinnesota

1/10/2008 2:10:00 AM

I know this isn't strictly a Python question, but I'm betting some
here might be able to give me a hint.

I have a few graphical programs doing some 2D data visualization using
simple Pygame code for pseudo real-time animation. It's running
under windows XP right now, but eventually it'll need to be cross-
platform. As it is right now, it probably is, I just haven't tried it
anywhere but XP.

Now I want to wrap some simple GUI functions around it. I'm looking
for some buttons, a text field or two and file system selection of
data files. I figure many have done this and there is a better
solution than to use Pygame constructs to implement such things.

My question: I'm not seeing much support in Pygame for that stuff.
It seems I should build buttons and file browsing in some other
toolkit. Is that true? Or am I just to early on in the Pygame docs
to see solutions?

If I should use something else, am I going to be able to use Tkinter
or WxPython in conjunction with my Pygame code? Or is there something
else I should be looking at?

Oh, and I'm running Python 2.5.1

Thanks for any thoughts.
3 Answers

Adonis Vargas

1/10/2008 2:46:00 AM

0

PatrickMinnesota wrote:
> I know this isn't strictly a Python question, but I'm betting some
> here might be able to give me a hint.
>
> I have a few graphical programs doing some 2D data visualization using
> simple Pygame code for pseudo real-time animation. It's running
> under windows XP right now, but eventually it'll need to be cross-
> platform. As it is right now, it probably is, I just haven't tried it
> anywhere but XP.
>
> Now I want to wrap some simple GUI functions around it. I'm looking
> for some buttons, a text field or two and file system selection of
> data files. I figure many have done this and there is a better
> solution than to use Pygame constructs to implement such things.
>
> My question: I'm not seeing much support in Pygame for that stuff.
> It seems I should build buttons and file browsing in some other
> toolkit. Is that true? Or am I just to early on in the Pygame docs
> to see solutions?
>
> If I should use something else, am I going to be able to use Tkinter
> or WxPython in conjunction with my Pygame code? Or is there something
> else I should be looking at?
>
> Oh, and I'm running Python 2.5.1
>
> Thanks for any thoughts.

I do not have experience using pygame, but you can look at:

http://pyui.source...

Creates an user interface with pygame as a possible back end.

Hope this helps.

Adonis

Carl Banks

1/10/2008 3:50:00 AM

0

On Wed, 09 Jan 2008 18:10:03 -0800, PatrickMinnesota wrote:

> I know this isn't strictly a Python question, but I'm betting some here
> might be able to give me a hint.
>
> I have a few graphical programs doing some 2D data visualization using
> simple Pygame code for pseudo real-time animation. It's running under
> windows XP right now, but eventually it'll need to be cross- platform.
> As it is right now, it probably is, I just haven't tried it anywhere but
> XP.
>
> Now I want to wrap some simple GUI functions around it. I'm looking for
> some buttons, a text field or two and file system selection of data
> files. I figure many have done this and there is a better solution than
> to use Pygame constructs to implement such things.
>
> My question: I'm not seeing much support in Pygame for that stuff. It
> seems I should build buttons and file browsing in some other toolkit.
> Is that true? Or am I just to early on in the Pygame docs to see
> solutions?

I've used pgu once and it worked ok. pgu is a PyGame utility kit which
includes a GUI interface; pretty good tutorial on the site, too.


> If I should use something else, am I going to be able to use Tkinter or
> WxPython in conjunction with my Pygame code? Or is there something else
> I should be looking at?

Not recommended, though some have done it. SDL (which PyGame is based
upon) likes to control the event loop, same as most GUIs do. Plus it's
not straightforward to integrate the SDL window into the widget systems.


Carl Banks

Jacob Skaria

2/3/2010 5:46:00 AM

0

If the path is same as the active workbook path then change the code to

Workbooks.Open (ActiveWorkbook.Path & "\Master Engineering Spec.xlsm")

--
Jacob


"Brian" wrote:

> The path is a varible. So I can not specify the full path. it worked before I
> moved it to a module.
>
> "Jacob Skaria" wrote:
>
> > Try with the full path of the workbook instead
> >
> > Workbooks.Open ("c:\Master Engineering Spec.xlsm")
> >
> > --
> > Jacob
> >
> >
> > "Brian" wrote:
> >
> > > For some reason this code does not open the Workbook. It worked when it was
> > > in the Userform Code window. What did I do wrong?
> > >
> > > '*******************************************************
> > > 'Open New Engineer Spec 8 Control Button
> > > 'Located in M2_Open_New_Workbook
> > > '*******************************************************
> > > Private Sub Open_New_Engineer_Spec_8_Click()
> > > Call Open_New_Engineer_Spec
> > > End Sub
> > >
> > >
> > > Declarations
> > > -------------------------
> > > Dim myMsg As String
> > >
> > >
> > >
> > > Module Code
> > > ----------------------------------------------------------
> > > 'Open New Master Engineering Spec Control Button
> > > Sub Open_New_Engineer_Spec()
> > >
> > > On Error Resume Next
> > >
> > > Workbooks.Open ("Master Engineering Spec.xlsm")
> > >
> > > If Err.Number <> 0 Then
> > >
> > > MsgBox prompt:=UserForm1.Engineer_2.Value & vbLf & "Your Open Method
> > > Failed, No Engineering Spec was Opened", _
> > > Title:="C.E.S."
> > >
> > > MsgBox "The Open Method Failed, Engineering Spec was not Opened", ,
> > > "C.E.S."
> > >
> > > End If
> > >
> > > End Sub