Code

Mnemonics in "Fill and stroke", "Align and distribute", and "Transform" dialogs ...
[inkscape.git] / src / widgets / spw-utilities.cpp
index 7c2956c65e97be8b8d4c927439f7c9ed1e5fdc0f..49e3a7495bdc1af1117c110adccad15e1d1ca293 100644 (file)
  * 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);