commit d61727f62fccc090d83881061fba28060942ecdb
parent 3e5a4aa8c3de4b2f1b2aeebee05107a23e380a76
Author: Dan Callaghan <djc@djc.id.au>
Date: Sat, 29 May 2010 15:54:04 +1000
display image
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/MainWindow.cpp b/MainWindow.cpp
@@ -3,6 +3,7 @@
#include "MainWindow.h"
MainWindow::MainWindow(const std::string& path) :
+ image_preview(Gdk::Pixbuf::create_from_file(path, 320, 320)),
model(MetadataTreeModel::create(path)) {
{
@@ -10,13 +11,16 @@ MainWindow::MainWindow(const std::string& path) :
set_title(file->get_basename());
}
+ add(vbox);
+
+ vbox.pack_start(image_preview, Gtk::PACK_SHRINK, 10);
+
tree_view.set_model(model);
tree_view.append_column("Predicate", model->columns.pred_column);
tree_view.append_column("Value", model->columns.value_column);
scrolled.add(tree_view);
-
scrolled.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
- add(scrolled);
+ vbox.pack_start(scrolled, Gtk::PACK_EXPAND_WIDGET);
show_all_children();
diff --git a/MainWindow.h b/MainWindow.h
@@ -5,6 +5,7 @@
#include "MetadataTreeModel.h"
#include <gtkmm/treeview.h>
#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/box.h>
#include <gtkmm/window.h>
class MainWindow : public Gtk::Window {
@@ -14,6 +15,8 @@ public:
virtual ~MainWindow();
private:
+ Gtk::VBox vbox;
+ Gtk::Image image_preview;
Gtk::ScrolledWindow scrolled;
Glib::RefPtr<MetadataTreeModel> model;
Gtk::TreeView tree_view;