#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
GtkWidget* Window;
GtkWidget* Button;
GtkWidget* Dialog;
static void ExibirUmaVerdade();
int main(int argc, char *argv[])
{
gtk_init(&argc, &argv);
Window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
Button = gtk_button_new_with_label("Mostrar uma verdade");
Dialog = gtk_message_dialog_new(
NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Nada é melhor do que C!"
);
gtk_widget_show_all(Window);
gtk_widget_show_all(Button);
gtk_container_add(GTK_CONTAINER(Window), Button);
g_signal_connect(G_OBJECT(Button), "clicked", G_CALLBACK(ExibirUmaVerdade), NULL);
gtk_main();
return 0;
}
static void ExibirUmaVerdade()
{
gtk_dialog_run(GTK_DIALOG(Dialog));
gtk_widget_destroy(Dialog);
}
Linguagens que utilizo constantemente: