comparison gtk/dw.c @ 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 d11be1f40f8c
comparison
equal deleted inserted replaced
463:2d7b27204cd4 464:3251fbca6fb3
1175 DWDialog *dwwait; 1175 DWDialog *dwwait;
1176 va_list args; 1176 va_list args;
1177 char outbuf[1000]; 1177 char outbuf[1000];
1178 char **xpm_data = NULL; 1178 char **xpm_data = NULL;
1179 int x, y, extra_width=0,text_width,text_height; 1179 int x, y, extra_width=0,text_width,text_height;
1180 gint width,height; 1180 int width,height;
1181 GtkStyle *style;
1182 1181
1183 va_start(args, format); 1182 va_start(args, format);
1184 vsprintf(outbuf, format, args); 1183 vsprintf(outbuf, format, args);
1185 va_end(args); 1184 va_end(args);
1186 1185
1241 /* Create text */ 1240 /* Create text */
1242 text_width = 240; 1241 text_width = 240;
1243 text_height = 0; 1242 text_height = 0;
1244 stext = dw_text_new(outbuf, 0); 1243 stext = dw_text_new(outbuf, 0);
1245 dw_window_set_style(stext, DW_DT_WORDBREAK, DW_DT_WORDBREAK); 1244 dw_window_set_style(stext, DW_DT_WORDBREAK, DW_DT_WORDBREAK);
1246 style = gtk_widget_get_style(stext); 1245 dw_font_text_extents(stext, NULL, outbuf, &width, &height);
1247 gdk_text_extents(style->font, outbuf, strlen(outbuf), NULL, NULL, &width, NULL, NULL);
1248 gdk_text_extents(style->font, "(g", 2, NULL, &height, NULL, NULL, NULL);
1249 height = height+3; 1246 height = height+3;
1250 if(width < text_width) 1247 if(width < text_width)
1251 text_height = height*2; 1248 text_height = height*2;
1252 else if(width < text_width*2) 1249 else if(width < text_width*2)
1253 text_height = height*3; 1250 text_height = height*3;
7240 else if(GTK_IS_COMBO(handle)) 7237 else if(GTK_IS_COMBO(handle))
7241 { 7238 {
7242 handle2 = GTK_COMBO(handle)->list; 7239 handle2 = GTK_COMBO(handle)->list;
7243 } 7240 }
7244 if(GTK_IS_LIST(handle2)) 7241 if(GTK_IS_LIST(handle2))
7245 gtk_list_clear_items(GTK_LIST(handle2), index, index); 7242 gtk_list_clear_items(GTK_LIST(handle2), index, index+1);
7246 DW_MUTEX_UNLOCK; 7243 DW_MUTEX_UNLOCK;
7247 } 7244 }
7248 7245
7249 /* Reposition the bar according to the percentage */ 7246 /* Reposition the bar according to the percentage */
7250 static gint _splitbar_size_allocate(GtkWidget *widget, GtkAllocation *event, gpointer data) 7247 static gint _splitbar_size_allocate(GtkWidget *widget, GtkAllocation *event, gpointer data)