Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Explicit event to redraw a window
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nathan  
View profile  
 More options Jul 23 2012, 1:03 pm
From: Nathan <nathan.sto...@gmail.com>
Date: Mon, 23 Jul 2012 11:03:53 -0600
Local: Mon, Jul 23 2012 1:03 pm
Subject: Re: Explicit event to redraw a window

On Mon, Jul 23, 2012 at 10:53 AM, anatoly techtonik <techto...@gmail.com> wrote:
> On Mon, Jul 23, 2012 at 7:27 PM, Nathan <nathan.sto...@gmail.com> wrote:
>> On Mon, Jul 23, 2012 at 4:46 AM, anatoly techtonik <techto...@gmail.com> wrote:
>>> Hi,

>>> What is the correct way to initiate window redraw?

>> If I understand correctly (correct me if I'm wrong, people), every
>> Window's on_draw() function is called once each time the event "idle"
>> loop runs.

> I've started with Hello World, and on Linux this means its window is
> redrawn only once on startup and then each time a key is pressed.

That doesn't sound right.  Can you post the entire hello world source
code you have?

> http://www.pyglet.org/doc/programming_guide/hello_world.html

>> You could:

>> 1) Call the window's on_draw() method manually if you want it called
>> _more_ often.

> If I place this into on_draw() it will create call stack overflow and
> "Hello, World" will crash.

Well, right, you shouldn't call it from within itself.  It'll just
recurse until it crashes if you do that.  I meant you could call it
from pretty much any other code that happens to be running during a
loop.  But it sounds like there's something wrong with your basic
Hello World example, so I don't think you're looking for this level of
a solution.

>> 2) Override the default idle policy of the event loop by subclassing
>> it if you don't want it called exactly once per window per event loop.
>>  See [a].

>> [a] http://www.pyglet.org/doc/programming_guide/customising_the_event_loo...

> Sounds complicated. It will be enough for me to send some event at the
> end of on_draw to kick the loop again. I don't know how to do this
> properly. Sending keyboard events doesn't sound right.

Right.  Lets get the basic hello world working for you.

~ Nathan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.