From: Laura Creighton <lac@op...> - 2007-02-22 05:01:01
------- Forwarded Message
Date: Wed, 21 Feb 2007 19:11:45 -0800 (PST)
From: Matthieu TC <matthieutc@...>
Subject: Re: [pygame] textboxes and buttons (solved)
Content-Type: text/plain; charset=iso-8859-1
I suprisingly solved the problem. It was one of encoding.
self._text = self._text[:self._caret] + event.unicode + self._text[self._caret:]
self._text = self._text[:self._caret] + str(event.unicode) + self._text[self._caret:]
in ocempgui's Editable.py, and everything seems dandy once everything is cx_freezed.
BTW, pgu had a similar problem, throwing an "unknown encoding: latin-1".
I'm using ocempGUI and its documentation is somewhat better than pgu's so it's going pretty well.
I have one problem though. Whenever I cx_freeze my application anbd try it out, as soon as I attempt to enter anything in a textbox, I get a "Fatal Python Error: (pygame parachute) Segmentation Fault".
I traced ocempgui's code and found out the segmentation fault is thrown very close to but after
self.dirty = True in Editable.py -> notify()
I'm guessing another thread picks that up and something goes awry in the drawing.
Has anyone cx_freezed a ocempgui app successfully?
>> The two main GUI toolkits for pygame seem to be OcempGUI and pgu
>>Take a look at these, but if you just need two textboxes for a login, it'd probably be easier just to
>>code them yourself, rather then trying to learn a new library.
>I don't know of a standard way of doing this in PyGame, but OCempGui
>is in fact a nice GUI toolkit for PyGame.
------- End of Forwarded Message
On, Thu Feb 22, 2007, Laura Creighton wrote:
> From: Matthieu TC <matthieutc@...>
> I suprisingly solved the problem. It was one of encoding.
> I replaced:
> self._text =3D self._text[:self._caret] + event.unicode +
> self._text =3D self._text[:self._caret] + str(event.unicode) +
As already written on the pygame-users list this would bring up several
other issues such as break encodings different from US-ASCII. I just
tried cx_freeze with a tiny script and it freezes all references just
fine. I did not run the test binary as it breaks with the usual
'freesansbold.ttf' missing exception of pygame.