diff dwtest.c @ 1785:c5ea64e8b436

Added UTF8/Wide conversion for GTK2/3. Also added some code in the test program to use it.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 25 Jul 2012 00:46:00 +0000
parents 9de6d1cc8fb8
children ed8851658015
line wrap: on
line diff
--- a/dwtest.c	Tue Jul 24 23:33:50 2012 +0000
+++ b/dwtest.c	Wed Jul 25 00:46:00 2012 +0000
@@ -998,6 +998,8 @@
     unsigned long depth = dw_color_depth_get();
     HWND vscrollbox, hbox, button1, button2, label;
     int vscrollbarwidth, hscrollbarheight;
+    wchar_t widestring[100] = L"DWTest Wide";
+    char *utf8string = dw_wchar_to_utf8(widestring);
 
     /* create a box to pack into the notebook page */
     pagebox = dw_box_new(DW_HORZ, 2);
@@ -1092,7 +1094,7 @@
     if(image)
         dw_pixmap_set_transparent_color(image, DW_CLR_WHITE);
 
-    dw_messagebox("DWTest", DW_MB_OK|DW_MB_INFORMATION, "Width: %d Height: %d\n", font_width, font_height);
+    dw_messagebox(utf8string ? utf8string : "DWTest", DW_MB_OK|DW_MB_INFORMATION, "Width: %d Height: %d\n", font_width, font_height);
     dw_draw_rect(0, text1pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*width1, font_height*rows);
     dw_draw_rect(0, text2pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*cols, font_height*rows);
     dw_signal_connect(textbox1, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(context_menu_event), NULL);