Commit cfffa32d authored by Matthias Clasen's avatar Matthias Clasen
Browse files

gtk-demo: Add an app chooser button demo

Add a 'Mail' app chooser to the 'Pickers' example.
parent bfa5d367
/* Pickers
*
* These widgets are mainly intended for use in preference dialogs.
* They allow to select colors, fonts, files and directories.
* They allow to select colors, fonts, files, directories and applications.
*/
#include <gtk/gtk.h>
......@@ -25,7 +25,7 @@ do_pickers (GtkWidget *do_widget)
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
table = gtk_table_new (4, 2, FALSE);
table = gtk_table_new (5, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 10);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
gtk_container_add (GTK_CONTAINER (window), table);
......@@ -57,6 +57,13 @@ do_pickers (GtkWidget *do_widget)
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 3, 4);
gtk_table_attach_defaults (GTK_TABLE (table), picker, 1, 2, 3, 4);
label = gtk_label_new ("Mail:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 4, 5);
gtk_table_attach_defaults (GTK_TABLE (table), picker, 1, 2, 4, 5);
}
if (!gtk_widget_get_visible (window))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment