From 30d33796265ab51dfe58e0981aebc8e28aa69669 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 24 Jul 2012 20:35:22 +0000 Subject: [PATCH] Initial fixes svn: r20072 --- src/plugins/view/fanchartview.py | 64 ++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/src/plugins/view/fanchartview.py b/src/plugins/view/fanchartview.py index ba4a7d51b..54b8183a0 100644 --- a/src/plugins/view/fanchartview.py +++ b/src/plugins/view/fanchartview.py @@ -174,23 +174,46 @@ class FanChartWidget(Gtk.Widget): """ Overriden method to handle the realize event. """ - self.set_flags(self.flags() | Gtk.REALIZED) - self.window = Gdk.Window(self.get_parent_window(), - width=self.allocation.width, - height=self.allocation.height, - window_type=Gdk.WindowType.CHILD, - wclass=Gdk.WindowWindowClass.INPUT_OUTPUT, - event_mask=self.get_events() | Gdk.EventMask.EXPOSURE_MASK) - if not hasattr(self.window, "cairo_create"): - self.draw_gc = Gdk.GC(self.window, - line_width=5, - line_style=Gdk.SOLID, - join_style=Gdk.JOIN_ROUND) + ## TODO GTK3: need to create the window correctly + self.set_flags(self.flags() | self.get_realized()) + attr = Gdk.WindowAttr() + attr.width = self.allocation.width + attr.height = self.allocation.height + attr.wclass = Gdk.WindowWindowClass.INPUT_OUTPUT + attr.window_type = Gdk.WindowType.CHILD + attr.event_mask = (Gdk.EventMask.ENTER_NOTIFY_MASK | + Gdk.EventMask.LEAVE_NOTIFY_MASK) - self.window.set_user_data(self) - self.style.attach(self.window) - self.style.set_background(self.window, Gtk.StateType.NORMAL) - self.window.move_resize(*self.allocation) + attrmask = ( + #Gdk.WindowAttributesType.TITLE | + Gdk.WindowAttributesType.X | + Gdk.WindowAttributesType.Y | + Gdk.WindowAttributesType.CURSOR | + Gdk.WindowAttributesType.VISUAL | + Gdk.WindowAttributesType.NOREDIR + ) + + self.window = Gdk.Window(self.get_parent_window(), + attr, + attrmask) + +### self.window = Gdk.Window(self.get_parent_window(), +### width=self.allocation.width, +### height=self.allocation.height, +### window_type=Gdk.WindowType.CHILD, +### wclass=Gdk.WindowWindowClass.INPUT_OUTPUT, +### event_mask=self.get_events() | Gdk.EventMask.EXPOSURE_MASK) + + #if not hasattr(self.window, "cairo_create"): + # self.draw_gc = Gdk.GC(self.window, + # line_width=5, + # line_style=Gdk.SOLID, + # join_style=Gdk.JOIN_ROUND) + + #self.window.set_user_data(self) + #self.style.attach(self.window) + #self.style.set_background(self.window, Gtk.StateType.NORMAL) + #self.window.move_resize(*self.allocation) def do_size_request(self, requisition): """ @@ -564,6 +587,14 @@ class FanChartWidget(Gtk.Widget): self.queue_draw() return True + def set_flags(self, flags): + ## TODO GTK3: need to set_flags? + pass + + def flags(self): + ## TODO GTK3: need to get flags? + return 0 + class FanChartView(NavigationView): """ The Gramplet code that realizes the FanChartWidget. @@ -977,3 +1008,4 @@ class FanChartView(NavigationView): menu.append(item) menu.popup(None, None, None, None, event.button, event.time) return 1 +