From 9d619556920bb7e17335d35a91a2a09c460b2d8e Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 8 Aug 2007 22:53:46 +0000 Subject: [PATCH] fix crash without text-default-font --- panda/src/pgui/pgEntry.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panda/src/pgui/pgEntry.cxx b/panda/src/pgui/pgEntry.cxx index 3b07b58e5e..702547d2bc 100644 --- a/panda/src/pgui/pgEntry.cxx +++ b/panda/src/pgui/pgEntry.cxx @@ -190,6 +190,9 @@ void PGEntry:: press(const MouseWatcherParameter ¶m, 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 ¶m, 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)) {