summaryrefslogtreecommitdiffstats
path: root/grapher/grapher.cxx
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-07-29 13:11:10 +0200
committerTim Moore <timoore@redhat.com>2009-09-30 20:25:36 +0200
commitbb91631807ad833a92d011895ad7ca1872e02745 (patch)
treecf3c8f2611a27ade0f0b792c40a0533dc030145e /grapher/grapher.cxx
parent27993a166c3ff2c33f778da4d96726666aadfab9 (diff)
downloadsystemtap-steved-bb91631807ad833a92d011895ad7ca1872e02745.tar.gz
systemtap-steved-bb91631807ad833a92d011895ad7ca1872e02745.tar.xz
systemtap-steved-bb91631807ad833a92d011895ad7ca1872e02745.zip
Draw multiple graphs
* grapher/Graph.cxx (Graph constructor): Initialize graph dimensions. (draw): Don't clear the drawing area. * grapher/GraphWidget.hxx (GraphWidget): Add dimensions and on_size_request() method. * grapher/GraphWidget.cxx (GraphWidget constructor): Initialize dimensions. (addGraph): New method. (on_size_request): New method to pass widget's size to parent widgets * grapher/grapher.cxx (GrapherWindow constructor): add "add graph" action. (addGraph): New method.
Diffstat (limited to 'grapher/grapher.cxx')
-rw-r--r--grapher/grapher.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx
index 95ac232d..ad7023f2 100644
--- a/grapher/grapher.cxx
+++ b/grapher/grapher.cxx
@@ -32,6 +32,7 @@ public:
GraphWidget w;
protected:
virtual void on_menu_file_quit();
+ void addGraph();
// menu support
Glib::RefPtr<Gtk::UIManager> m_refUIManager;
Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
@@ -48,6 +49,8 @@ GrapherWindow::GrapherWindow()
m_refActionGroup = Gtk::ActionGroup::create();
//File menu:
m_refActionGroup->add(Gtk::Action::create("FileMenu", "File"));
+ m_refActionGroup->add(Gtk::Action::create("AddGraph", "Add graph"),
+ sigc::mem_fun(*this, &GrapherWindow::addGraph));
m_refActionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT),
sigc::mem_fun(*this, &GrapherWindow::on_menu_file_quit));
m_refUIManager = Gtk::UIManager::create();
@@ -59,6 +62,7 @@ GrapherWindow::GrapherWindow()
"<ui>"
" <menubar name='MenuBar'>"
" <menu action='FileMenu'>"
+ " <menuitem action='AddGraph'/>"
" <menuitem action='FileQuit'/>"
" </menu>"
" </menubar>"
@@ -136,3 +140,9 @@ int main(int argc, char** argv)
;
return 0;
}
+
+void GrapherWindow::addGraph()
+{
+ w.addGraph();
+
+}