5 void bind_widget(
class SpinButtonDim *sp,
int64_t &v);
6 void bind_widget(
class SpinButtonDim *sp,
uint64_t &v);
8 void bind_widget(Gtk::Switch *sw,
bool &v);
9 void bind_widget(Gtk::CheckButton *sw,
bool &v);
10 void bind_widget(Gtk::SpinButton *sp,
int &v);
11 void bind_widget(Gtk::Scale *sc,
float &v);
12 void bind_widget(Gtk::Entry *en, std::string &v, std::function<
void(std::string &v)> extra_cb =
nullptr);
13 void bind_widget(Gtk::ColorButton *color_button,
class Color &color,
14 std::function<
void(
const Color &c)> extra_cb =
nullptr);
17 void bind_widget(std::map<T, Gtk::RadioButton *> &widgets, T &v, std::function<
void(T)> extra_cb =
nullptr)
19 widgets[v]->set_active(
true);
20 for (
auto &it : widgets) {
22 Gtk::RadioButton *w = it.second;
23 it.second->signal_toggled().connect([key, w, &v, extra_cb] {
24 if (w->get_active()) {
34 void bind_widget(Gtk::ComboBoxText *combo,
const std::map<T, std::string> &lut, T &v,
35 std::function<
void(T)> extra_cb =
nullptr)
37 for (
const auto &it : lut) {
38 combo->append(std::to_string(
static_cast<int>(it.first)), it.second);
40 combo->set_active_id(std::to_string(
static_cast<int>(v)));
41 combo->signal_changed().connect([combo, &v, extra_cb] {
42 v =
static_cast<T
>(std::stoi(combo->get_active_id()));
48 Gtk::Label *grid_attach_label_and_widget(Gtk::Grid *gr,
const std::string &label, Gtk::Widget *w,
int &top);
49 void label_set_tnum(Gtk::Label *la);
50 void entry_set_tnum(Gtk::Entry &en);
52 void tree_view_scroll_to_selection(Gtk::TreeView *view);
53 Gtk::TreeViewColumn *tree_view_append_column_ellipsis(Gtk::TreeView *view,
const std::string &name,
54 const Gtk::TreeModelColumnBase &column,
55 Pango::EllipsizeMode ellipsize);
56 void tree_view_set_search_contains(Gtk::TreeView *view);
58 void entry_set_warning(Gtk::Entry *e,
const std::string &text);
60 void header_func_separator(Gtk::ListBoxRow *row, Gtk::ListBoxRow *before);
62 void entry_add_sanitizer(Gtk::Entry *entry);
64 void info_bar_show(Gtk::InfoBar *bar);
65 void info_bar_hide(Gtk::InfoBar *bar);
66 std::string make_link_markup(
const std::string &href,
const std::string &label);
68 Gtk::Box *make_boolean_ganged_switch(
bool &v,
const std::string &label_false,
const std::string &label_true,
69 std::function<
void(
bool v)> extra_cb =
nullptr);
71 void make_label_small(Gtk::Label *label);
72 void install_esc_to_close(Gtk::Window &win);
73 void widget_set_insensitive_tooltip(Gtk::Widget &w,
const std::string &txt);
75 void widget_remove_scroll_events(Gtk::Widget &widget);
76 void spinbutton_connect_activate(Gtk::SpinButton *sp, std::function<
void()> cb);
78 void open_directory(Gtk::Window &win,
const std::string &filename);
80 #define GET_WIDGET(name) \
82 x->get_widget(#name, name); \
85 #define GET_OBJECT(name) \
87 name = name.cast_dynamic(x->get_object(#name)); \
Definition: common.hpp:267
zip_uint64_t uint64_t
zip_uint64_t_t typedef.
Definition: zip.hpp:108
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103
@ key
the parser read a key of a value in an object