本文整理汇总了C++中gtk::Label::set_valign方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::set_valign方法的具体用法?C++ Label::set_valign怎么用?C++ Label::set_valign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::Label
的用法示例。
在下文中一共展示了Label::set_valign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Window
//.........这里部分代码省略.........
g_strfreev(splitted);
}
//construct the plot
auto plot = Gtk::manage(new Gtk::PLplot::PlotContourShades(
*Gtk::manage(new Gtk::PLplot::PlotDataSurface(
x,
y,
z
)),
x_title,
y_title,
plot_title,
7,
Gtk::PLplot::ColormapPalette::BLUE_RED,
edge_color.get_rgba(),
1.0
));
canvas.add_plot(*plot);
plot->set_background_color(Gdk::RGBA("Yellow Green"));
//now let's set up the grid
grid.set_column_homogeneous(true);
grid.set_column_spacing(5);
grid.set_row_homogeneous(false);
grid.set_row_spacing(5);
int row_counter = 0;
show_edges_label.set_hexpand(true);
show_edges_label.set_vexpand(false);
show_edges_label.set_valign(Gtk::ALIGN_CENTER);
show_edges_label.set_halign(Gtk::ALIGN_END);
show_edges_switch.set_hexpand(true);
show_edges_switch.set_vexpand(false);
show_edges_switch.set_halign(Gtk::ALIGN_START);
show_edges_switch.set_valign(Gtk::ALIGN_CENTER);
show_edges_switch.set_active(plot->is_showing_edges());
show_edges_switch.property_active().signal_changed().connect([this, plot](){
if (show_edges_switch.get_active()) {
edge_color.set_sensitive();
edge_width_spin.set_sensitive();
show_labels_switch.set_sensitive();
plot->show_edges();
}
else {
edge_color.set_sensitive(false);
edge_width_spin.set_sensitive(false);
show_labels_switch.set_sensitive(false);
plot->hide_edges();
}
});
grid.attach(show_edges_label, 0, row_counter, 1, 1);
grid.attach(show_edges_switch, 1, row_counter++, 1, 1);
// show contour labels
show_labels_label.set_hexpand(true);
show_labels_label.set_vexpand(false);
show_labels_label.set_valign(Gtk::ALIGN_CENTER);
show_labels_label.set_halign(Gtk::ALIGN_END);
show_labels_switch.set_hexpand(true);
show_labels_switch.set_vexpand(false);
show_labels_switch.set_halign(Gtk::ALIGN_START);