From 246fcd5198c0a53e27f309777a8ae23e98221753 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 28 Jul 2007 12:32:01 +0000 Subject: Gtkmm-ified the desktop window object, and modified the file dialogs so that they are correctly parented (bzr r3328) --- src/helper/window.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/helper/window.cpp') diff --git a/src/helper/window.cpp b/src/helper/window.cpp index 346bd19f1..6f898ee3e 100644 --- a/src/helper/window.cpp +++ b/src/helper/window.cpp @@ -13,14 +13,15 @@ # include #endif #include +#include #include "inkscape.h" #include "shortcuts.h" #include "desktop.h" #include "event-context.h" +#include "window.h" -static gboolean -sp_window_key_press (GtkWidget *widget, GdkEventKey *event) +static bool on_window_key_press(GdkEventKey* event) { unsigned int shortcut; shortcut = get_group0_keyval (event) | @@ -33,6 +34,23 @@ sp_window_key_press (GtkWidget *widget, GdkEventKey *event) return sp_shortcut_invoke (shortcut, SP_ACTIVE_DESKTOP); } +Gtk::Window * +Inkscape::UI::window_new (const gchar *title, unsigned int resizeable) +{ + Gtk::Window *window = new Gtk::Window(Gtk::WINDOW_TOPLEVEL); + window->set_title (title); + window->set_resizable (resizeable); + window->signal_key_press_event().connect(sigc::ptr_fun(&on_window_key_press)); + + return window; +} + +static gboolean +sp_window_key_press (GtkWidget *widget, GdkEventKey *event) +{ + return on_window_key_press(event); +} + GtkWidget * sp_window_new (const gchar *title, unsigned int resizeable) { @@ -44,4 +62,3 @@ sp_window_new (const gchar *title, unsigned int resizeable) return window; } - -- cgit v1.2.3