Changes

no edit summary
Line 8: Line 8:     
There are some things related with <tt>gtk.DrawingArea</tt> that we have to change when we are porting an activity to Gtk3. The names of the signals change and the way that they work as well.
 
There are some things related with <tt>gtk.DrawingArea</tt> that we have to change when we are porting an activity to Gtk3. The names of the signals change and the way that they work as well.
 +
 +
== Get allocation size ==
 +
 +
''self.allocation'' property is no longer available and we should use <tt>self.get_allocation_width</tt> to get the allocation size:
 +
 +
self.allocation.width
 +
self.allocation.height
 +
 +
should be replaced by:
 +
 +
self.get_allocated_width()
 +
self.get_allocated_height()
    
== Signals ==
 
== Signals ==
Line 70: Line 82:  
  Rsvg.Handle.new_from_data(data)
 
  Rsvg.Handle.new_from_data(data)
    +
= Invalidate rectangle =
 +
 +
<tt>Gdk.Window.invalidate_rect</tt> takes a ''Gdk.Rectangle'' instead a tuple in Gtk3.
 +
 +
rect = Gdk.Rectangle()
 +
rect.x, rect.y, rect.width, rect.height = (0, 0, width, height)
 +
 +
self.get_window().invalidate_rect(rect, True)
    
= Useful Links =
 
= Useful Links =
Line 76: Line 96:  
* http://developer.gnome.org/gtk3/3.5/GtkWidget.html#GtkWidget-configure-event
 
* http://developer.gnome.org/gtk3/3.5/GtkWidget.html#GtkWidget-configure-event
 
* http://developer.gnome.org/rsvg/stable/
 
* http://developer.gnome.org/rsvg/stable/
 +
* http://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-invalidate-rect
 +
* http://developer.gnome.org/gtk3/3.5/GtkWidget.html#gtk-widget-get-allocated-width
266

edits