[sugar] keyboard bindings for buttons and palettes

Tomeu Vizoso tomeu at tomeuvizoso.net
Sat Mar 8 11:01:10 EST 2008


On Fri, Feb 29, 2008 at 2:14 PM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
> On Tue, Feb 26, 2008 at 3:35 PM, Marco Pesenti Gritti
>  <mpgritti at gmail.com> wrote:
>  >  >  The bad:
>  >  >
>  >  >  - Every widget will have to listen for 'hierarchy-changed' in order to
>  >  >  set the accelerator for the group of its top level window.
>  >  >
>  >  >  Can anybody think of a better way to do this? If not, I'll come with a
>  >  >  more refined patch and will ask for review. I think accelerators can
>  >  >  improve usability quite a bit.
>  >
>  >  Nothing short of adding this functionality to gtk.
>  >
>  >  We have already a bit of duplicated code between the ToolItems,
>  >  perhaps we can figure out a way to avoid duplication which doesn't
>  >  require inheritance.
>
>  The only option seems to me to be using utility functions :/
>
>  But if the duplicated code doesn't contain much logic, perhaps we can
>  live with that.

Other options are using multiple inheritance or reimplementing
*ToolButton based on a custom BaseToolItem.

Have continued this work in the following two commits:

http://dev.laptop.org/git?p=users/tomeu/sugar-toolkit;a=commit;h=fde28747ae10fdc65bf6da07d40fd68ae11ee84b
http://dev.laptop.org/git?p=users/tomeu/sugar;a=commit;h=5affcc30ff890236d39bdff82fdfcad24d7221f7

Tomeu


More information about the Sugar mailing list