Changes

Jump to navigation Jump to search
Line 82: Line 82:     
The last argument of the signal definition are the argument types that the callback will receive. For example, that tuple could be (str, int) if the callback receives two arguments, a string and an integer (first and second argument position)
 
The last argument of the signal definition are the argument types that the callback will receive. For example, that tuple could be (str, int) if the callback receives two arguments, a string and an integer (first and second argument position)
 +
 +
== Access to the ''Window'' instance ==
 +
 +
<tt>sugar3.activity.Activity</tt> doesn't have the ''window'' attribute anymore instead of this it has the <tt>.get_window()</tt> method that do the same thing. So, you should change all the occurrences of them.
 +
 +
== Change the mouse cursor ==
 +
 +
The ''window'' attribute that I mention before is used to set the mouse cursor. This is used when the activity is working on the background (maybe searching something on the Internet) and we want to show a ''work in progress'' cursor for example.
 +
 +
The old way to set the cursor is:
 +
 +
self.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
 +
 +
And it should be replaced by the new one:
 +
 +
from gi.repository import Gdk
 +
self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
 +
 +
In that case we are creating a new instance of <tt>Gdk.Cursor</tt> every time that this chunk of code is called. I think that we could define all the cursor used by the Activity once at the beginning of the file maybe. ''We should discuss about this.''
    
= References / Useful links =
 
= References / Useful links =
266

edits

Navigation menu