Module dgstuff :: Class dgmenu
[frames] | no frames]

Class dgmenu

source code


Instance Methods
 
__init__(self, data) (Inherited from dgstuff.dgstuff) source code
 
addItem(self, index, **keys)
An item is a clickable label that fires a callback.
source code
 
butenex(self, evt, index, pos)
Hilight management entering and exiting w/ the mouse pointer (Inherited from dgstuff.dgscroll)
source code
 
dbgprint(self, msg) (Inherited from dgstuff.dgstuff) source code
 
finish(self) (Inherited from dgstuff.dgscroll) source code
 
onClick(self, *value)
Common callback for all the items with no specific callback defined (to be overriden) (Inherited from dgstuff.dgscroll)
source code
 
pause(self)
pause the menu controls (Inherited from dgstuff.dgscroll)
source code
 
play(self)
(re)start the menu controls (Inherited from dgstuff.dgscroll)
source code
 
scrollindex(self, delta) (Inherited from dgstuff.dgscroll) source code
 
settexture(self, model, texture=None, wrapmode='clamp', scale=None)
Apply a texture over the menu panel model and set transparency automatically (Inherited from dgstuff.dgstuff)
source code

Inherited from direct.showbase.DirectObject.DirectObject: accept, acceptOnce, addTask, classTree, detectLeaks, doMethodLater, getAllAccepting, ignore, ignoreAll, isAccepting, isIgnoring, removeAllTasks, removeTask

Method Details

addItem(self, index, **keys)

source code 

An item is a clickable label that fires a callback.

There are 2 possible scenarios:

  • 1 common callback for all (onClick) overridable (defined in the main data, see __init__)
  • 1 custom callback carried on the item via 'callback' data element for each of them will be passed the item index in the list

Note: textfont is mandatorily passed by the caller