From 08e395bfa31eeb8bd58cb65647c752aaacb8a1ad Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Thu, 11 Dec 2008 22:04:45 +0000 Subject: [PATCH] Adding window resizing to suppress scrollbar. svn: r11457 --- src/DataViews/GeoView.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/DataViews/GeoView.py b/src/DataViews/GeoView.py index 7ac6ab5eb..97a4fec9b 100644 --- a/src/DataViews/GeoView.py +++ b/src/DataViews/GeoView.py @@ -147,9 +147,9 @@ class Renderer(): """ raise NotImplementedError - if (self.browser == 1): + if (self.browser == WEBKIT): self.m.open("file://"+htmlfile) - elif (self.browser == 2): + elif (self.browser == MOZIL): self.m.load_url("file://"+htmlfile) #------------------------------------------------------------------------- @@ -399,16 +399,23 @@ class GeoView(PageView.PersonNavView): #def change_page(self): # self.uistate.clear_filter_results() - def init_parent_signals_cb(self, widget, event): + def init_parent_signals_for_map(self, widget, event): # required to properly bootstrap the signal handlers. # This handler is connected by build_widget. After the outside ViewManager # has placed this widget we are able to access the parent container. self.notebook.disconnect(self.bootstrap_handler) - self.notebook.parent.connect("size-allocate", self.size_request_cb) - self.size_request_cb(widget.parent,event) + self.notebook.parent.connect("size-allocate", self.size_request_for_map) + self.size_request_for_map(widget.parent,event) + def request_resize(self): + self.size_request_for_map(self.notebook.parent,None,None) + + def size_request_for_map(self, widget, event, data=None): + v = widget.get_allocation() + self.width = v.width + self.height = v.height + def add_table_to_notebook( self, table): - frame = gtk.ScrolledWindow(None,None) frame = gtk.ScrolledWindow(None,None) frame.set_shadow_type(gtk.SHADOW_NONE) frame.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC) @@ -469,6 +476,7 @@ class GeoView(PageView.PersonNavView): self.notebook = gtk.Notebook() self.notebook.set_show_border(False) self.notebook.set_show_tabs(False) + self.bootstrap_handler = self.notebook.connect("size-request", self.init_parent_signals_for_map) self.table_2 = gtk.Table(1,1,False) self.add_table_to_notebook( self.table_2) @@ -870,7 +878,7 @@ class GeoView(PageView.PersonNavView): def create_markers(self,format): self.centered = 0 - self.geo += "
\n" % 600 + self.geo += "
\n" % ( ( self.width - 20 ), ( self.height - 150 )) self.geo += "