我想在Gtkmm中使用Gtk :: ScaleButton 3.我的问题是构造函数。它需要作为最后一个参数(见这里:https://developer.gnome.org/gtkmm/stable/classGtk_1_1ScaleButton.html#a96753b6cb6b8adb0ed3727ba3eb8cfb7)一个ustrings向量。我想(我无法在文档中找到它的意思)我必须给它的+/-图像的路径。我想使用Gtk Stock项目来获得+/-。我怎样才能做到这一点?Gtk :: ScaleButton:构造函数中的图标
目前,我给它一个空的载体,这导致glibmm警告:
std::vector<Glib::ustring> icons;
Gtk::ScaleButton * scale = Gtk::manage(new Gtk::ScaleButton(Gtk::ICON_SIZE_SMALL_TOOLBAR, 0.0, 10.0, 1.0, icons));
警告:
glibmm-WARNING **: Glib::ConstructParams::ConstructParams(): object class "gtkmm__GtkScaleButton" has no property named "min"
如何避免警告,并给它的股票图标?
(https://开头开发商。 gnome.org/gtk3/stable/GtkScaleButton.html#GtkScaleButton--icons)原始的GTK +构造函数说这可以是空的;我不确定这对gtkmm意味着什么。如果您愿意,可以使用[标准图标名称](http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html)。我不知道你的具体问题,但是......听起来像其他东西出错 – andlabs 2014-12-04 14:03:31
在gtkmm本身ScaleButton构造函数是不完整的。我会尽力在那里解决它。在此期间,您可以尝试使用:Gtk :: ScaleButton * button = Glib :: wrap(gtk_scale_button_new(whatever)); – murrayc 2014-12-07 16:12:20