diff options
Diffstat (limited to 'src/extension')
| -rw-r--r-- | src/extension/extension.cpp | 34 | ||||
| -rw-r--r-- | src/extension/param/notebook.cpp | 7 |
2 files changed, 25 insertions, 16 deletions
diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index 0008d22bf..b2cea838c 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -640,21 +640,27 @@ class AutoGUI : public Gtk::VBox { public: /** \brief Create an AutoGUI object */ AutoGUI (void) : Gtk::VBox() {}; - /** \brief Adds a widget with a tool tip into the autogui - \param widg Widget to add - \param tooltip Tooltip for the widget - - If there is no widget, nothing happens. Otherwise it is just - added into the VBox. If there is a tooltip (non-NULL) then it - is placed on the widget. - */ - void addWidget (Gtk::Widget * widg, gchar const * tooltip) { - if (widg == NULL) return; - this->pack_start(*widg, false, false, 2); - if (tooltip != NULL) { - widg->set_tooltip_text(Glib::ustring(_(tooltip))); + + /** + * Adds a widget with a tool tip into the autogui. + * + * If there is no widget, nothing happens. Otherwise it is just + * added into the VBox. If there is a tooltip (non-NULL) then it + * is placed on the widget. + * + * @param widg Widget to add. + * @param tooltip Tooltip for the widget. + */ + void addWidget(Gtk::Widget *widg, gchar const *tooltip) { + if (widg) { + this->pack_start(*widg, false, false, 2); + if (tooltip) { + widg->set_tooltip_text(_(tooltip)); + } else { + widg->set_tooltip_text(""); + widg->set_has_tooltip(false); + } } - return; }; }; diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index d65ec3927..99eec7e4b 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -209,8 +209,11 @@ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Nod gchar const * tip = param->get_tooltip(); // printf("Tip: '%s'\n", tip); vbox->pack_start(*widg, false, false, 2); - if (tip != NULL) { - widg->set_tooltip_text(Glib::ustring(tip)); + if (tip) { + widg->set_tooltip_text(tip); + } else { + widg->set_tooltip_text(""); + widg->set_has_tooltip(false); } } |
