Bug in gtkentry



I found a bug in gtk+-1.1.9/gtk/gtkentry.c .

When using a font with a glyph at character position 0x00 I got this
drawn at the end of the drawn text in gtkentry. A look at the source 
revealed that the zero string terminator is sometimes drawn at the
end of the string. The following patch fixes that:

*** gtk+-1.1.9/gtk/gtkentry.c.orig	Wed Dec 30 22:08:58 1998
--- gtk+-1.1.9/gtk/gtkentry.c	Wed Dec 30 22:16:04 1998
***************
*** 1456,1465 ****
  			      1, text_area_height - INNER_BORDER);
  	  /* Draw the character under the cursor again */
  
! 	  gdk_draw_text_wc (drawable, widget->style->font,
! 			    widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
! 			    xoffset, yoffset,
! 			    entry->text + editable->current_pos, 1);
      }
  
  
--- 1456,1466 ----
  			      1, text_area_height - INNER_BORDER);
  	  /* Draw the character under the cursor again */
  
! 	  if (editable->current_pos < entry->text_length)
! 	    gdk_draw_text_wc (drawable, widget->style->font,
! 			      widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
! 			      xoffset, yoffset,
! 			      entry->text + editable->current_pos, 1);
      }
  
  
--Dov



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]