On Thu, Jun 5, 2008 at 10:57 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Wow, so uh, I was duplicating a lot of work there. You rock. I don't
> know how I managed to miss that.
>
> You don't need to explain, but I am idly wondering why Caret is a
> separate class, since text fields can never have more than one. You
> may as well have just put in an "editable" flag and some caret-moving
> methods. But it's really not important, since I just wrote my own
> class that does just that.
Separation of concerns... the IncrementalTextLayout class is
complicated enough for me to work on, without the additional state
involved in maintaining a caret. I also envisioned moving a caret
from one layout to another (i.e., when switching keyboard focus)...
I'm not sure if this is actually possible or useful though (in my GUI
code I attach a caret to each layout and show/hide them as required,
and redispatch events).
>
> While I'm here, I may as well ask another minor question that probably
> doesn't warrant its own new thread - is there any way to make the text
> classes handle large strings better, or do something better myself? I
> just loaded the entire script of _Buckaroo Banzai: Across the 8th
> Dimension_ in, and things got really slow, especially text insertion.
Assuming you're using IncrementalTextLayout, that's as fast as it's
going to get. I think some fairly significant work would be required
to improve on that, which in my mind is not worth it at this stage.
Let me know if you have specific ideas or patches to improve things.
>
> I just tried one more thing before submitting this - I was using the
> text insertion features of the document class to load a file, but I
> just switched to using pyglet.text.load(), and I keep getting the same
> error with it:
> "TypeError: _uninit_document() takes exactly 1 argument (2 given)
> module body in [my file].py at line 19
> function _set_document in untitled at line 792"
>
> The offending line:
> window.text_layout_and_caret_wrapper.my_layout.document =
> pyglet.text.load('Buckaroo Banzai.txt')
Looks like you're working off an old version; SVN head doesn't have
this problem.
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
-~----------~----~----~----~------~----~------~--~---