diff options
author | C. Scott Ananian <cscott@laptop.org> | 2008-09-19 15:17:05 (GMT) |
---|---|---|
committer | C. Scott Ananian <cscott@laptop.org> | 2008-09-19 15:18:36 (GMT) |
commit | d16334a042764019701bc699948bad25eaca7f38 (patch) | |
tree | 90cc7edd2ac2b7175467a7718a621aea5530ae48 /src | |
parent | 1406e5f8b74d3ec3a25192965014914e439d6e48 (diff) |
Trac #8563: sugar palette doesn't handle 'table menus'.
The gtk Menu class supports 'table menus', where the menu entries can
be laid out in a grid. This is useful for horizontal menus, and for
dense menus of icons, and for wrapping the menu when it gets too long,
etc.
The Menu.attach() method is used to add entries to a menu by row and
column:
http://www.pygtk.org/docs/pygtk/class-gtkmenu.html#method-gtkmenu--attach
However, the callback in _Menu, defined in palette.py, only triggers
on do_insert(), and so the signal emission (and subsequent
palette._update_separators() call, which places the line underneath
the menu title text at top) never occurs when you add entries using
attach(). _Menu now overrides attach() and emits the proper signal.
Diffstat (limited to 'src')
-rw-r--r-- | src/sugar/graphics/palette.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py index 0b7a268..daf9e58 100644 --- a/src/sugar/graphics/palette.py +++ b/src/sugar/graphics/palette.py @@ -673,6 +673,13 @@ class _Menu(_sugarext.Menu): self.emit('item-inserted') self.show() + def attach(self, child, left_attach, right_attach, + top_attach, bottom_attach): + _sugarext.Menu.attach(self, child, left_attach, right_attach, + top_attach, bottom_attach) + self.emit('item-inserted') + self.show() + def do_expose_event(self, event): # Ignore the Menu expose, just do the MenuShell expose to prevent any # border from being drawn here. A border is drawn by the palette object |