Skip to content

Commit 013b291

Browse files
authored
Merge pull request scorninpc#156 from d47081/add-gtk-window-type
implement GtkWindowType enums
2 parents 0bd5294 + 6d746de commit 013b291

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

main.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,12 @@ extern "C"
14131413
gtkwindow.method<&GtkWindow_::get_screen>("get_screen");
14141414
gtkwindow.method<&GtkWindow_::list_toplevels>("list_toplevels");
14151415

1416+
// GtkWindowType
1417+
Php::Class<Php::Base> gtkwindowtype("GtkWindowType");
1418+
gtkwindowtype.constant("TOPLEVEL", GTK_WINDOW_TOPLEVEL);
1419+
gtkwindowtype.constant("POPUP", GTK_WINDOW_POPUP);
1420+
1421+
// GtkApplicationWindow
14161422
Php::Class<GtkApplicationWindow_> gtkapplicationwindow("GtkApplicationWindow");
14171423
gtkapplicationwindow.extends(gtkwindow);
14181424
gtkapplicationwindow.method<&GtkApplicationWindow_::set_show_menubar>("set_show_menubar");
@@ -4067,6 +4073,7 @@ extern "C"
40674073
extension.add(std::move(gtkeventbox));
40684074
extension.add(std::move(gtkpaned));
40694075
extension.add(std::move(gtkwindow));
4076+
extension.add(std::move(gtkwindowtype));
40704077
extension.add(std::move(gtkapplicationwindow));
40714078
extension.add(std::move(gtkdialog));
40724079
extension.add(std::move(gtkappchooserdialog));

src/Gtk/GtkWindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ GtkWindow_::~GtkWindow_() = default;
1414
void GtkWindow_::__construct(Php::Parameters &parameters)
1515
{
1616
// Verify if has window type parameter
17-
int int_window_type = 0;
17+
int int_window_type = GTK_WINDOW_TOPLEVEL;
18+
1819
if(parameters.size() >= 1) {
1920
int_window_type = parameters[0];
2021
}

0 commit comments

Comments
 (0)