template<class T> _IMPL(T,);
-#define this (verify<self>::test(*static_cast<self>(this)))
+ template<class T>
+ using pointer_remove_const = std::add_pointer<
+ typename std::remove_const<
+ typename std::remove_pointer<T>::type
+ >::type
+ >;
+
+#define this (verify<self>::test(*static_cast<self>(const_cast<pointer_remove_const<decltype(this)>::type>(this))))
IMPL(Editable, GTK_EDITABLE);
void IEditable::editable(bool value)
{
- gtk_editable_set_editable(GTK_EDITABLE(this), value);
+ gtk_editable_set_editable(this, value);
}
+ IMPL(TreeModel, GTK_TREE_MODEL);
+
IMPL(Widget, GTK_WIDGET);
Widget::Widget(ui::New_t) : Widget(nullptr)
IMPL(ToggleButton, GTK_TOGGLE_BUTTON);
- bool IToggleButton::active()
+ bool IToggleButton::active() const
+ {
+ return gtk_toggle_button_get_active(this) != 0;
+ }
+
+ void IToggleButton::active(bool value)
{
- return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(this)) != 0;
+ gtk_toggle_button_set_active(this, value);
}
IMPL(CheckButton, GTK_CHECK_BUTTON);
)
{}
+ void ITable::attach(Widget child, TableAttach attach, TableAttachOptions options, TablePadding padding) {
+ gtk_table_attach(this, child,
+ attach.left, attach.right, attach.top, attach.bottom,
+ static_cast<GtkAttachOptions>(options.x), static_cast<GtkAttachOptions>(options.y),
+ padding.x, padding.y
+ );
+ }
+
IMPL(TextView, GTK_TEXT_VIEW);
TextView::TextView(ui::New_t) : TextView(GTK_TEXT_VIEW(gtk_text_view_new()))
gtk_list_store_append(this, nullptr);
}
+ IMPL(TreeStore, GTK_TREE_STORE);
+
// IMPL(TreePath, GTK_TREE_PATH);
TreePath::TreePath(ui::New_t) : TreePath(gtk_tree_path_new())