GTKでプログラムしていてDLALOGは出せるようになりました。
こんな感じです
C
1/*Callback function in which reacts to the "response" signal. Be sure to place 2it before the function it is called in*/ 3static void 4on_response (GtkDialog *dialog, 5 gint response_id, 6 gpointer user_data) 7{ 8 /*For demonstration purposes, this will show the int value 9 of the response type*/ 10 g_print ("response is %d\n", response_id); 11 12 /*This will cause the dialog to be destroyed*/ 13 gtk_widget_destroy (GTK_WIDGET (dialog)); 14} 15 16 17 18/*Callback function in which reacts to the "clicked" signal*/ 19static void 20show_dialog (GtkWindow * user_data) 21{ 22 GtkWindow *window = user_data; 23 GtkWidget *dialog; 24 GtkWidget *content_area; 25 GtkWidget *label; 26 27 gint response_id; 28 29 /*Create the dialog window. Modal windows prevent interaction with other 30 windows in the same application*/ 31 dialog = gtk_dialog_new_with_buttons ("A Gtk+ Dialog", 32 window, 33 GTK_DIALOG_MODAL, 34 GTK_STOCK_OK, 35 GTK_RESPONSE_OK, 36 NULL); 37 38 /*Create a label and attach it to the content area of the dialog*/ 39 content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); 40 label = gtk_label_new ("This demonstrates a dialog with a label"); 41 gtk_container_add (GTK_CONTAINER (content_area), label); 42 43 /*The main purpose of this is to show dialog's child widget, label*/ 44 gtk_widget_show_all (dialog); 45 46 /*Connecting the "response" signal from the user to the associated 47 callback function*/ 48 g_signal_connect (GTK_DIALOG (dialog), 49 "response", 50 G_CALLBACK (on_response), 51 NULL); 52 53}
このDIALOGにスクロールバーつきのエリアを作って画像を貼りたいです
こんな感じ
どうすればいいかわかる人はいませんか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。