[Sugar-devel] [PATCH sugar-toolkit-gtk3] Make sure we have a widget before attaching an invoker, SL #3460

Manuel Quiñones manuq at laptop.org
Wed Jun 6 08:51:57 EDT 2012


2012/6/6 Simon Schampijer <simon at schampijer.de>:
> The _ToolbarPalette does get passed the invoker on
> initialisation. But we do create the PaletteWindowWidget
> later. We do attach the invoker to the widget when calling
> _setup_widget that is why it was still working without that
> patch.
>
> This patch prevents the traceback that we had because of not
> having a widget at this point.

This one looks good too, solves #3460 for me.

> Signed-off-by: Simon Schampijer <simon at laptop.org>

Tested-by: Manuel Quiñones <manuq at laptop.org>

> ---
>  src/sugar3/graphics/palettewindow.py |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
> index c3431b7..2c8816c 100644
> --- a/src/sugar3/graphics/palettewindow.py
> +++ b/src/sugar3/graphics/palettewindow.py
> @@ -498,7 +498,8 @@ class PaletteWindow(GObject.GObject):
>             self._invoker_hids.remove(hid)
>
>         self._invoker = invoker
> -        self._widget.set_invoker(self._invoker)
> +        if self._widget is not None:
> +            self._widget.set_invoker(invoker)
>         if invoker is not None:
>             self._invoker_hids.append(self._invoker.connect(
>                 'mouse-enter', self._invoker_mouse_enter_cb))
> --
> 1.7.10.2
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
.. manuq ..


More information about the Sugar-devel mailing list