summaryrefslogtreecommitdiffstats
path: root/src/widgets/spw-utilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/spw-utilities.cpp')
-rw-r--r--src/widgets/spw-utilities.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp
index 7c2956c65..49e3a7495 100644
--- a/src/widgets/spw-utilities.cpp
+++ b/src/widgets/spw-utilities.cpp
@@ -34,11 +34,19 @@
* position in the table.
*/
Gtk::Label *
-spw_label(Gtk::Table *table, const gchar *label_text, int col, int row)
+spw_label(Gtk::Table *table, const gchar *label_text, int col, int row, Gtk::Widget* target)
{
- Gtk::Label *label_widget = new Gtk::Label(label_text);
+ Gtk::Label *label_widget = new Gtk::Label();
g_assert(label_widget != NULL);
-
+ if (target != NULL)
+ {
+ label_widget->set_text_with_mnemonic(label_text);
+ label_widget->set_mnemonic_widget(*target);
+ }
+ else
+ {
+ label_widget->set_text(label_text);
+ }
label_widget->set_alignment(1.0, 0.5);
label_widget->show();
table->attach(*label_widget, col, col+1, row, row+1, (Gtk::EXPAND | Gtk::FILL), static_cast<Gtk::AttachOptions>(0), 4, 0);