[Tutor] gui menu
ALAN GAULD
alan.gauld at btinternet.com
Sun Jun 7 23:48:55 CEST 2009
Forwarding to group.
Please use Reply All when responding to the tutor group.
Thanks for the extra information it is helpful.
From: Essah Mitges <e_mitges at hotmail.com>
To: alan.gauld at btinternet.com
Sent: Sunday, 7 June, 2009 10:32:27 PM
Subject: RE: [Tutor] gui menu
http://osdir.com/ml/python.pygame/2002-11/msg00051.html
I'm using this to try to program the buttons I'm tying to make 4 class to make a module called but.py
When i tryed putting a quit button on the menu the error
Traceback (most recent call last):
File "C:\Users\John Doe\Desktop\WODDS2\data\back.py", line 17, in <module>
qbut = QButton(175,67,"Quit.png")
File "C:\Users\John Doe\Desktop\WODDS2\data\but.py", line 102, in __init__
self.insideimg = pygame.image.load(imagefile).convert_alpha()
error: No video mode has been set
The thing is that I can't start my Team.py from this menu and once it is started I want the menu to exit
I can't start a new window if another button is pressed and have esc as the exit key
I can't make the button that displays a read only text file
> To: tutor at python.org
> From: alan.gauld at btinternet.com
> Date: Sun, 7 Jun 2009 22:24:15 +0100
> Subject: Re: [Tutor] gui menu
>
> "Essah Mitges" <e_mitges at hotmail.com> wrote
>
>> import sys, pygame
>> pygame.init()
>> background = pygame.image.load(""My png image 800x 532)
>> backgroundRect = background.get_rect()
>> size = (width, height) = background.get.size()
>> screen = pygame.display.set_mode(size)
>> screen.blit(background, backgroundRect)
>> pygame.display.flip()
>> I want to use pygame to create 4 buttons from 175x67 png image
>
> I dont know what you are using for email but it seems to be
> scrambling your messages. I assume what you want is:
>
>> one button that initiates the Team.py file
>> one button that links to read a hs.txt
>> one button that initiates 800x532 png image in a new window
>> one button that quits pygame window
>
> Now, I'm no expert on pygame but can you tell us more
> specifically what you are finding so hard about putting
> your 4 buttons on the image?
>
> It is creating the button objects or is it linking them to the functions?
> Or is it displaying them using the image?
>
> The more specific your question the more likely that someone
> will answer it.
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
________________________________
Windows Live helps you keep up with all your friends, in one place.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090607/96ded95e/attachment-0001.htm>
More information about the Tutor
mailing list