Line 4: |
Line 4: |
| | | |
| I will take [[User:Humitos/PortingGetBooks|this guide]] as reference on the Gtk3 porting. | | I will take [[User:Humitos/PortingGetBooks|this guide]] as reference on the Gtk3 porting. |
| + | |
| + | = Code Snippets = |
| + | |
| + | == Gtk.Scale == |
| + | |
| + | Replace: |
| + | |
| + | self.hscale = gtk.HScale(self.adjustment) |
| + | |
| + | with: |
| + | |
| + | self.hscale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, |
| + | adjustment=self.adjustment) |
| + | |
| + | == GtkWindow.xid == |
| + | |
| + | The way to access to the "window" attribute changed and the way to access to "xid" as well. So, |
| + | |
| + | Replace: |
| + | |
| + | self.videowidget_xid = videowidget.window.xid |
| + | |
| + | with: |
| + | |
| + | self.videowidget_xid = videowidget.get_window().get_xid() |
| + | |
| + | ''NOTE: this is used to insert the animation window inside a widget instead opening a new window'' |
| + | |
| + | == Gtk.DrawingArea's flags == |
| + | |
| + | Replace: |
| + | |
| + | self.unset_flags(gtk.DOUBLE_BUFFERED) |
| + | self.set_flags(gtk.APP_PAINTABLE) |
| + | |
| + | with: |
| + | |
| + | self.set_app_paintable(True) |
| + | self.set_double_buffered(False) |
| + | |
| + | == Gtk.TreeView == |
| + | |
| + | * http://python-gtk-3-tutorial.readthedocs.org/en/latest/treeview.html |
| + | |
| + | Access to a particular row: |
| + | |
| + | Replaced: |
| + | |
| + | media_idx = path[COLUMNS['index']] |
| + | |
| + | with: |
| + | |
| + | treeiter = model.get_iter(path) |
| + | media_idx = model.get_value(treeiter, COLUMNS['index']) |
| + | |
| + | |
| + | Same here: |
| + | |
| + | self._playlist.pop(row[0]) |
| + | |
| + | replaced with: |
| + | |
| + | index = sel_model.get_value(sel_model.get_iter(row), 0) |
| + | self._playlist.pop(index) |
| | | |
| = Useful Links = | | = Useful Links = |
| | | |
| * https://wiki.ubuntu.com/Novacut/GStreamer1.0 | | * https://wiki.ubuntu.com/Novacut/GStreamer1.0 |
| + | * https://live.gnome.org/GnomeGoals/PortToGstreamer1 |
| + | * http://www.spinics.net/lists/fedora-desktop/msg07545.html |