[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame.error: video system not initialized



On 5/22/10, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> Hi DROID (and Alex),
>
>
> DR0ID wrote:
>> Hi Lenard
>>
>> I figured out that you were deliberately vague,
> Ok, I misunderstood.
>> but I thought that he might use some more specific help based on his
>> response ("Well, it was not doing anything anyway, so I commented it
>> out. The
>> error is now gone"). This looked for me as he didn't find the real
>> problem (which is the combination of lines 38, 40 and 68, as you state
>> in the latest emails).
>>
> Yes,  Alex accidentally created a second if statement when adding cursor
> control to his program. Merging the two if's in checkForHotkey solves
> the problem. Oh, and Alex,  it is best to nitialize a global flag like
> "running" only once in a program -- assign True to it only at startup.
> Then when it is set False you know it will stay False.
Good point, but in looking at my first-ever attempt at Pygame (last
year) I realized I use a simple "while 1" loop, so that global is
gone. In future, though, you are right.
>
>> For the ctrl-arrow problem: on win systems the ctrl-arrow causes the
>> cursor to move from word to word in a text editor (instead from
>> character to charachter). This is probably a special event send on the
>> windows message queue which pygame does not handle as far as I know.
>>
> I tried in on Windows; no problem. Word movement would be handled by the
> editor, not the OS anyway. ctrl-arrow does the same thing in Thunderbird
> under Linux. So it is merely a convention (and one I was unaware of.
> Thanks).
When you run the program, and press ctrl-right as soon as the window
loads, what happens? That is, what does the caption say? What about
ctrl-shift-d? Or are you running a test program you wrote, not my
code? I ask because, even when I turn off my screen reader (which I
thought might be catching the keypress before pygame) I am not moved
around like I should be. Pressing ctrl-right should display "A 21",
since ctrl-arrow moves you to the edge of the board in the direction
of the arrow. Thanks.
>
> Lenard
>
-- 
Have a great day,
Alex (msg sent from GMail website)
mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap