本文整理汇总了C++中gtk::Label::set_tooltip_text方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::set_tooltip_text方法的具体用法?C++ Label::set_tooltip_text怎么用?C++ Label::set_tooltip_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::Label
的用法示例。
在下文中一共展示了Label::set_tooltip_text方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Gtk::Widget *
PathParam::param_newWidget()
{
Gtk::HBox * _widget = Gtk::manage(new Gtk::HBox());
Gtk::Label* pLabel = Gtk::manage(new Gtk::Label(param_label));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true);
pLabel->set_tooltip_text(param_tooltip);
Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) );
Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
pButton->add(*pIcon);
pButton->show();
pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_edit_button_click));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Edit on-canvas"));
pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) );
pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
pButton->add(*pIcon);
pButton->show();
pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_copy_button_click));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Copy path"));
pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) );
pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
pButton->add(*pIcon);
pButton->show();
pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_paste_button_click));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Paste path"));
pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) );
pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
pButton->add(*pIcon);
pButton->show();
pButton->signal_clicked().connect(sigc::mem_fun(*this, &PathParam::on_link_button_click));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Link to path on clipboard"));
static_cast<Gtk::HBox*>(_widget)->show_all_children();
return dynamic_cast<Gtk::Widget *> (_widget);
}
示例2:
Gtk::Widget *
OriginalPathParam::param_newWidget()
{
Gtk::HBox *_widget = Gtk::manage(new Gtk::HBox());
{ // Label
Gtk::Label *pLabel = Gtk::manage(new Gtk::Label(param_label));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true);
pLabel->set_tooltip_text(param_tooltip);
}
{ // Paste path to link button
Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_PASTE, Inkscape::ICON_SIZE_BUTTON) );
Gtk::Button *pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
pButton->add(*pIcon);
pButton->show();
pButton->signal_clicked().connect(sigc::mem_fun(*this, &OriginalPathParam::on_link_button_click));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Link to path"));
}
{ // Select original button
Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon("edit-select-original", Inkscape::ICON_SIZE_BUTTON) );
Gtk::Button *pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
pButton->add(*pIcon);
pButton->show();
pButton->signal_clicked().connect(sigc::mem_fun(*this, &OriginalPathParam::on_select_original_button_click));
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Select original"));
}
static_cast<Gtk::HBox*>(_widget)->show_all_children();
return dynamic_cast<Gtk::Widget *> (_widget);
}
示例3: append_property
void GstPropertiesModule::append_property(const std::shared_ptr<GValueBase>& value_base, const std::string &prop_name)
{
auto e = std::dynamic_pointer_cast<ElementModel>(controller->get_selected_object());
if (!e) return;
auto klass = controller->get_klass(e->get_type_name());
if (!klass) return;
auto prop = klass.get().get_property(prop_name);
if (!prop) return;
Gtk::Box *hbox = new Gtk::Box (Gtk::ORIENTATION_HORIZONTAL, 0);
hbox->set_data("property-name", g_strdup (prop_name.c_str()), g_free);
Gtk::Label *lbl = Gtk::manage(new Gtk::Label(prop_name));
lbl->set_tooltip_text(prop->get_blurb());
Gtk::Button *btn = Gtk::manage(new Gtk::Button("Refresh"));
btn->signal_clicked().connect([this, prop_name] {request_selected_element_property(prop_name);});
hbox->pack_start(*lbl, false, false);
auto value_widget = value_base->get_widget();
value_base->set_sensitive(prop.get().get_flags() & G_PARAM_WRITABLE);
hbox->pack_start(*value_widget, true, true);
hbox->pack_start(*btn, false, false);
properties_box->pack_start(*hbox);
hbox->show_all();
}
示例4: ExceptionUninitialized
//.........这里部分代码省略.........
if (typ == U"Prop3")
{
Prop3 *p = Gtk::manage(new Prop3(Gtk::ICON_SIZE_BUTTON, el.GetValue<crn::Prop3>()));
p->signal_value_changed().connect(sigc::mem_fun(this, &ConfigElement::on_p3_changed));
p->show();
pack_start(*p, true, true, 2);
}
else if (!el.GetAllowedValues().IsEmpty())
{ // any Int, Real, String, StringUTF8 or Path
Gtk::ComboBoxText *cb = Gtk::manage(new Gtk::ComboBoxText);
const std::vector<crn::StringUTF8> values(el.GetAllowedValues<crn::StringUTF8>());
for (const crn::StringUTF8 &val : values)
#ifdef CRN_USING_GTKMM3
cb->append(val.CStr());
#else /* CRN_USING_GTKMM3 */
cb->append_text(val.CStr());
#endif /* CRN_USING_GTKMM3 */
cb->set_active_text(el.GetValue<crn::StringUTF8>().CStr());
cb->signal_changed().connect(sigc::bind(sigc::mem_fun(this, &ConfigElement::on_combo_changed), cb));
cb->show();
pack_start(*cb, true, true, 2);
}
else if (typ == U"Int")
{
if (el.HasMinValue() && el.HasMaxValue())
{ // has finite range, use a slider
#ifdef CRN_USING_GTKMM3
auto *s = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
s->set_range(el.GetMinValue<int>(), el.GetMaxValue<int>() + 1);
s->set_increments(1, 1);
#else
Gtk::HScale *s = Gtk::manage(new Gtk::HScale(el.GetMinValue<int>(), el.GetMaxValue<int>() + 1, 1));
#endif
s->set_value(el.GetValue<int>());
s->signal_value_changed().connect(sigc::bind(sigc::mem_fun(this, &ConfigElement::on_range_changed), s));
s->show();
pack_start(*s, true, true, 2);
}
else
{ // has at least one infinite (maxed) bound, use a spin button
Gtk::SpinButton *s = Gtk::manage(new Gtk::SpinButton);
int m = std::numeric_limits<int>::min(), M = std::numeric_limits<int>::max();
if (el.HasMinValue())
m = el.GetMinValue<int>();
if (el.HasMaxValue())
M = el.GetMaxValue<int>();
s->set_range(m, M);
s->set_increments(1, 10);
s->set_value(el.GetValue<int>());
s->signal_value_changed().connect(sigc::bind(sigc::mem_fun(this, &ConfigElement::on_spin_changed), s));
s->show();
pack_start(*s, true, true, 2);
}
}
else if (typ == U"Real")
{
if (el.HasMinValue() && el.HasMaxValue())
{ // has finite range, use a slider
#ifdef CRN_USING_GTKMM3
auto *s = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL));
s->set_range(el.GetMinValue<double>(), el.GetMaxValue<double>() + 0.01);
s->set_increments(0.01, 0.01);
#else
Gtk::HScale *s = Gtk::manage(new Gtk::HScale(el.GetMinValue<double>(), el.GetMaxValue<double>() + 0.01, 0.01));
#endif
s->set_digits(2);
s->set_value(el.GetValue<double>());
s->signal_value_changed().connect(sigc::bind(sigc::mem_fun(this, &ConfigElement::on_range_changed), s));
s->show();
pack_start(*s, true, true, 2);
}
else
{ // has at least one infinite (maxed) bound, use a spin button
Gtk::SpinButton *s = Gtk::manage(new Gtk::SpinButton(0, 2));
double m = -std::numeric_limits<double>::max(), M = std::numeric_limits<double>::max();
if (el.HasMinValue())
m = el.GetMinValue<double>();
if (el.HasMaxValue())
M = el.GetMaxValue<double>();
s->set_range(m, M);
s->set_increments(0.01, 1);
s->set_value(el.GetValue<double>());
s->signal_value_changed().connect(sigc::bind(sigc::mem_fun(this, &ConfigElement::on_spin_changed), s));
s->show();
pack_start(*s, true, true, 2);
}
}
else // string types
{
Gtk::Entry *e = Gtk::manage(new Gtk::Entry);
e->set_text(el.GetValue<crn::StringUTF8>().CStr());
e->signal_changed().connect(sigc::bind(sigc::mem_fun(this, &ConfigElement::on_entry_changed), e));
e->show();
pack_start(*e, true, true, 2);
}
lab = Gtk::manage(new Gtk::Label("?"));
lab->show();
lab->set_tooltip_text(el.GetDescription().CStr());
pack_start(*lab, false, true, 2);
}
示例5: machine
PluginDisplay::PluginDisplay(gx_engine::GxMachineBase& machine_, Glib::RefPtr<Gdk::Pixbuf> icon, sigc::slot<void, bool, bool> finished_callback_)
: machine(machine_), pluginlist(), current_plugin(0), old_state(0), bld(), change_count(0),
actiongroup(Gtk::ActionGroup::create("ladspa_window")), uimanager(),
enum_liststore(new EnumListStore), port_liststore(new PortListStore),
plugin_liststore(new PluginListStore), masteridx_liststore(new MasterIdxListStore),
on_reordered_conn(), display_type_list(), display_type_list_sr(), output_type_list(),
finished_callback(finished_callback_)
{
std::vector<std::string> old_not_found;
machine.load_ladspalist(old_not_found, pluginlist);
bld = gx_gui::GxBuilder::create_from_file(machine.get_options().get_builder_filepath("ladspaliste.glade"));
bld->get_toplevel("window1", window);
bld->find_widget("treeview1", treeview1);
bld->find_widget("treeview2", treeview2);
bld->find_widget("treeview3", treeview3);
bld->find_widget("ladspa_category", ladspa_category);
bld->find_widget("ladspa_maker", ladspa_maker);
bld->find_widget("ladspa_uniqueid", ladspa_uniqueid);
bld->find_widget("search_entry", search_entry);
bld->find_widget("combobox_mono_stereo", combobox_mono_stereo);
bld->find_widget("selected_only", selected_only);
bld->find_widget("changed_only", changed_only);
bld->find_widget("ladspa_only", ladspa_only);
bld->find_widget("lv2_only", lv2_only);
bld->find_widget("show_all", show_all);
bld->find_widget("details_box", details_box);
bld->find_widget("plugin_name", plugin_name);
bld->find_widget("plugin_category", plugin_category);
bld->find_widget("plugin_quirks", plugin_quirks);
bld->find_widget("master_slider_idx", master_slider_idx);
bld->find_widget("master_slider_name", master_slider_name);
bld->find_widget("cellrenderer_master", cellrenderer_master);
bld->find_widget("cellrenderer_newrow", cellrenderer_newrow);
bld->find_widget("cellrenderer_caption", cellrenderer_caption);
bld->find_widget("cellrenderer_active", cellrenderer_active);
bld->find_widget("cellrenderer_category", cellrenderer_category);
bld->find_widget("cellrenderer_quirks", cellrenderer_quirks);
set_title();
actiongroup->add(Gtk::Action::create("FileMenuAction",_("_File")));
save_action = Gtk::Action::create("SaveAction", _("_Ok"));
actiongroup->add(save_action, sigc::mem_fun(this, &PluginDisplay::on_save));
apply_action = Gtk::Action::create("ApplyAction", _("_Apply"));
actiongroup->add(apply_action, sigc::mem_fun(this, &PluginDisplay::on_apply));
quit_action = Gtk::Action::create("QuitAction", _("_Quit"));
actiongroup->add(quit_action, sigc::mem_fun(this, &PluginDisplay::on_quit));
select_all_action = Gtk::Action::create("SelectAllAction", _("_Select All"));
actiongroup->add(select_all_action, sigc::bind(sigc::mem_fun(this, &PluginDisplay::on_select_all), true));
select_none_action = Gtk::Action::create("SelectNoneAction", _("Select _None"));
actiongroup->add(select_none_action, sigc::bind(sigc::mem_fun(this, &PluginDisplay::on_select_all), false));
actiongroup->add(Gtk::Action::create("ViewMenuAction", _("_View")));
Glib::RefPtr<Gtk::Action> act = Gtk::Action::create("FindAction", _("_Find"));
actiongroup->add(act, sigc::mem_fun(this, &PluginDisplay::on_find));
uimanager = Gtk::UIManager::create();
uimanager->insert_action_group(actiongroup, 0);
uimanager->add_ui_from_string(menudef);
//uimanager->get_widget("/ladspalist");
//Gtk::HBox *ww; bld->find_widget("menubox", ww); ww->pack_start(*uimanager->get_widget("/ladspalist"));
window->add_accel_group(uimanager->get_accel_group());
window->signal_delete_event().connect(sigc::mem_fun(this, &PluginDisplay::on_delete_event));
bld->find_widget("show_details", show_details);
show_details->signal_clicked().connect(sigc::mem_fun(this, &PluginDisplay::on_show_details));
treeview3->get_selection()->set_mode(Gtk::SELECTION_BROWSE);
treeview3->set_model(enum_liststore);
Gtk::CellRendererText *r;
bld->find_widget("cellrenderer_label", r);
r->signal_edited().connect(sigc::mem_fun(this, &PluginDisplay::on_label_edited));
Gtk::TreeViewColumn *c;
bld->find_widget("treeviewcolumn_label", c);
c->set_cell_data_func(*r, sigc::mem_fun(this, &PluginDisplay::display_label));
bld->find_widget("dry_wet_button", dry_wet_button);
dry_wet_button->signal_clicked().connect(sigc::mem_fun(this, &PluginDisplay::on_add_dry_wet_controller));
// dry_wet_button->set_active(current_plugin->add_wet_dry);
Glib::RefPtr<Gtk::TreeSelection> sel = treeview2->get_selection();
sel->set_mode(Gtk::SELECTION_BROWSE);
sel->signal_changed().connect(sigc::mem_fun(this, &PluginDisplay::on_parameter_selection_changed));
on_reordered_conn = port_liststore->signal_row_deleted().connect(sigc::mem_fun(this, &PluginDisplay::on_reordered));
treeview2->set_model(port_liststore);
CellRendererComboDerived *rd;
bld->find_widget_derived("cellrenderer_type", rd, sigc::ptr_fun(CellRendererComboDerived::create_from_builder));
rd->signal_edited().connect(sigc::mem_fun(this, &PluginDisplay::on_type_edited));
bld->find_widget("treeviewcolumn_type", c);
c->set_cell_data_func(*rd, sigc::mem_fun(this, &PluginDisplay::display_type));
bld->find_widget_derived("cellrenderer_step", rd, sigc::ptr_fun(CellRendererComboDerived::create_from_builder));
rd->signal_edited().connect(sigc::mem_fun(this, &PluginDisplay::on_step_edited));
bld->find_widget("treeviewcolumn_step", c);
c->set_cell_data_func(*rd, sigc::mem_fun(this, &PluginDisplay::display_step));
cellrenderer_newrow->signal_toggled().connect(sigc::mem_fun(this, &PluginDisplay::on_newrow_toggled));
Gtk::Label *label = new Gtk::Label("N");
label->set_tooltip_text(_("start a new row of controls in the rackbox unit"));
label->show();
bld->find_widget("treeviewcolumn_newrow", c);
c->set_widget(*manage(label));
//.........这里部分代码省略.........