[Sugar-devel] Set accelerator in gtk.ToggleToolButton
gonzalo at laptop.org
Thu May 31 16:18:35 EDT 2012
The accelerator is not implemented in gtk.ToolButton, but in
I think we need implement the same in sugar.graphics.toogletoolbutton
but the code is a little complex (and we have bugs related to this),
then may be is better try to refactor ToolButton a little to allow share
the needed functionality.
May be is better look at this in 0.98
On Thu, May 31, 2012 at 1:33 PM, Manuel Kaufmann <humitos at gmail.com> wrote:
> On Thu, May 31, 2012 at 10:42 AM, Gary Martin
> <garycmartin at googlemail.com> wrote:
> > Not that this helps much ;-)
> Thanks for your answer.
> I was looking at the code and I was thinking if this could be solved
> in Gtk3. I found that Gtk.ToggleToolButton inherits from
> Gtk.ToolButton. So, it seems that now we are able to use
> ToggleToolButton.props.accelerator = '<Ctrl>B'
> to set the accelerator key.
> But unfortunately that doesn't work. I did a quick test with Read
> activity (that it's already ported to Gtk3) and I used the Bookmark
> button (it's a ToggleToolButton) but I get a similar error than in
> Gtk2. I don't understand why, because it inherits from Gtk.ToolButton
> and Gtk.ToolButton has that property :(
> Traceback (most recent call last):
> File "/srv/sugar-jhbuild/install/bin/sugar-activity", line 146, in
> File "/srv/sugar-jhbuild/install/bin/sugar-activity", line 141, in main
> instance = create_activity_instance(activity_constructor,
> File "/srv/sugar-jhbuild/install/bin/sugar-activity", line 34, in
> activity = constructor(handle)
> File "/home/humitos/Activities/Read.activity/readactivity.py", line
> 223, in __init__
> self._bookmarker.props.accelerator = '<Ctrl>D'
> AttributeError: 'gi._gobject.GProps' object has no attribute 'accelerator'
>  http://developer.gnome.org/gtk3/3.2/GtkToggleToolButton.html
> Kaufmann Manuel
> Blog: http://humitos.wordpress.com/
> Porfolio: http://fotos.mkaufmann.com.ar/
> PyAr: http://www.python.com.ar/
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Sugar-devel