Initial fixes
svn: r20072
This commit is contained in:
@@ -174,23 +174,46 @@ class FanChartWidget(Gtk.Widget):
|
|||||||
"""
|
"""
|
||||||
Overriden method to handle the realize event.
|
Overriden method to handle the realize event.
|
||||||
"""
|
"""
|
||||||
self.set_flags(self.flags() | Gtk.REALIZED)
|
## TODO GTK3: need to create the window correctly
|
||||||
self.window = Gdk.Window(self.get_parent_window(),
|
self.set_flags(self.flags() | self.get_realized())
|
||||||
width=self.allocation.width,
|
attr = Gdk.WindowAttr()
|
||||||
height=self.allocation.height,
|
attr.width = self.allocation.width
|
||||||
window_type=Gdk.WindowType.CHILD,
|
attr.height = self.allocation.height
|
||||||
wclass=Gdk.WindowWindowClass.INPUT_OUTPUT,
|
attr.wclass = Gdk.WindowWindowClass.INPUT_OUTPUT
|
||||||
event_mask=self.get_events() | Gdk.EventMask.EXPOSURE_MASK)
|
attr.window_type = Gdk.WindowType.CHILD
|
||||||
if not hasattr(self.window, "cairo_create"):
|
attr.event_mask = (Gdk.EventMask.ENTER_NOTIFY_MASK |
|
||||||
self.draw_gc = Gdk.GC(self.window,
|
Gdk.EventMask.LEAVE_NOTIFY_MASK)
|
||||||
line_width=5,
|
|
||||||
line_style=Gdk.SOLID,
|
|
||||||
join_style=Gdk.JOIN_ROUND)
|
|
||||||
|
|
||||||
self.window.set_user_data(self)
|
attrmask = (
|
||||||
self.style.attach(self.window)
|
#Gdk.WindowAttributesType.TITLE |
|
||||||
self.style.set_background(self.window, Gtk.StateType.NORMAL)
|
Gdk.WindowAttributesType.X |
|
||||||
self.window.move_resize(*self.allocation)
|
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):
|
def do_size_request(self, requisition):
|
||||||
"""
|
"""
|
||||||
@@ -564,6 +587,14 @@ class FanChartWidget(Gtk.Widget):
|
|||||||
self.queue_draw()
|
self.queue_draw()
|
||||||
return True
|
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):
|
class FanChartView(NavigationView):
|
||||||
"""
|
"""
|
||||||
The Gramplet code that realizes the FanChartWidget.
|
The Gramplet code that realizes the FanChartWidget.
|
||||||
@@ -977,3 +1008,4 @@ class FanChartView(NavigationView):
|
|||||||
menu.append(item)
|
menu.append(item)
|
||||||
menu.popup(None, None, None, None, event.button, event.time)
|
menu.popup(None, None, None, None, event.button, event.time)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user