当前位置: 首页>>代码示例>>C++>>正文


C++ Label::property_wrap方法代码示例

本文整理汇总了C++中gtk::Label::property_wrap方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::property_wrap方法的具体用法?C++ Label::property_wrap怎么用?C++ Label::property_wrap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gtk::Label的用法示例。


在下文中一共展示了Label::property_wrap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: manage

BugzillaPreferences::BugzillaPreferences()
    : Gtk::VBox(false, 12)
{
    _init_static();
    last_opened_dir = Glib::get_home_dir();

    Gtk::Label *l = manage(new Gtk::Label (_("You can use any bugzilla just by dragging links "
                                           "into notes.  If you want a special icon for "
                                           "certain hosts, add them here.")));
    l->property_wrap() = true;
    l->property_xalign() = 0;

    pack_start(*l, false, false, 0);

    icon_store = Gtk::ListStore::create(m_columns);
    icon_store->set_sort_column(m_columns.host, Gtk::SORT_ASCENDING);

    icon_tree = manage(new Gtk::TreeView (icon_store));
    icon_tree->set_headers_visible(true);
    icon_tree->get_selection()->set_mode(Gtk::SELECTION_SINGLE);
    icon_tree->get_selection()->signal_changed().connect(
        sigc::mem_fun(*this, &BugzillaPreferences::selection_changed));

    Gtk::TreeViewColumn *host_col = manage(new Gtk::TreeViewColumn(_("Host Name"), m_columns.host));
    host_col->set_sizing(Gtk::TREE_VIEW_COLUMN_AUTOSIZE);
    host_col->set_resizable(true);
    host_col->set_expand(true);
    host_col->set_min_width(200);

    host_col->set_sort_column(m_columns.host);
    host_col->set_sort_indicator(false);
    host_col->set_reorderable(false);
    host_col->set_sort_order(Gtk::SORT_ASCENDING);

    icon_tree->append_column (*host_col);

    Gtk::TreeViewColumn *icon_col = manage(new Gtk::TreeViewColumn(_("Icon"), m_columns.icon));
    icon_col->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED);
    icon_col->set_max_width(50);
    icon_col->set_min_width(50);
    icon_col->set_resizable(false);

    icon_tree->append_column (*icon_col);

    Gtk::ScrolledWindow *sw = manage(new Gtk::ScrolledWindow ());
    sw->set_shadow_type(Gtk::SHADOW_IN);
    sw->property_height_request() = 200;
    sw->property_width_request() = 300;
    sw->set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
    sw->add (*icon_tree);

    pack_start(*sw, true, true, 0);

    add_button = manage(new Gtk::Button (Gtk::Stock::ADD));
    add_button->signal_clicked().connect(
        sigc::mem_fun(*this, &BugzillaPreferences::add_clicked));

    remove_button = manage(new Gtk::Button (Gtk::Stock::REMOVE));
    remove_button->set_sensitive(false);
    remove_button->signal_clicked().connect(
        sigc::mem_fun(*this,  &BugzillaPreferences::remove_clicked));

    Gtk::HButtonBox *hbutton_box = manage(new Gtk::HButtonBox ());
    hbutton_box->set_layout(Gtk::BUTTONBOX_START);
    hbutton_box->set_spacing(6);

    hbutton_box->pack_start(*add_button);
    hbutton_box->pack_start(*remove_button);
    pack_start(*hbutton_box, false, false, 0);

    show_all ();
}
开发者ID:haobug,项目名称:gnote,代码行数:72,代码来源:bugzillapreferences.cpp


注:本文中的gtk::Label::property_wrap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。