struct _GtkItem;
struct _GtkLabel;
struct _GtkListStore;
+struct _GtkTreeIter;
struct _GtkMenu;
struct _GtkMenuBar;
struct _GtkMenuItem;
}
extern struct Null {} null;
+ extern struct New_t {} New;
class Object :
public details::Convertible<Object, _GtkObject *, details::Convert::Explicit>,
using native = T *; \
explicit name(native h) : super(reinterpret_cast<super::native>(h)) {} \
explicit name(Null n) : name((native) nullptr) {} \
+ explicit name(New_t); \
static name from(void *ptr) { return name((native) ptr); } \
ctors \
}; \
);
WRAP(Editable, Object, _GtkEditable, (),
- explicit Editable();
,
void editable(bool value);
);
};
WRAP(Widget, Object, _GtkWidget, (),
- explicit Widget();
,
alert_response alert(
std::string text,
);
WRAP(Button, Bin, _GtkButton, (),
- explicit Button();
explicit Button(const char *label);
,
);
);
WRAP(CheckButton, ToggleButton, _GtkCheckButton, (),
- explicit CheckButton();
explicit CheckButton(const char *label);
,
);
);
WRAP(MenuItem, Item, _GtkMenuItem, (),
- explicit MenuItem();
explicit MenuItem(const char *label, bool mnemonic = false);
,
);
);
WRAP(TearoffMenuItem, MenuItem, _GtkTearoffMenuItem, (),
- explicit TearoffMenuItem();
,
);
);
WRAP(ComboBoxText, ComboBox, _GtkComboBoxText, (),
- explicit ComboBoxText();
,
);
);
WRAP(ScrolledWindow, Bin, _GtkScrolledWindow, (),
- explicit ScrolledWindow();
,
void overflow(Policy x, Policy y);
);
);
WRAP(HPaned, Paned, _GtkHPaned, (),
- explicit HPaned();
,
);
WRAP(VPaned, Paned, _GtkVPaned, (),
- explicit VPaned();
,
);
);
WRAP(Menu, MenuShell, _GtkMenu, (),
- explicit Menu();
,
);
);
WRAP(TextView, Container, _GtkTextView, (),
- explicit TextView();
,
void text(char const *str);
);
class TreeModel;
WRAP(TreeView, Widget, _GtkTreeView, (),
- explicit TreeView();
TreeView(TreeModel model);
,
);
);
WRAP(Image, Widget, _GtkImage, (),
- explicit Image();
,
);
WRAP(Entry, Widget, _GtkEntry, (IEditable, ICellEditable),
- explicit Entry();
explicit Entry(std::size_t max_length);
,
char const *text();
);
WRAP(CellRendererText, CellRenderer, _GtkCellRendererText, (),
- explicit CellRendererText();
,
);
);
WRAP(AccelGroup, Object, _GtkAccelGroup, (),
- explicit AccelGroup();
,
);
WRAP(ListStore, Object, _GtkListStore, (ITreeModel),
,
void clear();
+
+ template<class... T>
+ void append(T... args);
+
+ void append();
);
WRAP(TreeSelection, Object, _GtkTreeSelection, (),
// GBoxed
WRAP(TreePath, Object, _GtkTreePath, (),
- explicit TreePath();
explicit TreePath(const char *path);
,
);
gtk_container_foreach(this, cb, &lambda);
}
+ namespace {
+ extern "C" {
+ void gtk_list_store_insert_with_values(_GtkListStore *, _GtkTreeIter *, gint position, ...);
+ }
+ }
+
+ template<class... T>
+ void IListStore::append(T... args) {
+ static_assert(sizeof...(args) % 2 == 0, "received an odd number of arguments");
+ gtk_list_store_insert_with_values(this, NULL, -1, args..., -1);
+ }
+
#undef this
}