I have this very simple code demonstrating a GTK3 message dialog:
test.c
#include <gtk/gtk.h>
int main (int argc, char *argv[]) {
gtk_init (&argc, &argv);
GtkWidget *hello = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Hello world!");
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (hello), "This is an example dialog.");
gtk_dialog_run(GTK_DIALOG (hello));
return 0;
}
When I compile the above code on my Fedora Linux 35 desktop:
gcc -o test $(pkg-config --cflags --libs gtk+-3.0) test.c -g
And run the binary,
I don’t get an icon in the message dialog? I expect to see the system icon associated with GTK_MESSAGE_INFO
in the message dialog.
If I perform the exact same steps on Ubuntu 20.04.3, I do get an icon: