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

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



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.

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).

Lenard