[Sugar-devel] [PATCH sugar 1/2] ModalAlert ported to Gtk3

Simon Schampijer simon at schampijer.de
Mon Sep 17 13:14:09 EDT 2012


Thanks, pushed as: 8c661997e6c54139cf98dc7149749388c91d757f

There was as well the window.window -> window.get_window() missing, 
found with my little test:


from gi.repository import Gtk

from jarabe.journal.modalalert import ModalAlert

def _destroy_cb(widget, data=None):
     Gtk.main_quit()

window = ModalAlert()
window.connect("destroy", _destroy_cb)

window.show()
Gtk.main()


On 09/17/2012 06:30 PM, Manuel Kaufmann wrote:
> Gtk.VBox.pack_start() and Gtk.Alignment.new() fixed to run over Gtk3
>
> Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
> ---
>   src/jarabe/journal/modalalert.py | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/src/jarabe/journal/modalalert.py b/src/jarabe/journal/modalalert.py
> index 36f076e..186fd1a 100644
> --- a/src/jarabe/journal/modalalert.py
> +++ b/src/jarabe/journal/modalalert.py
> @@ -56,25 +56,27 @@ class ModalAlert(Gtk.Window):
>           icon = Icon(icon_name='activity-journal',
>                       pixel_size=style.XLARGE_ICON_SIZE,
>                       xo_color=color)
> -        self._vbox.pack_start(icon, False)
> +        self._vbox.pack_start(icon, expand=False, fill=False, padding=0)
>           icon.show()
>
>           self._title = Gtk.Label()
>           self._title.modify_fg(Gtk.StateType.NORMAL,
>                                 style.COLOR_WHITE.get_gdk_color())
>           self._title.set_markup('<b>%s</b>' % _('Your Journal is full'))
> -        self._vbox.pack_start(self._title, False)
> +        self._vbox.pack_start(self._title, expand=False, fill=False, padding=0)
>           self._title.show()
>
>           self._message = Gtk.Label(label=_('Please delete some old Journal'
>                                       ' entries to make space for new ones.'))
>           self._message.modify_fg(Gtk.StateType.NORMAL,
>                                 style.COLOR_WHITE.get_gdk_color())
> -        self._vbox.pack_start(self._message, False)
> +        self._vbox.pack_start(self._message, expand=False,
> +                              fill=False, padding=0)
>           self._message.show()
>
> -        alignment = Gtk.Alignment.new(xalign=0.5, yalign=0.5)
> -        self._vbox.pack_start(alignment, False, True, 0)
> +        alignment = Gtk.Alignment.new(xalign=0.5, yalign=0.5,
> +                                      xscale=0.0, yscale=0.0)
> +        self._vbox.pack_start(alignment, expand=False, fill=True, padding=0)
>           alignment.show()
>
>           self._show_journal = Gtk.Button()
>



More information about the Sugar-devel mailing list