Jump to: navigation, search


1,888 bytes added, 08:43, 17 July 2012
Missing things (not ported yet)
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:
should be replaced by:
== Signals ==
=== expose-event ===
This signal was override by '''draw''' and it have to be connected with the method that was connected with the ''expose-event'' before. The method itself does not change but the arguments that it receives do. This is the new definition of the function in my case:
=== size-allocate ===
This signal was used to resize the gtk.DrawingArea every time the window grows and at the startup of the activity. This is useful to re-draw the widget for different resolutions (desktops and XOs for example).
def _configure_event_cb(self, widget, event):
I just used the == Focus == Implode defines a new widget called ''size-allocateGridWidget'' signal and it should be focusable because we want to save the the dimensions of move a cursor with the key arrows on it. So, this widget was using:  self.set_flags(width and heightGtk.CAN_FOCUS), so I can use them later on the  but that method (''set_flags'draw''' signal) is no longer available and we have to replace it by:  self.set_can_focus(True)
def _size_allocate_cb(self, widget, rect): selfAnother thing related with the focus is to know who has the actual focus.width = rect.width self.height = rect.heightIn gtk2 it was done by
= Focus = .focus_child
Replaceand in Gtk3 it should be replaced by .get_focus_child()
by= Handling .svg with rsvg =
self'''rsvg''' is a library to manage ''.svg'' files. The only thing that I found that should be updated is the import and the loading of a rsvg from data.set_can_focus(True)
----Replace the usual import:
import rsgv
by the Gtk3 one:
from gi.repository import Rsvg
This way to load a rsvg from data should be replaced:
by this new way
----= 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) = Notes = * I had to add a third argument (None) to Gtk.Notebook.append_page but I don't know why* Use '''json''' instead of ''simplejson'' or so* Replace <tt>gtk.VISIBLE</tt> by '''Gtk.AccelFlags.focus_childVISIBLE'''
.get_focus_child= Missing things (not ported yet)=
* '''size-allocation' signal is not working. The board is not shown. Do we update this to keep it working? I mean, do we need to save maintain this code?* [<span style="color: green;">DONE</span>] <del>help dialogue is not working. It shows the example board but it's one pixel size of when it opens</del>* When the help dialogue is shown and you hover the animation with the widgetmouse something strange happens and it starts to flap. [ Screenshot]
= gtk signals Useful Links =
* "" * http:/ "expose" / "****"page

Navigation menu