the start-up process of gtk+ 3



Dear Everyone:
 Recently I want to know how the gtk+ 3 choice the x11 backend. But i don't know anything about the process. For example ,here is a "hello world" program:


#include <gtk/gtk.h>
void on_button_clicked(GtkWidget* button, gpointer userdata)
{
 GtkWidget *dialog;
 dialog = gtk_message_dialog_new(NULL, 
   GTK_DIALOG_MODAL |GTK_DIALOG_DESTROY_WITH_PARENT,
   GTK_MESSAGE_INFO,
   GTK_BUTTONS_OK,
   (gchar*)userdata);
 gtk_dialog_run(GTK_DIALOG(dialog));
 gtk_widget_destroy(dialog);
}

int main(int argc, char* argv[])
{
 GtkWidget *window, *button;
 gtk_init(&argc, &argv);
 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 g_signal_connect(G_OBJECT(window),"delete_event",
   G_CALLBACK(gtk_main_quit),NULL);
 gtk_window_set_title(GTK_WINDOW(window),"Hello World!");
 gtk_container_set_border_width(GTK_CONTAINER(window),10);
 button=gtk_button_new_with_label("Hello World!");
 g_signal_connect(G_OBJECT(button),"clicked",
   G_CALLBACK(on_button_clicked),(gpointer)"hello ,everyone");
 gtk_container_add(GTK_CONTAINER(window),button);
 gtk_widget_show_all(window);
 gtk_main();
 return FALSE;
}

I konw we first need to initialize via gtk_init(),then create a window via gtk_window_new.
But now,I want to know the process of the initialization ,the create of window ,etc. And eventually ,to understanding the gtk+ 3 how to call the x11 backend and display the gtk+ 3 application.

thanks.



网易强烈谴责腾讯抄袭并要求其自动下架抄袭APP


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]