Back to index

python3.2  3.2.2
Public Member Functions | Private Attributes | Static Private Attributes
pynche.ChipViewer.ChipWidget Class Reference

List of all members.

Public Member Functions

def __init__
def set_color
def get_color
def set_name
def set_message
def press
def release

Private Attributes

 __label
 __chip
 __namevar
 __name
 __msgvar

Static Private Attributes

int _WIDTH = 150
int _HEIGHT = 80

Detailed Description

Definition at line 20 of file ChipViewer.py.


Constructor & Destructor Documentation

def pynche.ChipViewer.ChipWidget.__init__ (   self,
  master = None,
  width = _WIDTH,
  height = _HEIGHT,
  text = 'Color',
  initialcolor = 'blue',
  presscmd = None,
  releasecmd = None 
)

Definition at line 31 of file ChipViewer.py.

00031 
00032                  releasecmd = None):
00033         # create the text label
00034         self.__label = Label(master, text=text)
00035         self.__label.grid(row=0, column=0)
00036         # create the color chip, implemented as a frame
00037         self.__chip = Frame(master, relief=RAISED, borderwidth=2,
00038                             width=width,
00039                             height=height,
00040                             background=initialcolor)
00041         self.__chip.grid(row=1, column=0)
00042         # create the color name
00043         self.__namevar = StringVar()
00044         self.__namevar.set(initialcolor)
00045         self.__name = Entry(master, textvariable=self.__namevar,
00046                             relief=FLAT, justify=CENTER, state=DISABLED,
00047                             font=self.__label['font'])
00048         self.__name.grid(row=2, column=0)
00049         # create the message area
00050         self.__msgvar = StringVar()
00051         self.__name = Entry(master, textvariable=self.__msgvar,
00052                             relief=FLAT, justify=CENTER, state=DISABLED,
00053                             font=self.__label['font'])
00054         self.__name.grid(row=3, column=0)
00055         # set bindings
00056         if presscmd:
00057             self.__chip.bind('<ButtonPress-1>', presscmd)
00058         if releasecmd:
00059             self.__chip.bind('<ButtonRelease-1>', releasecmd)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 63 of file ChipViewer.py.

00063 
00064     def get_color(self):
00065         return self.__chip['background']

Definition at line 72 of file ChipViewer.py.

00072 
00073     def press(self):
00074         self.__chip.configure(relief=SUNKEN)

Definition at line 75 of file ChipViewer.py.

00075 
00076     def release(self):
00077         self.__chip.configure(relief=RAISED)
00078 
00079 


Here is the caller graph for this function:

def pynche.ChipViewer.ChipWidget.set_color (   self,
  color 
)

Definition at line 60 of file ChipViewer.py.

00060 
00061     def set_color(self, color):
00062         self.__chip.config(background=color)

def pynche.ChipViewer.ChipWidget.set_message (   self,
  message 
)

Definition at line 69 of file ChipViewer.py.

00069 
00070     def set_message(self, message):
00071         self.__msgvar.set(message)

def pynche.ChipViewer.ChipWidget.set_name (   self,
  colorname 
)

Definition at line 66 of file ChipViewer.py.

00066 
00067     def set_name(self, colorname):
00068         self.__namevar.set(colorname)


Member Data Documentation

Definition at line 36 of file ChipViewer.py.

Definition at line 33 of file ChipViewer.py.

Definition at line 49 of file ChipViewer.py.

Definition at line 44 of file ChipViewer.py.

Definition at line 42 of file ChipViewer.py.

int pynche.ChipViewer.ChipWidget._HEIGHT = 80 [static, private]

Definition at line 22 of file ChipViewer.py.

int pynche.ChipViewer.ChipWidget._WIDTH = 150 [static, private]

Definition at line 21 of file ChipViewer.py.


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