fix crash without text-default-font

This commit is contained in:
David Rose 2007-08-08 22:53:46 +00:00
parent cfb2fa7eed
commit 9d61955692
1 changed files with 6 additions and 0 deletions

View File

@ -190,6 +190,9 @@ void PGEntry::
press(const MouseWatcherParameter &param, bool background) {
if (get_active()) {
if (param.has_button()) {
// Make sure _text is initialized properly.
update_text();
ButtonHandle button = param.get_button();
if (button == MouseButton::one() ||
@ -281,6 +284,9 @@ void PGEntry::
keystroke(const MouseWatcherParameter &param, bool background) {
if (get_active()) {
if (param.has_keycode()) {
// Make sure _text is initialized properly.
update_text();
int keycode = param.get_keycode();
if (!isascii(keycode) || isprint(keycode)) {