diff options
author | jblum | 2009-05-14 21:18:28 +0000 |
---|---|---|
committer | jblum | 2009-05-14 21:18:28 +0000 |
commit | 65446f553650a464fabf2bc4edf66a044e67b338 (patch) | |
tree | 705fc594b264cdf01549ee7f386ecaf967bf84e5 /grc/src/gui/NotebookPage.py | |
parent | 30e9c0d1d47f1e4200afd6abf955271609dbbdc3 (diff) | |
download | gnuradio-65446f553650a464fabf2bc4edf66a044e67b338.tar.gz gnuradio-65446f553650a464fabf2bc4edf66a044e67b338.tar.bz2 gnuradio-65446f553650a464fabf2bc4edf66a044e67b338.zip |
Create one drawing area per flowgraph/notebook page.
Previously, there was one global drawing area, and empty notebook pages.
This has the advantage of saving the scroll position though mutiple scroll windows,
rendering the flow graph only when the notebook page is realized,
and proper use + appearance of the gtk notebook
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11030 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/gui/NotebookPage.py')
-rw-r--r-- | grc/src/gui/NotebookPage.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/grc/src/gui/NotebookPage.py b/grc/src/gui/NotebookPage.py index 50a1216f9..0d6a4a87c 100644 --- a/grc/src/gui/NotebookPage.py +++ b/grc/src/gui/NotebookPage.py @@ -24,6 +24,8 @@ import gtk from .. utils import ParseXML from StateCache import StateCache from .. platforms.base.Constants import FLOW_GRAPH_DTD +from Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT +from DrawingArea import DrawingArea import os ############################################################ @@ -56,7 +58,6 @@ class NotebookPage(gtk.HBox): self.set_saved(True) #import the data to the flow graph self.get_flow_graph().import_data(initial_state) - self.get_flow_graph().update() #initialize page gui gtk.HBox.__init__(self, False, 0) self.show() @@ -81,6 +82,18 @@ class NotebookPage(gtk.HBox): button.set_size_request(w+6, h+6) self.tab.pack_start(button, False) self.tab.show_all() + #setup scroll window and drawing area + self.scrolled_window = gtk.ScrolledWindow() + self.scrolled_window.set_size_request(MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT) + self.scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + self.drawing_area = DrawingArea(self.get_flow_graph()) + self.scrolled_window.add_with_viewport(self.get_drawing_area()) + self.pack_start(self.scrolled_window) + #inject drawing area and handle states into flow graph + self.get_flow_graph().drawing_area = self.get_drawing_area() + self.show_all() + + def get_drawing_area(self): return self.drawing_area def get_generator(self): """ |