Есть более простой способ сделать это.Вызовите _set_lables_selectable () с диалоговым окном после gtk_message_dialog_new ()
static void _set_label_selectable(gpointer data, gpointer user_data)
{
GtkWidget *widget = GTK_WIDGET(data);
if (GTK_IS_LABEL(widget))
{
gtk_label_set_selectable(GTK_LABEL(widget), TRUE);
}
}
static void _set_lables_selectable(GtkWidget *dialog)
{
GtkWidget *area = gtk_message_dialog_get_message_area(
GTK_MESSAGE_DIALOG(dialog));
GtkContainer *box = (GtkContainer *) area;
GList *children = gtk_container_get_children(box);
g_list_foreach(children, _set_label_selectable, NULL);
g_list_free(children);
}
пример
GtkWidget *dialog = gtk_message_dialog_new(opgU_window,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
"%s", mbuf);
_set_lables_selectable(dialog);