Commit 7df549508ec9374b48922ff5ed401cd93ce6a657
1 parent
535fbfae
Exists in
master
and in
4 other branches
Implementing toolbar edit.
Showing
5 changed files
with
272 additions
and
32 deletions
Show diff stats
pw3270.cbp
| @@ -46,6 +46,7 @@ | @@ -46,6 +46,7 @@ | ||
| 46 | <Unit filename="src/include/pw3270.h" /> | 46 | <Unit filename="src/include/pw3270.h" /> |
| 47 | <Unit filename="src/include/pw3270/actions.h" /> | 47 | <Unit filename="src/include/pw3270/actions.h" /> |
| 48 | <Unit filename="src/include/pw3270/application.h" /> | 48 | <Unit filename="src/include/pw3270/application.h" /> |
| 49 | + <Unit filename="src/include/pw3270/settings.h" /> | ||
| 49 | <Unit filename="src/include/pw3270/toolbar.h" /> | 50 | <Unit filename="src/include/pw3270/toolbar.h" /> |
| 50 | <Unit filename="src/include/pw3270/window.h" /> | 51 | <Unit filename="src/include/pw3270/window.h" /> |
| 51 | <Unit filename="src/main/main.c"> | 52 | <Unit filename="src/main/main.c"> |
| @@ -121,6 +122,9 @@ | @@ -121,6 +122,9 @@ | ||
| 121 | <Option compilerVar="CC" /> | 122 | <Option compilerVar="CC" /> |
| 122 | </Unit> | 123 | </Unit> |
| 123 | <Unit filename="src/objects/toolbar/private.h" /> | 124 | <Unit filename="src/objects/toolbar/private.h" /> |
| 125 | + <Unit filename="src/objects/toolbar/settings.c"> | ||
| 126 | + <Option compilerVar="CC" /> | ||
| 127 | + </Unit> | ||
| 124 | <Unit filename="src/objects/toolbar/toolbar.c"> | 128 | <Unit filename="src/objects/toolbar/toolbar.c"> |
| 125 | <Option compilerVar="CC" /> | 129 | <Option compilerVar="CC" /> |
| 126 | </Unit> | 130 | </Unit> |
src/include/pw3270.h
| @@ -55,12 +55,14 @@ | @@ -55,12 +55,14 @@ | ||
| 55 | void pw3270_load_placeholders(GtkBuilder * builder); | 55 | void pw3270_load_placeholders(GtkBuilder * builder); |
| 56 | 56 | ||
| 57 | // Application settings widget | 57 | // Application settings widget |
| 58 | - typedef struct _Pw3270SettingWidget Pw3270SettingsWidget; | 58 | + typedef struct _Pw3270SettingsPage Pw3270SettingsPage; |
| 59 | 59 | ||
| 60 | - struct _Pw3270SettingWidget { | ||
| 61 | - GtkWidget * widget; | ||
| 62 | - void (*apply)(Pw3270SettingsWidget *, GtkApplication *, GSettings *); | ||
| 63 | - void (*revert)(Pw3270SettingsWidget *, GtkApplication *, GSettings *); | 60 | + struct _Pw3270SettingsPage { |
| 61 | + GtkWidget * widget; ///< @brief Settings widget. | ||
| 62 | + const gchar * label; ///< @brief Page lagel. | ||
| 63 | + const gchar * title; ///< @brief Page title. | ||
| 64 | + void (*load)(Pw3270SettingsPage *, GtkApplication *, GSettings *); | ||
| 65 | + void (*apply)(Pw3270SettingsPage *, GtkApplication *, GSettings *); | ||
| 64 | }; | 66 | }; |
| 65 | 67 | ||
| 66 | G_END_DECLS | 68 | G_END_DECLS |
| @@ -0,0 +1,48 @@ | @@ -0,0 +1,48 @@ | ||
| 1 | +/* | ||
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | ||
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | ||
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | ||
| 5 | + * | ||
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | ||
| 7 | + * | ||
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | ||
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | ||
| 10 | + * Free Software Foundation. | ||
| 11 | + * | ||
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | ||
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | ||
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | ||
| 15 | + * obter mais detalhes. | ||
| 16 | + * | ||
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | ||
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | ||
| 19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | + * | ||
| 21 | + * Este programa está nomeado como - e possui - linhas de código. | ||
| 22 | + * | ||
| 23 | + * Contatos: | ||
| 24 | + * | ||
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | ||
| 27 | + * | ||
| 28 | + */ | ||
| 29 | + | ||
| 30 | +/** | ||
| 31 | + * @brief Declares the pw3270 Application Settings widget. | ||
| 32 | + * | ||
| 33 | + */ | ||
| 34 | + | ||
| 35 | +#ifndef PW3270_SETTINGS_H_INCLUDED | ||
| 36 | + | ||
| 37 | + #define PW3270_SETTINGS_H_INCLUDED | ||
| 38 | + | ||
| 39 | + #include <gtk/gtk.h> | ||
| 40 | + #include <pw3270.h> | ||
| 41 | + | ||
| 42 | + G_BEGIN_DECLS | ||
| 43 | + | ||
| 44 | + Pw3270SettingsPage * pw3270_toolbar_settings_new(); | ||
| 45 | + | ||
| 46 | + G_END_DECLS | ||
| 47 | + | ||
| 48 | +#endif // PW3270_SETTINGS_H_INCLUDED |
src/objects/application/actions/preferences.c
| @@ -30,14 +30,18 @@ | @@ -30,14 +30,18 @@ | ||
| 30 | #include "../private.h" | 30 | #include "../private.h" |
| 31 | #include <pw3270.h> | 31 | #include <pw3270.h> |
| 32 | #include <pw3270/application.h> | 32 | #include <pw3270/application.h> |
| 33 | + #include <pw3270/settings.h> | ||
| 33 | 34 | ||
| 34 | typedef struct _Pw3270SettingsDialog { | 35 | typedef struct _Pw3270SettingsDialog { |
| 35 | - GtkApplication * application; | 36 | + GApplication * application; |
| 36 | GSimpleAction * action; | 37 | GSimpleAction * action; |
| 38 | + GtkDialog * dialog; | ||
| 39 | + GtkNotebook * notebook; | ||
| 37 | GSList * pages; | 40 | GSList * pages; |
| 38 | } Pw3270SettingsDialog; | 41 | } Pw3270SettingsDialog; |
| 39 | 42 | ||
| 40 | static void on_destroy(GtkWidget *dialog, Pw3270SettingsDialog *settings) { | 43 | static void on_destroy(GtkWidget *dialog, Pw3270SettingsDialog *settings) { |
| 44 | + settings->dialog = NULL; | ||
| 41 | g_slist_free_full(settings->pages,g_free); | 45 | g_slist_free_full(settings->pages,g_free); |
| 42 | g_free(settings); | 46 | g_free(settings); |
| 43 | g_simple_action_set_enabled(settings->action,TRUE); | 47 | g_simple_action_set_enabled(settings->action,TRUE); |
| @@ -45,28 +49,21 @@ | @@ -45,28 +49,21 @@ | ||
| 45 | 49 | ||
| 46 | void on_response(GtkDialog *dialog, gint response_id, Pw3270SettingsDialog * settings) { | 50 | void on_response(GtkDialog *dialog, gint response_id, Pw3270SettingsDialog * settings) { |
| 47 | 51 | ||
| 48 | - GSList * page; | ||
| 49 | - GSettings *hSettings = pw3270_application_get_settings(settings->application); | ||
| 50 | - | ||
| 51 | - switch(response_id) { | ||
| 52 | - case GTK_RESPONSE_CANCEL: | ||
| 53 | - g_message("Reverting application settings"); | ||
| 54 | - for(page = settings->pages;page;page = page->next) { | ||
| 55 | - Pw3270SettingsWidget * widget = (Pw3270SettingsWidget *) page->data; | ||
| 56 | - widget->revert(widget,settings->application,hSettings); | ||
| 57 | - } | ||
| 58 | - break; | 52 | + if(response_id== GTK_RESPONSE_APPLY) { |
| 59 | 53 | ||
| 60 | - case GTK_RESPONSE_APPLY: | ||
| 61 | g_message("Aplying application settings"); | 54 | g_message("Aplying application settings"); |
| 55 | + | ||
| 56 | + GSList * page; | ||
| 62 | for(page = settings->pages;page;page = page->next) { | 57 | for(page = settings->pages;page;page = page->next) { |
| 63 | - Pw3270SettingsWidget * widget = (Pw3270SettingsWidget *) page->data; | ||
| 64 | - widget->apply(widget,settings->application,hSettings); | 58 | + Pw3270SettingsPage * widget = (Pw3270SettingsPage *) page->data; |
| 59 | + if(widget->apply) { | ||
| 60 | + widget->apply(widget,GTK_APPLICATION(settings->application),pw3270_application_get_settings(settings->application)); | ||
| 61 | + } | ||
| 65 | } | 62 | } |
| 66 | - break; | 63 | + |
| 67 | } | 64 | } |
| 68 | 65 | ||
| 69 | - gtk_widget_destroy(dialog); | 66 | + gtk_widget_destroy(GTK_WIDGET(dialog)); |
| 70 | } | 67 | } |
| 71 | 68 | ||
| 72 | static void on_page_added(GtkNotebook *notebook, GtkWidget *widget, guint page_num, Pw3270SettingsDialog * settings) { | 69 | static void on_page_added(GtkNotebook *notebook, GtkWidget *widget, guint page_num, Pw3270SettingsDialog * settings) { |
| @@ -84,8 +81,47 @@ | @@ -84,8 +81,47 @@ | ||
| 84 | 81 | ||
| 85 | } | 82 | } |
| 86 | 83 | ||
| 84 | + static void on_switch_page(GtkNotebook G_GNUC_UNUSED(*notebook), GtkWidget *widget, guint G_GNUC_UNUSED(page_num), Pw3270SettingsDialog * settings) | ||
| 85 | + { | ||
| 86 | + if(!settings->dialog) | ||
| 87 | + return; | ||
| 88 | + | ||
| 89 | + GtkWidget * header_bar = gtk_dialog_get_header_bar(settings->dialog); | ||
| 90 | + | ||
| 91 | + if(header_bar) { | ||
| 92 | + GSList * page; | ||
| 93 | + for(page = settings->pages;page;page = page->next) { | ||
| 94 | + Pw3270SettingsPage * pg = (Pw3270SettingsPage *) page->data; | ||
| 95 | + if(pg->widget == pg) { | ||
| 96 | + if(pg->title) | ||
| 97 | + gtk_header_bar_set_subtitle(GTK_HEADER_BAR(header_bar),pg->title); | ||
| 98 | + return; | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + void pw3270_application_settings_dialog_add_page(Pw3270SettingsDialog *settings, Pw3270SettingsPage *page) { | ||
| 106 | + | ||
| 107 | + settings->pages = g_slist_prepend(settings->pages,page); | ||
| 108 | + | ||
| 109 | + GtkWidget * label = NULL; | ||
| 110 | + if(page->label) | ||
| 111 | + label = gtk_label_new(page->label); | ||
| 112 | + | ||
| 113 | + gtk_notebook_append_page( | ||
| 114 | + settings->notebook, | ||
| 115 | + page->widget, | ||
| 116 | + label | ||
| 117 | + ); | ||
| 118 | + | ||
| 119 | + } | ||
| 120 | + | ||
| 87 | void pw3270_application_preferences_activated(GSimpleAction *action, GVariant G_GNUC_UNUSED(*parameter), gpointer application) { | 121 | void pw3270_application_preferences_activated(GSimpleAction *action, GVariant G_GNUC_UNUSED(*parameter), gpointer application) { |
| 88 | 122 | ||
| 123 | + size_t ix; | ||
| 124 | + | ||
| 89 | debug("%s",__FUNCTION__); | 125 | debug("%s",__FUNCTION__); |
| 90 | 126 | ||
| 91 | // Create dialog. | 127 | // Create dialog. |
| @@ -115,30 +151,49 @@ | @@ -115,30 +151,49 @@ | ||
| 115 | 151 | ||
| 116 | // Create setttings data. | 152 | // Create setttings data. |
| 117 | Pw3270SettingsDialog * settings = g_new0(Pw3270SettingsDialog,1); | 153 | Pw3270SettingsDialog * settings = g_new0(Pw3270SettingsDialog,1); |
| 118 | - settings->action = action; | ||
| 119 | - settings->application = GTK_APPLICATION(application); | 154 | + settings->action = action; |
| 155 | + settings->dialog = GTK_DIALOG(dialog); | ||
| 156 | + settings->application = G_APPLICATION(application); | ||
| 120 | 157 | ||
| 121 | g_simple_action_set_enabled(action,FALSE); | 158 | g_simple_action_set_enabled(action,FALSE); |
| 122 | gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); | 159 | gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); |
| 123 | 160 | ||
| 124 | // Create settings notebook. | 161 | // Create settings notebook. |
| 125 | 162 | ||
| 126 | - GtkNotebook *notebook = GTK_NOTEBOOK(gtk_notebook_new()); | 163 | + settings->notebook = GTK_NOTEBOOK(gtk_notebook_new()); |
| 127 | 164 | ||
| 128 | - gtk_notebook_set_scrollable(notebook,TRUE); | ||
| 129 | - gtk_notebook_set_show_tabs(notebook,TRUE); | ||
| 130 | - gtk_notebook_set_show_border(notebook, FALSE); | 165 | + gtk_notebook_set_scrollable(settings->notebook,TRUE); |
| 166 | + gtk_notebook_set_show_tabs(settings->notebook,TRUE); | ||
| 167 | + gtk_notebook_set_show_border(settings->notebook, FALSE); | ||
| 131 | 168 | ||
| 132 | - g_signal_connect(G_OBJECT(notebook), "page-added", G_CALLBACK(on_page_added), dialog); | ||
| 133 | -// g_signal_connect(G_OBJECT(notebook), "page-removed", G_CALLBACK(on_page_changed), dialog); | ||
| 134 | -// g_signal_connect(G_OBJECT(notebook), "switch-page", G_CALLBACK(on_switch_page), dialog); | ||
| 135 | - gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),GTK_WIDGET(notebook),TRUE,TRUE,0); | 169 | + g_signal_connect(G_OBJECT(settings->notebook), "page-added", G_CALLBACK(on_page_added), settings); |
| 170 | +// g_signal_connect(G_OBJECT(settings->notebook), "page-removed", G_CALLBACK(on_page_changed), settings); | ||
| 171 | + g_signal_connect(G_OBJECT(settings->notebook), "switch-page", G_CALLBACK(on_switch_page), settings); | ||
| 172 | + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),GTK_WIDGET(settings->notebook),TRUE,TRUE,0); | ||
| 136 | 173 | ||
| 137 | // Connection signals. | 174 | // Connection signals. |
| 138 | g_signal_connect(dialog,"destroy",G_CALLBACK(on_destroy),settings); | 175 | g_signal_connect(dialog,"destroy",G_CALLBACK(on_destroy),settings); |
| 139 | g_signal_connect(dialog,"response",G_CALLBACK(on_response),settings); | 176 | g_signal_connect(dialog,"response",G_CALLBACK(on_response),settings); |
| 140 | g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | 177 | g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); |
| 141 | 178 | ||
| 179 | + // Load pages. | ||
| 180 | + Pw3270SettingsPage * pages[] = { | ||
| 181 | + pw3270_toolbar_settings_new() | ||
| 182 | + }; | ||
| 183 | + | ||
| 184 | + for(ix = 0; ix < G_N_ELEMENTS(pages); ix++) { | ||
| 185 | + pw3270_application_settings_dialog_add_page(settings,pages[ix]); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + // Load page contents. | ||
| 189 | + GSList * page; | ||
| 190 | + for(page = settings->pages;page;page = page->next) { | ||
| 191 | + Pw3270SettingsPage * widget = (Pw3270SettingsPage *) page->data; | ||
| 192 | + if(widget->load) { | ||
| 193 | + widget->load(widget,GTK_APPLICATION(settings->application),pw3270_application_get_settings(settings->application)); | ||
| 194 | + } | ||
| 195 | + } | ||
| 196 | + | ||
| 142 | // Show dialog. | 197 | // Show dialog. |
| 143 | gtk_widget_show_all(dialog); | 198 | gtk_widget_show_all(dialog); |
| 144 | gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); | 199 | gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); |
| @@ -0,0 +1,131 @@ | @@ -0,0 +1,131 @@ | ||
| 1 | +/* | ||
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | ||
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | ||
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | ||
| 5 | + * | ||
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | ||
| 7 | + * | ||
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | ||
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | ||
| 10 | + * Free Software Foundation. | ||
| 11 | + * | ||
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | ||
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | ||
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | ||
| 15 | + * obter mais detalhes. | ||
| 16 | + * | ||
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | ||
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | ||
| 19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 20 | + * | ||
| 21 | + * Este programa está nomeado como - e possui - linhas de código. | ||
| 22 | + * | ||
| 23 | + * Contatos: | ||
| 24 | + * | ||
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ||
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | ||
| 27 | + * | ||
| 28 | + */ | ||
| 29 | + | ||
| 30 | + #include "private.h" | ||
| 31 | + #include <pw3270/settings.h> | ||
| 32 | + | ||
| 33 | + typedef struct _ToolbarSettingsPage { | ||
| 34 | + Pw3270SettingsPage parent; | ||
| 35 | + GtkWidget * views[2]; | ||
| 36 | + GtkWidget * buttons[2]; | ||
| 37 | + | ||
| 38 | + } ToolbarSettingsPage; | ||
| 39 | + | ||
| 40 | + static void load(Pw3270SettingsPage *pg, GtkApplication *application, GSettings *settings) { | ||
| 41 | + debug("%s",__FUNCTION__); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + static void apply(Pw3270SettingsPage *pg, GtkApplication *application, GSettings *settings) { | ||
| 45 | + debug("%s",__FUNCTION__); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + GtkWidget * pw3270_action_store_new() { | ||
| 49 | + | ||
| 50 | + GtkWidget * view = GTK_WIDGET(gtk_tree_view_new_with_model(GTK_TREE_MODEL(gtk_list_store_new(2,G_TYPE_OBJECT,G_TYPE_STRING)))); | ||
| 51 | + | ||
| 52 | + gtk_widget_set_hexpand(view,TRUE); | ||
| 53 | + gtk_widget_set_vexpand(view,TRUE); | ||
| 54 | + gtk_tree_view_set_fixed_height_mode(GTK_TREE_VIEW(view),FALSE); | ||
| 55 | + | ||
| 56 | + return view; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + Pw3270SettingsPage * pw3270_toolbar_settings_new() { | ||
| 60 | + | ||
| 61 | + size_t ix; | ||
| 62 | + | ||
| 63 | + ToolbarSettingsPage * page = g_new0(ToolbarSettingsPage,1); | ||
| 64 | + | ||
| 65 | + page->parent.load = load; | ||
| 66 | + page->parent.apply = apply; | ||
| 67 | + page->parent.label = _("Toolbar"); | ||
| 68 | + page->parent.title = _("Setup toolbar action elements"); | ||
| 69 | + | ||
| 70 | + page->parent.widget = gtk_grid_new(); | ||
| 71 | + gtk_grid_set_row_homogeneous(GTK_GRID(page->parent.widget),FALSE); | ||
| 72 | + | ||
| 73 | + // Create views | ||
| 74 | + static const gchar *labels[G_N_ELEMENTS(page->views)] = { | ||
| 75 | + N_("Selected"), | ||
| 76 | + N_("Available") | ||
| 77 | + }; | ||
| 78 | + | ||
| 79 | + for(ix = 0; ix < G_N_ELEMENTS(page->views); ix++) { | ||
| 80 | + | ||
| 81 | + page->views[ix] = pw3270_action_store_new(); | ||
| 82 | + | ||
| 83 | + gtk_grid_attach( | ||
| 84 | + GTK_GRID(page->parent.widget), | ||
| 85 | + gtk_label_new(gettext(labels[ix])), | ||
| 86 | + ix * 3,0,2,1 | ||
| 87 | + ); | ||
| 88 | + | ||
| 89 | + GtkWidget * box = gtk_scrolled_window_new(NULL,NULL); | ||
| 90 | + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(box),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); | ||
| 91 | + gtk_container_add(GTK_CONTAINER(box),page->views[ix]); | ||
| 92 | + | ||
| 93 | + gtk_grid_attach( | ||
| 94 | + GTK_GRID(page->parent.widget), | ||
| 95 | + box, | ||
| 96 | + ix * 3,1,2,4 | ||
| 97 | + ); | ||
| 98 | + | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + // Create buttons | ||
| 102 | + static const gchar * icon_names[G_N_ELEMENTS(page->buttons)] = { | ||
| 103 | + "go-next", | ||
| 104 | + "go-previous" | ||
| 105 | + }; | ||
| 106 | + | ||
| 107 | + GtkWidget * box = gtk_vbutton_box_new(); | ||
| 108 | + gtk_widget_set_hexpand(box,FALSE); | ||
| 109 | + gtk_widget_set_vexpand(box,FALSE); | ||
| 110 | + | ||
| 111 | + for(ix = 0; ix < G_N_ELEMENTS(icon_names); ix++) { | ||
| 112 | + page->buttons[ix] = gtk_button_new_from_icon_name(icon_names[ix],GTK_ICON_SIZE_DND); | ||
| 113 | + | ||
| 114 | + gtk_widget_set_focus_on_click(page->buttons[ix],FALSE); | ||
| 115 | + gtk_button_set_relief(GTK_BUTTON(page->buttons[ix]),GTK_RELIEF_NONE); | ||
| 116 | + gtk_widget_set_sensitive(page->buttons[ix],FALSE); | ||
| 117 | + | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + gtk_box_pack_start(GTK_BOX(box),page->buttons[0],FALSE,FALSE,0); | ||
| 121 | + gtk_box_pack_end(GTK_BOX(box),page->buttons[1],FALSE,FALSE,0); | ||
| 122 | + | ||
| 123 | + gtk_grid_attach( | ||
| 124 | + GTK_GRID(page->parent.widget), | ||
| 125 | + box, | ||
| 126 | + 2,2,1,1 | ||
| 127 | + ); | ||
| 128 | + | ||
| 129 | + | ||
| 130 | + return (Pw3270SettingsPage *) page; | ||
| 131 | + } |