[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] textboxes and buttons (solved)
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] textboxes and buttons (solved)
- From: Matthieu TC <matthieutc@xxxxxxxxx>
- Date: Wed, 21 Feb 2007 19:11:45 -0800 (PST)
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Wed, 21 Feb 2007 22:11:56 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=01wE0sENgHtzMw9fewhMqyMJXAikpdl2ChUTQecdX0AmHUi1+JtWcQafMBi4DC202J1TxOZDzzHzZF3PC5FZjipOQxA+B83Z1tCMzJlLm3w/bovZyaCsXnGSS9FJejpb//tJA4YU9H9ASvuj1wAs2BtMs1GG6Vz+rt7FLFjlK9U= ;
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
I suprisingly solved the problem. It was one of encoding.
I replaced:
self._text = self._text[:self._caret] + event.unicode + self._text[self._caret:]
with
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".
-matt
-----------------------
Thanks.
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?
-matt
>> 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.
>http://ocemp.sourceforge.net/gui.html
>Chris