modules::clMenu::Menu Class Reference

a gtk.MenuBar with some additional functions for creating menus More...

List of all members.

Public Member Functions

def __init__
 The Constructor.
def get_rootmenu
 Find a Rootmenu.
def get_submenu
 Find a Menuitem.
def append_root
 Add a menu to the end of the menubar.
def prepend_root
 Add a menu to the start of the menubar.
def insert_root_pos
 Inserts a Menu at a particular position.
def insert_root_after
 Inserts a Menu after another rootmenu.
def insert_root_before
 Inserts a Menu before another rootmenu.
def set_item_image
 Sets an image for a gtk.ImageMenuItem.
def create_submenu
 Creates and populates a submenu from a list of items.
def append_entry
 Appends an gtk.ImageMenuItem to a Menu.
def insert_entry
 Inserts an gtk.ImageMenuItem into a Menu.
def cb_developer
 Called when the developer MenuItem was clicked.
def cb_trans
 Called when the translation MenuItem was clicked.
def cb_report
 Called when the report-a-bug MenuItem was clicked.
def ev_help
 Called when the help MenuItem was clicked.
def on_bFullScreen_clicked
 Called when the Fullscreen MenuItem was clicked.

Public Attributes

 pyjama
 Pyjama reference.
 bolFullScreen
 Fullscreen indicator.
 rootmenus
 Dictionary holding all root menus.
 submenus
 Dictionary holding all Menuitems.


Detailed Description

a gtk.MenuBar with some additional functions for creating menus

Definition at line 32 of file clMenu.py.


Member Function Documentation

def modules::clMenu::Menu::__init__ (   self,
  window 
)

The Constructor.

Parameters:
self Object Pointer
window Reference to pyjama's window class

Definition at line 36 of file clMenu.py.

def modules::clMenu::Menu::append_entry (   self,
  rootmenu,
  name,
  id 
)

Appends an gtk.ImageMenuItem to a Menu.

Parameters:
self Object Pointer
rootmenu The rootmenu which submenu is going to be extended
name The name of the appended item. If the name is "---" a gtkSeperatorMenuItem will be created
id Identifier of the appended item
Returns:
a gtk.ImageMenuItem

Definition at line 307 of file clMenu.py.

def modules::clMenu::Menu::append_root (   self,
  name,
  id 
)

Add a menu to the end of the menubar.

Parameters:
self Object Pointer
name Name of the menu to create
id Identifier of the menu to create
Returns:
A gtk.MenuItem

Definition at line 175 of file clMenu.py.

def modules::clMenu::Menu::cb_developer (   self,
  widget 
)

Called when the developer MenuItem was clicked.

Parameters:
Object Pointer
widget The MenuItem clicked

Definition at line 349 of file clMenu.py.

def modules::clMenu::Menu::cb_report (   self,
  widget 
)

Called when the report-a-bug MenuItem was clicked.

Parameters:
Object Pointer
widget The MenuItem clicked

Definition at line 361 of file clMenu.py.

def modules::clMenu::Menu::cb_trans (   self,
  widget 
)

Called when the translation MenuItem was clicked.

Parameters:
Object Pointer
widget The MenuItem clicked

Definition at line 355 of file clMenu.py.

def modules::clMenu::Menu::create_submenu (   self,
  rootmenu,
  submenu 
)

Creates and populates a submenu from a list of items.

Parameters:
self Object Pointer
rootmenu The menu which gets the submenu
submenu A list with Strings. For "---" strings a gtkSeperatorMenuItem will be created
Returns:
A gtk.Menu

Definition at line 282 of file clMenu.py.

def modules::clMenu::Menu::ev_help (   self,
  widget 
)

Called when the help MenuItem was clicked.

Parameters:
Object Pointer
widget The MenuItem clicked

Definition at line 367 of file clMenu.py.

def modules::clMenu::Menu::get_rootmenu (   self,
  name 
)

Find a Rootmenu.

Parameters:
self Object Pointer
name Root menu's name
Returns:
gtk.MenuItem

Definition at line 149 of file clMenu.py.

def modules::clMenu::Menu::get_submenu (   self,
  name 
)

Find a Menuitem.

Parameters:
self Object Pointer
name Submenu's name
Returns:
gtk.ImageMenuItem

Definition at line 160 of file clMenu.py.

def modules::clMenu::Menu::insert_entry (   self,
  pos,
  rootmenu,
  name,
  id 
)

Inserts an gtk.ImageMenuItem into a Menu.

Parameters:
self Object Pointer
pos Position
rootmenu The rootmenu which submenu is going to be extended
name The name of the inserted item. If the name is "---" a gtkSeperatorMenuItem will be created
id Identifier of the appended item
Returns:
a gtk.ImageMenuItem

Definition at line 329 of file clMenu.py.

def modules::clMenu::Menu::insert_root_after (   self,
  after,
  name,
  id 
)

Inserts a Menu after another rootmenu.

Parameters:
self Object Pointer
after Name of a rootmenu
name Name of the menu to create
id Identifier of the menu to create
Returns:
A gtk.MenuItem

Definition at line 225 of file clMenu.py.

def modules::clMenu::Menu::insert_root_before (   self,
  before,
  name,
  id 
)

Inserts a Menu before another rootmenu.

Parameters:
self Object Pointer
before Name of a rootmenu
name Name of the menu to create
id Identifier of the menu to create
Returns:
A gtk.MenuItem

Definition at line 237 of file clMenu.py.

def modules::clMenu::Menu::insert_root_pos (   self,
  pos,
  name,
  id 
)

Inserts a Menu at a particular position.

Parameters:
self Object Pointer
pos Position of the menu to create
name Name of the menu to create
id Identifier of the menu to create
Returns:
A gtk.MenuItem

Definition at line 208 of file clMenu.py.

def modules::clMenu::Menu::on_bFullScreen_clicked (   self,
  widget = None 
)

Called when the Fullscreen MenuItem was clicked.

If you want to switch to Fullscreen, this methode might help.

Parameters:
self Object Pointer
widget The MenuItem clicked

Definition at line 375 of file clMenu.py.

def modules::clMenu::Menu::prepend_root (   self,
  name,
  id 
)

Add a menu to the start of the menubar.

Parameters:
self Object Pointer
name Name of the menu to create
id Identifier of the menu to create
Returns:
A gtk.MenuItem

Definition at line 191 of file clMenu.py.

def modules::clMenu::Menu::set_item_image (   self,
  menuitem,
  image,
  size = gtk.ICON_SIZE_MENU 
)

Sets an image for a gtk.ImageMenuItem.

Strings and gtk.STOCK_ICONs allowed for image.

Parameters:
self Object Pointer
submenu A gtk.MenuItem
image A gtk.STOCK_IMAGE or an URI for a local file
size A gtk.STOCK_SIZE
Returns:
None
Todo:
Allowing size also being a 2-tuple containing width and height

Definition at line 257 of file clMenu.py.


The documentation for this class was generated from the following file:

Generated on Thu Jun 4 19:08:24 2009 for Pyjama by  doxygen 1.5.8