diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-01-07 08:05:35 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-01-07 08:05:35 +0100 |
commit | 2bd663e0db1f365595aa9f04a8423ca85b9a1063 (patch) | |
tree | 55b98e455d33d8e9281b2c829593416bf34871e4 /src/Gui | |
parent | e0cb6bd23b21f126bde42f74f4b1a798c3e15b0f (diff) | |
download | zoomedit-2bd663e0db1f365595aa9f04a8423ca85b9a1063.tar zoomedit-2bd663e0db1f365595aa9f04a8423ca85b9a1063.zip |
Migrated from Glade to GtkBuilder
Diffstat (limited to 'src/Gui')
-rw-r--r-- | src/Gui/AspectFrame.h | 4 | ||||
-rw-r--r-- | src/Gui/RenderArea.cpp | 2 | ||||
-rw-r--r-- | src/Gui/RenderArea.h | 4 | ||||
-rw-r--r-- | src/Gui/Window.cpp | 16 | ||||
-rw-r--r-- | src/Gui/Window.h | 4 |
5 files changed, 18 insertions, 12 deletions
diff --git a/src/Gui/AspectFrame.h b/src/Gui/AspectFrame.h index 0831956..1008464 100644 --- a/src/Gui/AspectFrame.h +++ b/src/Gui/AspectFrame.h @@ -21,7 +21,7 @@ #define ZOOMEDIT_GUI_ASPECTFRAME_H_ #include <gtkmm/aspectframe.h> -#include <iostream> +#include <gtkmm/builder.h> namespace ZoomEdit { namespace Gui { @@ -40,7 +40,7 @@ class AspectFrame : public Gtk::AspectFrame { } public: - AspectFrame(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml>&) + AspectFrame(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder>&) : Gtk::AspectFrame(cobject), width(-1) { signal_size_allocate().connect(sigc::mem_fun(this, &AspectFrame::onSizeAllocate)); } diff --git a/src/Gui/RenderArea.cpp b/src/Gui/RenderArea.cpp index 0fcc9ce..8065dc3 100644 --- a/src/Gui/RenderArea.cpp +++ b/src/Gui/RenderArea.cpp @@ -29,7 +29,7 @@ namespace Gui { GdkGLConfig *RenderArea::glconfig = 0; -RenderArea::RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml>&) +RenderArea::RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder>&) : Gtk::DrawingArea(cobject), view(0), inWindow(false) { if(!glconfig) { glconfig = gdk_gl_config_new_by_mode((GdkGLConfigMode)(GDK_GL_MODE_RGB | GDK_GL_MODE_DOUBLE)); diff --git a/src/Gui/RenderArea.h b/src/Gui/RenderArea.h index d42a352..ea3f815 100644 --- a/src/Gui/RenderArea.h +++ b/src/Gui/RenderArea.h @@ -20,9 +20,9 @@ #ifndef ZOOMEDIT_GUI_RENDERAREA_H_ #define ZOOMEDIT_GUI_RENDERAREA_H_ +#include <gtkmm/builder.h> #include <gtkmm/drawingarea.h> #include <gtkmm/scrollbar.h> -#include <libglademm/xml.h> #include <gtk/gtkgl.h> namespace ZoomEdit { @@ -35,7 +35,7 @@ namespace Gui { class RenderArea : public Gtk::DrawingArea { public: - RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml>&); + RenderArea(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder>&); View::View* getView() const {return view;} void setView(View::View *view0); diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp index 6d614fb..dcc8f45 100644 --- a/src/Gui/Window.cpp +++ b/src/Gui/Window.cpp @@ -21,16 +21,22 @@ #include "RenderArea.h" #include "AspectFrame.h" +#include <gtkmm/action.h> + namespace ZoomEdit { namespace Gui { -Window::Window(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml> &xml) +Window::Window(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder) : Gtk::Window(cobject) { - xml->connect_clicked("MenuItemQuit", sigc::mem_fun(this, &Window::hide)); - xml->get_widget_derived("RenderArea", renderArea); - xml->get_widget_derived("MapArea", mapArea); - xml->get_widget_derived("AspectFrameMap", aspectFrameMap); + Glib::RefPtr<Gtk::Action> itemQuit = Glib::RefPtr<Gtk::Action>::cast_dynamic(builder->get_object("MenuItemQuit")); + if(itemQuit) { + itemQuit->signal_activate().connect(sigc::mem_fun(this, &Window::hide)); + } + + builder->get_widget_derived("RenderArea", renderArea); + builder->get_widget_derived("MapArea", mapArea); + builder->get_widget_derived("AspectFrameMap", aspectFrameMap); } Window::~Window() { diff --git a/src/Gui/Window.h b/src/Gui/Window.h index a0934f5..97ebcda 100644 --- a/src/Gui/Window.h +++ b/src/Gui/Window.h @@ -20,8 +20,8 @@ #ifndef ZOOMEDIT_GUI_WINDOW_H_ #define ZOOMEDIT_GUI_WINDOW_H_ +#include <gtkmm/builder.h> #include <gtkmm/window.h> -#include <libglademm/xml.h> namespace ZoomEdit { namespace Gui { @@ -35,7 +35,7 @@ class Window : public Gtk::Window { AspectFrame *aspectFrameMap; public: - Window(BaseObjectType *cobject, const Glib::RefPtr<Gnome::Glade::Xml> &xml); + Window(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &builder); virtual ~Window(); RenderArea* getRenderArea() const {return renderArea;} |