Browse Source

fix crash without text-default-font

David Rose 18 years ago
parent
commit
9d61955692
1 changed files with 6 additions and 0 deletions
  1. 6 0
      panda/src/pgui/pgEntry.cxx

+ 6 - 0
panda/src/pgui/pgEntry.cxx

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