Difference between revisions of "Features/GTK3/Porting/InfoSlicer"

From Sugar Labs
< Features‎ | GTK3‎ | Porting
Jump to navigation Jump to search
Line 27: Line 27:
 
  from gi.repository import GObject
 
  from gi.repository import GObject
 
  GObject.threads_init()
 
  GObject.threads_init()
 +
 +
= Missing / Problematic things (not ported yet) =
 +
 +
* Select text from the ''Edit View'' (TextView) and the Home View. This error happens in many places of the code.
 +
** http://developer.gnome.org/gdk3/stable/gdk3-Event-Structures.html#GdkEventMotion
 +
 +
Traceback (most recent call last):
 +
  File "/home/humitos/Activities/InfoSlicer.activity/infoslicer/widgets/Readonly_Textbox.py", line 116, in motion_notify
 +
    self.emit("motion-notify-event", event)
 +
TypeError: could not convert type EventMotion to GdkEvent required for parameter 0
  
 
= Useful links =
 
= Useful links =
  
 
* Ticket that removes hippo and sugar-port: http://bugs.sugarlabs.org/ticket/3743
 
* Ticket that removes hippo and sugar-port: http://bugs.sugarlabs.org/ticket/3743

Revision as of 12:16, 4 July 2012

This page is being performed while I'm porting InfoSlicer Activity to Gtk3.

There is a ticket with some useful information that I'm using on the porting and to keep tracking this port. Besides, this wiki page will be useful to write some code snippets about what are the difficulties that I'm having on the port and maybe can be useful for someone else.

I will take this guide as reference on the Gtk3 porting.

Remove hippo

First of all, I had to remove the hippo related things and the sugar-port (ticket) wrapper.

Signals

Change TYPE_PYOBJECT type from a signal

We should replace the TYPE_PYOBJECT

'article-selected' : (SIGNAL_RUN_FIRST, None, [TYPE_PYOBJECT]),

by the Python's object type

'article-selected' : (GObject.SignalFlags.RUN_FIRST, None, [object]),

Working with threads

InfoSlicer uses threads to retrieve the information from internet (Wikipedia articles). The pygi script will replace it by Gdk.threads_init() by I found this is not the correct way to do this. In fact, I was dealing with some strange behaviour of the Activity because of this. So, I used:

from gi.repository import GObject
GObject.threads_init()

Missing / Problematic things (not ported yet)

Traceback (most recent call last):
  File "/home/humitos/Activities/InfoSlicer.activity/infoslicer/widgets/Readonly_Textbox.py", line 116, in motion_notify
    self.emit("motion-notify-event", event)
TypeError: could not convert type EventMotion to GdkEvent required for parameter 0

Useful links