On 4/19/08, Nathan <[EMAIL PROTECTED]> wrote:
>
>  On Fri, Apr 18, 2008 at 9:26 PM, Alex Holkner <[EMAIL PROTECTED]> wrote:
>  >  len(log_layout.document.text)
>
>
> I should've guessed.  Anyway, I reverted my changes to layout.py, and
>  changed my code:
>
>
>    def add_event(self, msg):
>
>       prefix = time.strftime(self.format_str)
>
>       self.log_layout.begin_update()
>       for line in msg.split('\n'):
>
>          
> self.log_layout.document.insert_text(len(self.log_layout.document.text),
>
> prefix+line)
>          prefix = ""
>       self.log_layout.end_update()
>
>
> ...but that doesn't change the error!  So would you mind reading a
>  little further now?  :)
>
>
>  Traceback (most recent call last):
>  [snip]
>   File "./monitor", line 188, in update
>     monitor_window.log_window.add_event(info)
>   File "/sm/engine/modules/widgets.py", line 226, in add_event
>
>     self.log_layout.end_update()
>
>   File "/Library/Python/2.5/site-packages/pyglet/text/layout.py", line
>  754, in end_update
>     self._update()
>   File "/Library/Python/2.5/site-packages/pyglet/text/layout.py", line
>  1728, in _update
>     self._update_flow_lines()
>   File "/Library/Python/2.5/site-packages/pyglet/text/layout.py", line
>  1842, in _update_flow_lines
>     invalid_end = self._flow_lines(self.lines, invalid_start, invalid_end)
>   File "/Library/Python/2.5/site-packages/pyglet/text/layout.py", line
>  1273, in _flow_lines
>     y -= leading
>  exceptions.UnboundLocalError: local variable 'leading' referenced
>  before assignment
>

I can't reproduce the error from your description, can you provide a
complete test case?

Alex.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to