2008-12-19 17:44:56 +00:00
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
#include <stdio.h>
|
2008-12-27 04:00:52 +00:00
|
|
|
|
|
2008-12-27 04:56:55 +00:00
|
|
|
|
static void
|
2020-07-24 13:54:49 +00:00
|
|
|
|
clear_pressed (GtkEntry *entry, int icon, gpointer data)
|
2008-12-27 04:56:55 +00:00
|
|
|
|
{
|
|
|
|
|
if (icon == GTK_ENTRY_ICON_SECONDARY)
|
2019-02-28 19:31:36 +00:00
|
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "");
|
2008-12-27 04:56:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2015-12-19 00:32:24 +00:00
|
|
|
|
static void
|
|
|
|
|
set_blank (GtkWidget *button,
|
|
|
|
|
GtkEntry *entry)
|
|
|
|
|
{
|
2020-08-30 22:21:48 +00:00
|
|
|
|
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (button)))
|
2015-12-19 00:32:24 +00:00
|
|
|
|
gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
set_icon_name (GtkWidget *button,
|
|
|
|
|
GtkEntry *entry)
|
|
|
|
|
{
|
2020-08-30 22:21:48 +00:00
|
|
|
|
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (button)))
|
2015-12-19 00:32:24 +00:00
|
|
|
|
gtk_entry_set_icon_from_icon_name (entry, GTK_ENTRY_ICON_SECONDARY, "media-floppy");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
set_gicon (GtkWidget *button,
|
|
|
|
|
GtkEntry *entry)
|
|
|
|
|
{
|
|
|
|
|
GIcon *icon;
|
|
|
|
|
|
2020-08-30 22:21:48 +00:00
|
|
|
|
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (button)))
|
2015-12-19 00:32:24 +00:00
|
|
|
|
{
|
|
|
|
|
icon = g_themed_icon_new ("gtk-yes");
|
|
|
|
|
gtk_entry_set_icon_from_gicon (entry, GTK_ENTRY_ICON_SECONDARY, icon);
|
|
|
|
|
g_object_unref (icon);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2017-11-05 05:45:01 +00:00
|
|
|
|
set_texture (GtkWidget *button,
|
2017-10-23 10:49:42 +00:00
|
|
|
|
GtkEntry *entry)
|
2015-12-19 00:32:24 +00:00
|
|
|
|
{
|
2017-11-05 05:45:01 +00:00
|
|
|
|
GdkTexture *texture;
|
2015-12-19 00:32:24 +00:00
|
|
|
|
|
2020-08-30 22:21:48 +00:00
|
|
|
|
if (gtk_check_button_get_active (GTK_CHECK_BUTTON (button)))
|
2015-12-19 00:32:24 +00:00
|
|
|
|
{
|
2021-01-28 04:28:36 +00:00
|
|
|
|
texture = gdk_texture_new_from_resource ("/org/gtk/libgtk/icons/32x32/places/network-workgroup.png");
|
2018-03-16 02:32:05 +00:00
|
|
|
|
gtk_entry_set_icon_from_paintable (entry, GTK_ENTRY_ICON_SECONDARY, GDK_PAINTABLE (texture));
|
2017-11-05 05:45:01 +00:00
|
|
|
|
g_object_unref (texture);
|
2015-12-19 00:32:24 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-11 05:02:21 +00:00
|
|
|
|
static const char cssdata[] =
|
|
|
|
|
".entry-frame:not(:focus) { "
|
|
|
|
|
" border: 2px solid alpha(gray,0.3);"
|
|
|
|
|
"}"
|
|
|
|
|
".entry-frame:focus { "
|
|
|
|
|
" border: 2px solid red;"
|
|
|
|
|
"}"
|
|
|
|
|
".entry-frame entry { "
|
|
|
|
|
" border: none; "
|
|
|
|
|
" box-shadow: none; "
|
|
|
|
|
"}";
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
icon_pressed_cb (GtkGesture *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
g_print ("You clicked me!\n");
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 03:24:47 +00:00
|
|
|
|
static void
|
|
|
|
|
quit_cb (GtkWidget *widget,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
|
|
|
|
gboolean *done = data;
|
|
|
|
|
|
|
|
|
|
*done = TRUE;
|
|
|
|
|
|
|
|
|
|
g_main_context_wakeup (NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2008-12-19 17:44:56 +00:00
|
|
|
|
int
|
|
|
|
|
main (int argc, char **argv)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *window;
|
2011-09-27 20:35:49 +00:00
|
|
|
|
GtkWidget *grid;
|
2008-12-19 17:44:56 +00:00
|
|
|
|
GtkWidget *label;
|
|
|
|
|
GtkWidget *entry;
|
2015-12-19 00:32:24 +00:00
|
|
|
|
GtkWidget *box;
|
2017-12-11 05:02:21 +00:00
|
|
|
|
GtkWidget *image;
|
2015-12-19 00:32:24 +00:00
|
|
|
|
GtkWidget *button1;
|
|
|
|
|
GtkWidget *button2;
|
|
|
|
|
GtkWidget *button3;
|
|
|
|
|
GtkWidget *button4;
|
2008-12-19 17:44:56 +00:00
|
|
|
|
GIcon *icon;
|
2019-12-31 07:45:02 +00:00
|
|
|
|
GdkContentProvider *content;
|
2020-02-10 03:24:47 +00:00
|
|
|
|
gboolean done = FALSE;
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2016-12-28 13:53:22 +00:00
|
|
|
|
gtk_init ();
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2020-02-14 19:55:36 +00:00
|
|
|
|
window = gtk_window_new ();
|
2008-12-19 17:44:56 +00:00
|
|
|
|
gtk_window_set_title (GTK_WINDOW (window), "Gtk Entry Icons Test");
|
|
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (window), "destroy",
|
2020-02-10 03:24:47 +00:00
|
|
|
|
G_CALLBACK (quit_cb), &done);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2011-09-27 20:35:49 +00:00
|
|
|
|
grid = gtk_grid_new ();
|
2020-05-02 21:26:54 +00:00
|
|
|
|
gtk_window_set_child (GTK_WINDOW (window), grid);
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
|
|
|
|
|
gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
|
2020-02-26 01:57:20 +00:00
|
|
|
|
gtk_widget_set_margin_start (grid, 10);
|
|
|
|
|
gtk_widget_set_margin_end (grid, 10);
|
|
|
|
|
gtk_widget_set_margin_top (grid, 10);
|
|
|
|
|
gtk_widget_set_margin_bottom (grid, 10);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Open File - Sets the icon using a GIcon
|
|
|
|
|
*/
|
|
|
|
|
label = gtk_label_new ("Open File:");
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
|
2014-05-13 11:28:20 +00:00
|
|
|
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
entry = gtk_entry_new ();
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), entry, 1, 0, 1, 1);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2013-06-24 21:31:22 +00:00
|
|
|
|
icon = g_themed_icon_new ("folder-symbolic");
|
|
|
|
|
g_themed_icon_append_name (G_THEMED_ICON (icon), "folder-symbolic");
|
2008-12-27 04:00:52 +00:00
|
|
|
|
|
2008-12-19 17:44:56 +00:00
|
|
|
|
gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry),
|
2019-12-17 12:20:28 +00:00
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
|
|
|
|
icon);
|
|
|
|
|
g_object_unref (icon);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
gtk_entry_set_icon_sensitive (GTK_ENTRY (entry),
|
2008-12-27 04:56:55 +00:00
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
2008-12-19 17:44:56 +00:00
|
|
|
|
FALSE);
|
|
|
|
|
|
|
|
|
|
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
|
|
|
|
"Open a file");
|
|
|
|
|
|
|
|
|
|
/*
|
2013-06-24 21:31:22 +00:00
|
|
|
|
* Save File - sets the icon using an icon name.
|
2008-12-19 17:44:56 +00:00
|
|
|
|
*/
|
|
|
|
|
label = gtk_label_new ("Save File:");
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
|
2014-05-13 11:28:20 +00:00
|
|
|
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
entry = gtk_entry_new ();
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), entry, 1, 1, 1, 1);
|
2019-02-28 19:31:36 +00:00
|
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "Right-to-left");
|
2008-12-19 17:44:56 +00:00
|
|
|
|
gtk_widget_set_direction (entry, GTK_TEXT_DIR_RTL);
|
2023-05-16 20:22:01 +00:00
|
|
|
|
|
2013-06-24 21:31:22 +00:00
|
|
|
|
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
|
|
|
|
"document-save-symbolic");
|
2008-12-19 17:44:56 +00:00
|
|
|
|
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
|
|
|
|
"Save a file");
|
2023-05-16 20:22:01 +00:00
|
|
|
|
|
2020-02-16 13:24:03 +00:00
|
|
|
|
content = gdk_content_provider_new_typed (G_TYPE_STRING, "Amazing");
|
2008-12-27 04:56:55 +00:00
|
|
|
|
gtk_entry_set_icon_drag_source (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
2023-05-16 20:22:01 +00:00
|
|
|
|
content, GDK_ACTION_COPY);
|
2019-12-31 07:45:02 +00:00
|
|
|
|
g_object_unref (content);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Search - Uses a helper function
|
|
|
|
|
*/
|
|
|
|
|
label = gtk_label_new ("Search:");
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
|
2014-05-13 11:28:20 +00:00
|
|
|
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
entry = gtk_entry_new ();
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), entry, 1, 2, 1, 1);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2017-07-31 18:33:38 +00:00
|
|
|
|
gtk_entry_set_placeholder_text (GTK_ENTRY (entry),
|
|
|
|
|
"Type some text, then click an icon");
|
|
|
|
|
|
2013-06-24 21:31:22 +00:00
|
|
|
|
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
|
|
|
|
"edit-find-symbolic");
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2017-07-31 18:33:38 +00:00
|
|
|
|
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_PRIMARY,
|
|
|
|
|
"Clicking the other icon is more interesting!");
|
|
|
|
|
|
2013-06-24 21:31:22 +00:00
|
|
|
|
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_SECONDARY,
|
|
|
|
|
"edit-clear-symbolic");
|
2008-12-27 04:00:52 +00:00
|
|
|
|
|
2017-07-31 18:33:38 +00:00
|
|
|
|
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_SECONDARY,
|
|
|
|
|
"Clear");
|
|
|
|
|
|
2008-12-31 07:29:23 +00:00
|
|
|
|
g_signal_connect (entry, "icon-press", G_CALLBACK (clear_pressed), NULL);
|
2008-12-27 04:00:52 +00:00
|
|
|
|
|
2008-12-19 17:44:56 +00:00
|
|
|
|
/*
|
2013-06-24 21:31:22 +00:00
|
|
|
|
* Password - Sets the icon using an icon name
|
2008-12-19 17:44:56 +00:00
|
|
|
|
*/
|
|
|
|
|
label = gtk_label_new ("Password:");
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
|
2014-05-13 11:28:20 +00:00
|
|
|
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2019-02-17 03:22:43 +00:00
|
|
|
|
entry = gtk_password_entry_new ();
|
2019-03-13 20:27:07 +00:00
|
|
|
|
gtk_password_entry_set_show_peek_icon (GTK_PASSWORD_ENTRY (entry), TRUE);
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), entry, 1, 3, 1, 1);
|
2017-07-31 18:33:38 +00:00
|
|
|
|
|
2008-12-19 17:44:56 +00:00
|
|
|
|
/* Name - Does not set any icons. */
|
|
|
|
|
label = gtk_label_new ("Name:");
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
|
2014-05-13 11:28:20 +00:00
|
|
|
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
entry = gtk_entry_new ();
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
2017-07-31 18:33:38 +00:00
|
|
|
|
gtk_entry_set_placeholder_text (GTK_ENTRY (entry),
|
|
|
|
|
"Use the RadioButtons to choose an icon");
|
|
|
|
|
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
|
|
|
|
|
GTK_ENTRY_ICON_SECONDARY,
|
|
|
|
|
"Use the RadioButtons to change this icon");
|
2011-09-27 20:35:49 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), entry, 1, 4, 1, 1);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2015-12-19 00:32:24 +00:00
|
|
|
|
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
2017-08-11 16:09:55 +00:00
|
|
|
|
gtk_widget_set_vexpand (GTK_WIDGET (box), TRUE);
|
2015-12-19 00:32:24 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), box, 0, 5, 3, 1);
|
|
|
|
|
|
2020-08-30 22:21:48 +00:00
|
|
|
|
button1 = gtk_check_button_new_with_label ("Blank");
|
2017-08-11 16:09:55 +00:00
|
|
|
|
gtk_widget_set_valign (button1, GTK_ALIGN_START);
|
2015-12-19 00:32:24 +00:00
|
|
|
|
g_signal_connect (button1, "toggled", G_CALLBACK (set_blank), entry);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), button1);
|
2020-08-30 22:21:48 +00:00
|
|
|
|
button2 = gtk_check_button_new_with_label ("Icon Name");
|
2017-08-11 16:09:55 +00:00
|
|
|
|
gtk_widget_set_valign (button2, GTK_ALIGN_START);
|
2020-08-30 22:21:48 +00:00
|
|
|
|
gtk_check_button_set_group (GTK_CHECK_BUTTON (button2), GTK_CHECK_BUTTON (button1));
|
2015-12-19 00:32:24 +00:00
|
|
|
|
g_signal_connect (button2, "toggled", G_CALLBACK (set_icon_name), entry);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), button2);
|
2020-08-30 22:21:48 +00:00
|
|
|
|
button3 = gtk_check_button_new_with_label ("GIcon");
|
2017-08-11 16:09:55 +00:00
|
|
|
|
gtk_widget_set_valign (button3, GTK_ALIGN_START);
|
2020-08-30 22:21:48 +00:00
|
|
|
|
gtk_check_button_set_group (GTK_CHECK_BUTTON (button3), GTK_CHECK_BUTTON (button1));
|
2015-12-19 00:32:24 +00:00
|
|
|
|
g_signal_connect (button3, "toggled", G_CALLBACK (set_gicon), entry);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), button3);
|
2020-08-30 22:21:48 +00:00
|
|
|
|
button4 = gtk_check_button_new_with_label ("Texture");
|
2017-08-11 16:09:55 +00:00
|
|
|
|
gtk_widget_set_valign (button4, GTK_ALIGN_START);
|
2020-08-30 22:21:48 +00:00
|
|
|
|
gtk_check_button_set_group (GTK_CHECK_BUTTON (button4), GTK_CHECK_BUTTON (button1));
|
2017-11-05 05:45:01 +00:00
|
|
|
|
g_signal_connect (button4, "toggled", G_CALLBACK (set_texture), entry);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), button4);
|
2015-12-19 00:32:24 +00:00
|
|
|
|
|
2017-08-11 16:09:55 +00:00
|
|
|
|
label = gtk_label_new ("Emoji:");
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), label, 0, 6, 1, 1);
|
|
|
|
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
|
|
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
|
|
|
|
|
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
|
g_object_set (entry, "show-emoji-icon", TRUE, NULL);
|
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), entry, 1, 6, 1, 1);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
2017-12-11 05:02:21 +00:00
|
|
|
|
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
2020-04-10 16:08:16 +00:00
|
|
|
|
gtk_widget_add_css_class (box, "view");
|
|
|
|
|
gtk_widget_add_css_class (box, "entry-frame");
|
2017-12-11 05:02:21 +00:00
|
|
|
|
gtk_widget_set_cursor_from_name (box, "text");
|
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
|
gtk_widget_set_hexpand (entry, TRUE);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), entry);
|
2017-12-11 05:02:21 +00:00
|
|
|
|
image = gtk_image_new_from_icon_name ("edit-find-symbolic");
|
|
|
|
|
gtk_widget_set_cursor_from_name (image, "default");
|
2020-02-26 01:57:20 +00:00
|
|
|
|
gtk_widget_set_margin_start (image, 6);
|
|
|
|
|
gtk_widget_set_margin_end (image, 6);
|
|
|
|
|
gtk_widget_set_margin_top (image, 6);
|
|
|
|
|
gtk_widget_set_margin_bottom (image, 6);
|
2017-12-11 05:02:21 +00:00
|
|
|
|
gtk_widget_set_tooltip_text (image, "Click me");
|
|
|
|
|
|
|
|
|
|
GtkGesture *gesture;
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gesture = gtk_gesture_click_new ();
|
2017-12-11 05:02:21 +00:00
|
|
|
|
g_signal_connect (gesture, "pressed", G_CALLBACK (icon_pressed_cb), NULL);
|
2018-03-09 05:14:59 +00:00
|
|
|
|
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), image);
|
2017-12-11 05:02:21 +00:00
|
|
|
|
image = gtk_image_new_from_icon_name ("document-save-symbolic");
|
2020-02-26 01:57:20 +00:00
|
|
|
|
gtk_widget_set_margin_start (image, 6);
|
|
|
|
|
gtk_widget_set_margin_end (image, 6);
|
|
|
|
|
gtk_widget_set_margin_top (image, 6);
|
|
|
|
|
gtk_widget_set_margin_bottom (image, 6);
|
2020-05-09 12:26:52 +00:00
|
|
|
|
gtk_box_append (GTK_BOX (box), image);
|
2017-12-11 05:02:21 +00:00
|
|
|
|
gtk_grid_attach (GTK_GRID (grid), box, 1, 7, 1, 1);
|
|
|
|
|
|
|
|
|
|
GtkCssProvider *provider;
|
|
|
|
|
provider = gtk_css_provider_new ();
|
2023-05-16 20:22:01 +00:00
|
|
|
|
gtk_css_provider_load_from_string (provider, cssdata);
|
2017-12-11 05:02:21 +00:00
|
|
|
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), 800);
|
2022-11-29 12:06:33 +00:00
|
|
|
|
gtk_window_present (GTK_WINDOW (window));
|
2020-02-10 03:24:47 +00:00
|
|
|
|
|
|
|
|
|
while (!done)
|
|
|
|
|
g_main_context_iteration (NULL, TRUE);
|
2008-12-19 17:44:56 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|