~rockstar/entertainer/package-structure-apocalypse

« back to all changes in this revision

Viewing changes to entertainerlib/gui/widgets/text_menu.py

  • Committer: Paul Hummer
  • Date: 2009-05-10 17:36:49 UTC
  • mfrom: (360.1.3 entertainer-future)
  • Revision ID: paul@eventuallyanyway.com-20090510173649-0odjpoqifn303t46
Merged from entertainer-future

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2009 Entertainer Developers - See COPYING - GPLv2
1
2
'''Implements basic menu that contains text labels as menuitems'''
2
3
 
3
 
__licence__ = "GPLv2"
4
 
__copyright__ = "2007, Lauri Taimila"
5
 
__author__ = "Lauri Taimila <lauri@taimila.com>"
6
 
 
7
4
from entertainerlib.gui.widgets.selector import Selector
8
5
from entertainerlib.gui.widgets.grid_menu import GridMenu
9
6
 
 
7
 
10
8
class TextMenu(GridMenu):
11
9
    """
12
10
    TextMenu widget
60
58
    def get_index(self, text):
61
59
        """
62
60
        Returns index of label with the text as passed, returns -1 if not found
63
 
        @author Joshua Scotton
64
61
        """
65
62
        for item in self.items:
66
63
            if item.label.get_text() == text: