Skip to content

Commit

Permalink
feat: more notebook functions
Browse files Browse the repository at this point in the history
  • Loading branch information
apss-pohl committed Mar 17, 2023
1 parent 71b7746 commit 23f4e29
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Gtk/GtkNotebook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ Php::Value GtkNotebook_::append_page(Php::Parameters &parameters)
return ret;
}

Php::Value GtkNotebook_::prepend_page(Php::Parameters& parameters)
{
GtkWidget* child;
if (parameters.size() > 0) {
Php::Value object_child = parameters[0];
GtkWidget_* phpgtk_child = (GtkWidget_*)object_child.implementation();
child = GTK_WIDGET(phpgtk_child->get_instance());
}

GtkWidget* tab_label;
if (parameters.size() > 1) {
Php::Value object_tab_label = parameters[1];
GtkWidget_* phpgtk_tab_label = (GtkWidget_*)object_tab_label.implementation();
tab_label = GTK_WIDGET(phpgtk_tab_label->get_instance());
}

gint ret = gtk_notebook_prepend_page(GTK_NOTEBOOK(instance), child, tab_label);

return ret;
}

Php::Value GtkNotebook_::insert_page(Php::Parameters &parameters)
{
GtkWidget *child;
Expand Down
2 changes: 2 additions & 0 deletions src/Gtk/GtkNotebook.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

Php::Value append_page(Php::Parameters &parameters);

Php::Value prepend_page(Php::Parameters& parameters);

Php::Value insert_page(Php::Parameters &parameters);

void remove_page(Php::Parameters &parameters);
Expand Down

0 comments on commit 23f4e29

Please sign in to comment.