The accelerator is not implemented in gtk.ToolButton, but in sugar.graphics.toolbutton ToolButton.<div>I think we need implement the same in sugar.graphics.toogletoolbutton ToggleToolButton,</div><div>but the code is a little complex (and we have bugs related to this), </div>
<div>then may be is better try to refactor ToolButton a little to allow share </div><div>the needed functionality.</div><div>May be is better look at this in 0.98</div><div><br></div><div>Gonzalo </div><div><br><div class="gmail_quote">
On Thu, May 31, 2012 at 1:33 PM, Manuel Kaufmann <span dir="ltr"><<a href="mailto:humitos@gmail.com" target="_blank">humitos@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, May 31, 2012 at 10:42 AM, Gary Martin<br>
<<a href="mailto:garycmartin@googlemail.com">garycmartin@googlemail.com</a>> wrote:<br>
> Not that this helps much ;-)<br>
<br>
</div>Thanks for your answer.<br>
<br>
I was looking at the code and I was thinking if this could be solved<br>
in Gtk3. I found that Gtk.ToggleToolButton inherits from<br>
Gtk.ToolButton[1]. So, it seems that now we are able to use<br>
<br>
ToggleToolButton.props.accelerator = '<Ctrl>B'<br>
<br>
to set the accelerator key.<br>
<br>
But unfortunately that doesn't work. I did a quick test with Read<br>
activity (that it's already ported to Gtk3) and I used the Bookmark<br>
button (it's a ToggleToolButton) but I get a similar error than in<br>
Gtk2. I don't understand why, because it inherits from Gtk.ToolButton<br>
and Gtk.ToolButton has that property :(<br>
<br>
Traceback (most recent call last):<br>
File "/srv/sugar-jhbuild/install/bin/sugar-activity", line 146, in <module><br>
main()<br>
File "/srv/sugar-jhbuild/install/bin/sugar-activity", line 141, in main<br>
instance = create_activity_instance(activity_constructor, activity_handle)<br>
File "/srv/sugar-jhbuild/install/bin/sugar-activity", line 34, in<br>
create_activity_instance<br>
activity = constructor(handle)<br>
File "/home/humitos/Activities/Read.activity/readactivity.py", line<br>
223, in __init__<br>
self._bookmarker.props.accelerator = '<Ctrl>D'<br>
AttributeError: 'gi._gobject.GProps' object has no attribute 'accelerator'<br>
<br>
[1] <a href="http://developer.gnome.org/gtk3/3.2/GtkToggleToolButton.html" target="_blank">http://developer.gnome.org/gtk3/3.2/GtkToggleToolButton.html</a><br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Kaufmann Manuel<br>
Blog: <a href="http://humitos.wordpress.com/" target="_blank">http://humitos.wordpress.com/</a><br>
Porfolio: <a href="http://fotos.mkaufmann.com.ar/" target="_blank">http://fotos.mkaufmann.com.ar/</a><br>
PyAr: <a href="http://www.python.com.ar/" target="_blank">http://www.python.com.ar/</a><br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</div></div></blockquote></div><br></div>