diff --git a/owlkettle/bindings/gtk.nim b/owlkettle/bindings/gtk.nim index ca44a95..a59afdd 100644 --- a/owlkettle/bindings/gtk.nim +++ b/owlkettle/bindings/gtk.nim @@ -707,6 +707,8 @@ proc gtk_window_new*(windowType: GtkWindowType): GtkWidget proc gtk_window_set_title*(window: GtkWidget, title: cstring) proc gtk_window_set_titlebar*(window, titlebar: GtkWidget) proc gtk_window_set_default_size*(window: GtkWidget, width, height: cint) +proc gtk_window_set_resizable*(window: GtkWidget, resizable: bool) +proc gtk_window_get_resizable*(window: GtkWidget): bool proc gtk_window_set_transient_for*(window, parent: GtkWidget) proc gtk_window_set_modal*(window: GtkWidget, modal: cbool) proc gtk_window_set_focus*(window, focus: GtkWidget) diff --git a/owlkettle/widgets.nim b/owlkettle/widgets.nim index d32c74d..1c48aed 100644 --- a/owlkettle/widgets.nim +++ b/owlkettle/widgets.nim @@ -121,6 +121,7 @@ renderable BaseWindow of BaseWidget: defaultSize: tuple[width, height: int] = (800, 600) ## Initial size of the window fullscreened: bool iconName: string + resizable: bool proc close() ## Called when the window is closed @@ -148,6 +149,11 @@ renderable BaseWindow of BaseWidget: property: gtk_window_set_icon_name(state.internalWidget, state.iconName.cstring) + hooks resizable: + property: + gtk_window_set_resizable(state.internalWidget, state.resizable) + + renderable Window of BaseWindow: title: string titlebar: Widget ## Custom widget set as the titlebar of the window @@ -156,7 +162,7 @@ renderable Window of BaseWindow: hooks: beforeBuild: state.internalWidget = gtk_window_new(GTK_WINDOW_TOPLEVEL) - + hooks title: property: if state.titlebar.isNil: