[Sugar-devel] [PATCH Terminal 1/2] GTK3 Port start

Manuel Kaufmann humitos at gmail.com
Tue May 15 09:54:57 EDT 2012


Hello,

Thanks a lot for this patch!

On Mon, May 14, 2012 at 4:32 PM, Agustin Zubiaga <aguz at sugarlabs.org> wrote:
> Pending:
>  * Scrollbar is changing the size

I think this is fixed with my above comment

> +from gi.repository import Gtk, Gdk

For convention we are using one import per line:

from gi.repository import Gtk
from gi.repository import Gdk

> +from gi.repository import Vte

NOTE: to run this version of Terminal in Debian with jhbuild you have
to install this package: gir1.2-vte-2.90. I installed it from:
http://ftp.us.debian.org/debian/ testing/main gir1.2-vte-2.90 i386
1:0.32.1-1

> -        vt.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_DROP,
> -               [('text/plain', 0, 0), ('STRING', 0, 1)],
> -               gtk.gdk.ACTION_DEFAULT |
> -               gtk.gdk.ACTION_COPY)
> -        vt.connect('drag_data_received', self.__drag_data_received_cb)
> +        #vt.drag_dest_set(Gtk.DestDefaults.MOTION | Gtk.DestDefaults.DROP,
> +        #       [('text/plain', 0, 0), ('STRING', 0, 1)],
> +        #       Gdk.DragAction.DEFAULT |
> +        #       Gdk.DragAction.COPY)
> +        #vt.connect('drag_data_received', self.__drag_data_received_cb)

Why these lines are commented?


> -        scrollbar = gtk.VScrollbar(vt.get_adjustment())
> +        scrollbar = Gtk.VScrollbar(vt.get_vadjustment())

I don't know why (yet) but I'm getting this error on Fedora 16 with
jhbuild: http://fpaste.org/iyeO/

I don't have this problem with Debian Testing.

> -        box = gtk.HBox()
> -        box.pack_start(vt)
> -        box.pack_start(scrollbar)
> +        box = Gtk.HBox()
> +        box.pack_start(vt, True, True, 0)
> +        box.pack_start(scrollbar, True, True, 0)

Here, you should pass False to the last box.pack_start:

box.pack_start(scrollbar, False, True, 0)

This is because you don't want to expand the ScrollBar, we want to put
it just on the right of the screen.

With True when a new tab is opened you will see a portion of the
screen that is not used by Vte, instead it is used by the ScrollBar
and if you open a new tab and switch between them many times you will
get the correct proportion :)

Reviewed-by: Manuel Kaufmann <humitos at gmail.com>

-- 
Kaufmann Manuel
Blog: http://humitos.wordpress.com/
Porfolio: http://fotos.mkaufmann.com.ar/
PyAr: http://www.python.com.ar/


More information about the Sugar-devel mailing list