changeset 464:3251fbca6fb3

dw_listbox_delete() needs index+1 for end arg Use dw_text_extents() for dw_messagebox() so it works under GTK 2.2
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 08 Aug 2003 23:09:44 +0000
parents 2d7b27204cd4
children 4ff2c7210973
files gtk/dw.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Sat Aug 02 05:04:22 2003 +0000
+++ b/gtk/dw.c	Fri Aug 08 23:09:44 2003 +0000
@@ -1177,8 +1177,7 @@
 	char outbuf[1000];
 	char **xpm_data = NULL;
 	int x, y, extra_width=0,text_width,text_height;
-	gint width,height;
-	GtkStyle *style;
+	int width,height;
 
 	va_start(args, format);
 	vsprintf(outbuf, format, args);
@@ -1243,9 +1242,7 @@
 	text_height = 0;
 	stext = dw_text_new(outbuf, 0);
 	dw_window_set_style(stext, DW_DT_WORDBREAK, DW_DT_WORDBREAK);
-	style = gtk_widget_get_style(stext);
-	gdk_text_extents(style->font, outbuf, strlen(outbuf), NULL, NULL, &width, NULL, NULL);
-	gdk_text_extents(style->font, "(g", 2, NULL, &height, NULL, NULL, NULL);
+	dw_font_text_extents(stext, NULL, outbuf, &width, &height);
 	height = height+3;
 	if(width < text_width)
 		text_height = height*2;
@@ -7242,7 +7239,7 @@
 		handle2 = GTK_COMBO(handle)->list;
 	}
 	if(GTK_IS_LIST(handle2))
-		gtk_list_clear_items(GTK_LIST(handle2), index, index);
+		gtk_list_clear_items(GTK_LIST(handle2), index, index+1);
 	DW_MUTEX_UNLOCK;
 }