I’m writing a tool that suppose to have GTK gui and operate with windows registry.
I have, for example, such a callback function:
static void
msg_INFO(GtkWidget *main_window, gpointer data)
{
GtkWidget *dialog = gtk_message_dialog_new(NULL,
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, data);
gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
gtk_dialog_run(GTK_DIALOG (dialog) );
gtk_widget_destroy(dialog);
}
It is written in manual that GTK+ is supporting Unicode. If i call this function with
someDATA as argument
LPWSTR someDATA = malloc(256);
wcscpy(someDATA,L"Some data here");
Popup wil only display first char, ‘S’ in this case. I googled for it and found some issues but with python…
I don’t know how to implement it with gtk_message_dialog_new as I need to pause running during interracting with user.
Sorry for my english
GTK+ uses UTF-8, that’s not what you get from a
L-prefixed string literal. The latter will get you a string using wide characters, which are typically 16 bits, so that the first character is encoded as two bytes.The second of these bytes will be 0, since ‘S’ is an ASCII character, and that zero is then terminating the string when viewed as UTF-8.