Current File : /home/mmdealscpanel/yummmdeals.com/matt.zip
PK�[�}N�

pong-demo-1.pynu�[���from Tkinter import *

import string


class Pong(Frame):
    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)

        ## The playing field
        self.draw = Canvas(self, width="5i", height="5i")

        ## The speed control for the ball
        self.speed = Scale(self, orient=HORIZONTAL, label="ball speed",
                           from_=-100, to=100)

        self.speed.pack(side=BOTTOM, fill=X)

        # The ball
        self.ball = self.draw.create_oval("0i", "0i", "0.10i", "0.10i",
                                          fill="red")
        self.x = 0.05
        self.y = 0.05
        self.velocity_x = 0.3
        self.velocity_y = 0.5

        self.draw.pack(side=LEFT)

    def moveBall(self, *args):
        if (self.x > 5.0) or (self.x < 0.0):
            self.velocity_x = -1.0 * self.velocity_x
        if (self.y > 5.0) or (self.y < 0.0):
            self.velocity_y = -1.0 * self.velocity_y

        deltax = (self.velocity_x * self.speed.get() / 100.0)
        deltay = (self.velocity_y * self.speed.get() / 100.0)
        self.x = self.x + deltax
        self.y = self.y + deltay

        self.draw.move(self.ball,  "%ri" % deltax, "%ri" % deltay)
        self.after(10, self.moveBall)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()
        self.after(10, self.moveBall)


game = Pong()

game.mainloop()
PK�[��>;��packer-simple.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs|jdGHdS(Ntcommand(thi_there(tself((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pytprintitscCs�t|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�t|dd	�|_|jj�t|dd
�|_	|j	j�dS(NttexttQUITt
foregroundtredRtsidetfilltHellosbutton 2sbutton 3(
tButtontquitRtpacktLEFTtBOTHRRtguy2tguy3(R((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyt
createWidgetss
cCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyRs
N(t__name__t
__module__RRtNoneR(((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyRs		N(tTkinterRRttesttmainloop(((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyt<module>s
	PK�[Mh�Ω	�	canvas-moving-w-mouse.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(cCs|j|_|j|_dS(N(txtlastxtytlasty(tselftevent((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt	mouseDown	scCsF|jjt|j|j|j|j�|j|_|j|_dS(N(tdrawtmovetCURRENTRRRR(RR((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt	mouseMoves*cCs|jjtdd�dS(Ntfilltred(R	t
itemconfigR(RR((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt
mouseEnterscCs|jjtdd�dS(NR
tblue(R	RR(RR((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt
mouseLeavesc	Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdt�|jjdddddd
dd�}|jj	|d|j
�|jj	|d|j�tj
|jd|j�tj
|jd|j�dS(NttexttQUITt
foregroundRtcommandtsideR
twidtht5itheightiitgreenttagstselecteds<Any-Enter>s<Any-Leave>s<1>s<B1-Motion>(tButtontquitRtpacktLEFTtBOTHtCanvasR	tcreate_ovalttag_bindRRtWidgettbindRR(Rtfred((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt
createWidgets!scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR)(Rtmaster((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyR+1s
N(	t__name__t
__module__RRRRR)tNoneR+(((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyRs						N(tTkinterR*Rttesttmainloop(((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt<module>s
1	PK�[~����00-HELLO-WORLD.pynu�[���from Tkinter import *

# note that there is no explicit call to start Tk.
# Tkinter is smart enough to start the system if it's not already going.

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)

        self.QUIT.pack(side=LEFT, fill=BOTH)

        # a hello button
        self.hi_there = Button(self, text='Hello',
                               command=self.printit)
        self.hi_there.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[��)��canvas-reading-tag-info.pynu�[���from Tkinter import *


class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.drawing = Canvas(self, width="5i", height="5i")

        # make a shape
        pgon = self.drawing.create_polygon(
            10, 10, 110, 10, 110, 110, 10 , 110,
            fill="red", tags=("weee", "foo", "groo"))

        # this is how you query an object for its attributes
        # config options FOR CANVAS ITEMS always come back in tuples of length 5.
        # 0 attribute name
        # 1 BLANK
        # 2 BLANK
        # 3 default value
        # 4 current value
        # the blank spots are for consistency with the config command that
        # is used for widgets. (remember, this is for ITEMS drawn
        # on a canvas widget, not widgets)
        option_value = self.drawing.itemconfig(pgon, "stipple")
        print "pgon's current stipple value is -->", option_value[4], "<--"
        option_value = self.drawing.itemconfig(pgon,  "fill")
        print "pgon's current fill value is -->", option_value[4], "<--"
        print "  when he is usually colored -->", option_value[3], "<--"

        ## here we print out all the tags associated with this object
        option_value = self.drawing.itemconfig(pgon,  "tags")
        print "pgon's tags are", option_value[4]

        self.drawing.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.mainloop()
PK�[�f� 44window-creation-w-location.pyonu�[����
��^c@sYddlTddlZdefd��YZdefd��YZe�Zej�dS(i����(t*Nt
QuitButtoncBseZd�ZRS(cOs\|jd�sd|d<n|jd�s;|j|d<nttj||f||�dS(NttexttQUITtcommand(thas_keytquittapplytButtont__init__(tselftmastertargstkwargs((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyR	s

(t__name__t
__module__R	(((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyR
stTestcBs&eZd�Zd�Zdd�ZRS(cGsgt�}t|dddd�|_|jjdddd�|jjdddd�|jj�dS(Ntwidtht2itheightt0(tTopleveltCanvastlabeltcreate_linetpack(R
Rtfred((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyt
makeWindows
	c
Csit|�|_|jjdtdt�t|ddddddd	|j�|_|jjdt�dS(
NtsidetfillRsMake a New WindowRi2RiR(RRRtLEFTtBOTHRR(R
((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(tFrameR	tPacktconfigR (R
R((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyR	's
N(RRRR tNoneR	(((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyRs			(tTkintertsysRRR!Rttesttmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyt<module>s

	PK�[�		canvas-gridding.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs8eZd�Zd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pytprintit	scCs{t|ddddddddd	|j�|_|jjd
tdt�t|dd
dd
�|_|jjd
t�dS(NttexttQUITt
backgroundtredt
foregroundtwhitetheightitcommandtsidetfilltwidtht5i(	tButtontquitRtpacktBOTTOMtBOTHtCanvastcanvasObjecttLEFT(R((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyt
createWidgetsscCs@|jj|j|j�|_|jj|j|j�|_dS(N(RtcanvasxtxtgriddingSizetstartxtcanvasytytstarty(Rtevent((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyt	mouseDownscCs�|jj|j|j�}|jj|j|j�}|j|jkr�|j|jkr�|jj|j	�|jj
|j|j||�|_	|j�ndS(N(RRRRRRRR tdeletet
rubberbandBoxtcreate_rectangletupdate_idletasks(RR!RR((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pytmouseMotions$	cCsotj||�tj|�|j�d|_d|_tj	|j
d|j�tj	|j
d|j�dS(Ni2s
<Button-1>s<Button1-Motion>(
tFramet__init__tPacktconfigRtNoneR$RtWidgettbindRR"R'(Rtmaster((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyR),s

		N(t__name__t
__module__RRR"R'R,R)(((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyRs
				N(tTkinterR(Rttesttmainloop(((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyt<module>s
3	PK�[k�����dialog-box.pyonu�[����
��^c@sGddlTddlmZdefd��YZe�Zej�dS(i����(t*(tDialogtTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pytprintitsc
Cs1t|ddddddddd	d�}|jS(
s�Create a top-level dialog with some buttons.

        This uses the Dialog class, which is a wrapper around the Tcl/Tk
        tk_dialog script.  The function returns 0 if the user clicks 'yes'
        or 1 if the user clicks 'no'.
        ttitlesfred the dialog boxttextsclick on a choicetbitmaptinfotdefaultitstringstyestno(RR
(Rtnum(Rtd((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyt
makeWindows	cCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NRtQUITt
foregroundtredtcommandtsidetfillsMake a New Window(tButtontquitRtpacktLEFTtBOTHRthi_there(R((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyt
createWidgets.scCs4tj||�tj|�d|_|j�dS(Ni(tFramet__init__tPacktconfigt	windownumR(Rtmaster((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyR9s
	N(t__name__t
__module__RRRtNoneR(((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyRs		#	N(tTkinterRRRttesttmainloop(((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyt<module>s
8	PK�[a>oQ��animation-w-velocity-ctrl.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pytprintit
sc	Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_t|dt	dd
dd�|_
|j
jdtdt�|jjdddddddd�|jjdt
�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheighttorienttfrom_i����ttoidii
ttagstthingtblue(tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawtScalet
HORIZONTALtspeedtXtcreate_rectangletLEFT(R((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyt
createWidgets
s!%cGsY|jj�}t|�d}d|f}|jjd||�|jd|j�dS(Ng@�@s%riRi
(RtgettfloatRtmovetaftert	moveThing(Rtargstvelocitytstr((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyR's

cCs>tj||�tj|�|j�|jd|j�dS(Ni
(tFramet__init__tPacktconfigR"R&R'(Rtmaster((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyR,#s

N(t__name__t
__module__RR"R'tNoneR,(((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyR	s			N(tTkinterR+Rttesttmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyt<module>s
!	PK�[�]���animation-w-velocity-ctrl.pynu�[���from Tkinter import *

# this is the same as simple-demo-1.py, but uses
# subclassing.
# note that there is no explicit call to start Tk.
# Tkinter is smart enough to start the system if it's not already going.


class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.draw = Canvas(self, width="5i", height="5i")

        self.speed = Scale(self, orient=HORIZONTAL, from_=-100, to=100)

        self.speed.pack(side=BOTTOM, fill=X)

        # all of these work..
        self.draw.create_rectangle(0, 0, 10, 10, tags="thing", fill="blue")
        self.draw.pack(side=LEFT)

    def moveThing(self, *args):
        velocity = self.speed.get()
        str = float(velocity) / 1000.0
        str = "%ri" % (str,)
        self.draw.move("thing",  str, str)
        self.after(10, self.moveThing)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()
        self.after(10, self.moveThing)


test = Test()

test.mainloop()
PK�[��Vkkmenu-all-types-of-entries.pycnu�[����
��^c@sddlTd�Zd�Zd�Zdad�Zd�Zd�Zd	�Zd
�Z	d�Z
e�Ze
eded
d�Zejde�e�Ze�Ze�Ze	�Ze
�Zejeeeee�ejd�ejd�ej�dS(i����(t*cCs	dGHdS(Nsopening new file((((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytnew_file%scCs	dGHdS(Nsopening OLD file((((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pyt	open_file(scCs	dGHdS(Nspicked a menu item((((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytprint_something+sicCstadGtGHdS(Ns
anchovies?(t	anchovies(((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytprint_anchovies2scCs+ttdddd�}|jdtdd�t|�|_|jjdd	�|jjdd
t�|jjdddddt	�|jjdd
dddt
�|jjdddddddt�|jjdd�|jjd�|jjddddddddd|j
�|j|d<|S(NttextsSimple Button Commandst	underlineitsidetpadxt2mtlabeltUndotstatesNew...tcommandsOpen...sDifferent Fonttfonts&-*-helvetica-*-r-*-*-*-180-*-*-*-*-*-*tbitmaptinfot	separatortQuitt
backgroundtredtactivebackgroundtgreentmenu(t
MenubuttontmBartpacktLEFTtMenuRtadd_commandtentryconfigtDISABLEDRRRtaddtquit(tCommand_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeCommandMenu7s,	

cCs�ttdddd�}|jdtdd�t|�|_t|j�|j_t|jj�|jj_|jjjjdd	�|jjjjdd
�|jjjjdd�|jjjdd�|jjjdd
�|jjjdd�|jjjdd�|jjjdd�|jjjdd�|jjj	ddd|jjj�|jj	ddd|jj�|j|d<|S(NRsCascading MenusRiRR	R
Rtavacadosbelgian endivet	beefaronit	ChocolatetVanillatTuttiFruititWopBopaLoopBapABopBamBooms
Rocky Roadt	BubbleGums
Weird FlavorsRsmore choices(
RRRRRRtchoicest	weirdonesRtadd_cascade(tCascade_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeCascadeMenues*

cCs�ttdddd�}|jdtdd�t|�|_|jjdd	�|jjdd
�|jjdd�|jjddd
t�|jj|jj	d��|j|d<|S(NRsCheckbutton MenusRiRR	R
Rt	PepperonitSausagesExtra CheesetAnchovyRR(
RRRRRRtadd_checkbuttonRtinvoketindex(tCheckbutton_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeCheckbuttonMenu�s	
cCsttdddd�}|jdtdd�t|�|_|jjdd	�|jjdd
�|jjdd�|jjdd�|jjdd
�|jjdd�|jjdd�|jjdd�|jjdd�|jjdd�|j|d<|S(NRsRadiobutton MenusRiRR	R
Rt
RepublicantDemocrattLibertariantCommietFacistsLabor PartytTorietIndependentt	Anarchists
No OpinionR(RRRRRRtadd_radiobutton(tRadiobutton_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeRadiobuttonMenu�s 	
cCs<ttdddd�}|jdtdd�t|d<|S(	NRs	Dead MenuRiRR	R
R
(RRRRR (tDummy_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeDisabledMenu�s
trelieftborderwidthitfills	menu demoN(tTkinterRRRRRR$R0R8RCREtTktroottFrametRAISEDRRtXR#R/R7RBtNoMenut
tk_menuBarttitleticonnametmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pyt<module>s,
$					.	&	,								

PK�[b*�//window-creation-simple.pynu�[���from Tkinter import *

# this shows how to spawn off new windows at a button press

class Test(Frame):
    def printit(self):
        print "hi"

    def makeWindow(self):
        fred = Toplevel()
        fred.label = Label(fred, text="Here's a new window")
        fred.label.pack()

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)

        self.QUIT.pack(side=LEFT, fill=BOTH)

        # a hello button
        self.hi_there = Button(self, text='Make a New Window',
                               command=self.makeWindow)
        self.hi_there.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[;U<��subclass-existing-widgets.pyonu�[����
��^c@sJddlTdefd��YZd�Ze�Zee�ej�dS(i����(t*t
New_ButtoncBseZd�ZRS(cCs|jGH|jd|_dS(Ni(tcounter(tself((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pytcallbacks(t__name__t
__module__R(((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pyRscCs�t|�}|j�t|ddddd|j�|_|jjdtdt�t|dd�|_|jj	d|jj
�|jjdt�d	|j_dS(
NttexttQUITt
foregroundtredtcommandtsidetfilltHelloi+(tFrametpacktButtontquitRtLEFTtBOTHRthi_theretconfigRR(ttoptf((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pyt
createWidgetss
$N(tTkinterRRRtTktroottmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pyt<module>s

		
PK�[b�r;	;	canvas-with-scrollbars.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pytprintit	sc
Cs�t|dd�|_|jj�t|ddddddd|j�|_|jjd	td
t�t|dd�}|jd	t�t	|dd
dd
dddd�|_
t|dt�|j
_
t|dt�|j
_|j
j
j|j
d<|j
jj|j
d<|j
j|j
j
d<|j
j|j
jd<|j
jddddd
d�|j
jddddd
d�|j
j
jd	td
t�|j
jjd	td
t�|j
jd	t�dS(NttextsCan Find The BLUE Square??????tQUITt
backgroundtredtheightitcommandtsidetfills0.25itwidtht5itwhitetscrollregionit20itorienttxscrollcommandtyscrollcommands3.5itblackt10is13.5itblue(iiRR(tLabeltquestiontpacktButtontquitRtBOTTOMtBOTHtFrametCanvastdrawt	Scrollbart
HORIZONTALtscrollXtVERTICALtscrollYtsettxviewtyviewtcreate_rectangletXtRIGHTtYtLEFT(Rtspacer((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyt
createWidgetss*
cGsdG|GH|jjj�GHdS(Nt	scrolling(R!R$tget(Rtargs((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyt
scrollCanvasX0s	cCs+tj||�tj|�|j�dS(N(Rt__init__tPacktconfigR0(Rtmaster((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyR55s
N(t__name__t
__module__RR0R4tNoneR5(((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyRs		$	N(tTkinterRRttesttmainloop(((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyt<module>s
2	PK�[;mDDcanvas-reading-tag-info.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pytprintitscCs!t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjddddddddddd
d�}|jj	|d�}dG|dGdGH|jj	|d�}dG|dGdGHdG|dGdGH|jj	|d
�}dG|dGH|jjdt
�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheighti
inttagstweeetfootgrootstipples#pgon's current stipple value is -->is<--s pgon's current fill value is -->s   when he is usually colored -->ispgon's tags are(RRR(tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawingtcreate_polygont
itemconfigtLEFT(Rtpgontoption_value((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyt
createWidgetss	
cCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR (Rtmaster((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyR"*s
N(t__name__t
__module__RR tNoneR"(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyRs		"N(tTkinterR!Rttesttmainloop(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyt<module>s
+	PK�[�j�HHradiobutton-simple.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pytprintitsc
Csvt�|_|jjd�t|�|_|jj�t|jddd|jdddt�|j_|jjjdt	�t|jddd|jdd	dt�|j_
|jj
jdt	�t|jdd
d|jdddt�|j_|jjjdt	�t|d|j�|_
|j
jdt	�t|dd
ddd|j�|_|jjdtdt�dS(Nt	chocolatettextsChocolate FlavortvariabletvaluetanchortfillsStrawberry Flavort
strawberrysLemon FlavortlemonttextvariabletQUITt
foregroundtredtcommandtside(t	StringVartflavortsettFramet
radioframetpacktRadiobuttontWtchoctXtstrawRtEntrytentrytButtontquitRtBOTTOMtBOTH(R((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyt
createWidgetss0
cCs+tj||�tj|�|j�dS(N(Rt__init__tPacktconfigR$(Rtmaster((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyR%7s
N(t__name__t
__module__RR$tNoneR%(((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyR
s		&N(tTkinterRRttesttmainloop(((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyt<module>s
/	PK�[��g00-HELLO-WORLD.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pytprintitscCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NttexttQUITt
foregroundtredtcommandtsidetfilltHello(tButtontquitRtpacktLEFTtBOTHRthi_there(R((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyt
createWidgets
scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyRs
N(t__name__t
__module__RRtNoneR(((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyRs		N(tTkinterRRttesttmainloop(((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyt<module>s
	PK�[���llpacker-and-placer-together.pyonu�[����
��^c@seddlTd�Zd�Zd�Ze�Zee�Zejd�ejdd�ej	�dS(i����(t*cCs#tjjd|jd|j�dS(Ntxty(tapptbuttontplaceRR(tevent((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pyt	do_motionscCs	dGHdS(Nscalling me!((((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pytdothis
scCs�t|dddddd�}|jdtdd�t|d	d
ddd
t�|_|jjdddddt�|jdt	�|S(Ntwidthi�theightt
backgroundtgreentfilltexpandit
foregroundtredttexttamazingtcommandtrelxg�?trelygtanchors<Control-Shift-Motion>(
tFrametpacktBOTHtButtonRRRtNWtbindR(ttoptf((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pyt
createWidgets
s!t400x400i�N(
tTkinterRRRtTktrootRtgeometrytmaxsizetmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pyt<module>s
				
PK�[�D66placer-simple.pynu�[���from Tkinter import *

# This is a program that tests the placer geom manager

def do_motion(event):
    app.button.place(x=event.x, y=event.y)

def dothis():
    print 'calling me!'

def createWidgets(top):
    # make a frame. Note that the widget is 200 x 200
    # and the window containing is 400x400. We do this
    # simply to show that this is possible. The rest of the
    # area is inaccesssible.
    f = Frame(top, width=200, height=200, background='green')

    # place it so the upper left hand corner of
    # the frame is in the upper left corner of
    # the parent
    f.place(relx=0.0, rely=0.0)

    # now make a button
    f.button = Button(f, foreground='red', text='amazing', command=dothis)

    # and place it so that the nw corner is
    # 1/2 way along the top X edge of its' parent
    f.button.place(relx=0.5, rely=0.0, anchor=NW)

    # allow the user to move the button SUIT-style.
    f.bind('<Control-Shift-Motion>', do_motion)

    return f

root = Tk()
app = createWidgets(root)
root.geometry("400x400")
root.maxsize(1000, 1000)
root.mainloop()
PK�[3��(jjwindow-creation-simple.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pytprintitscCs/t�}t|dd�|_|jj�dS(NttextsHere's a new window(tTopleveltLabeltlabeltpack(Rtfred((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyt
makeWindow	s	cCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NRtQUITt
foregroundtredtcommandtsidetfillsMake a New Window(tButtontquitRR	tLEFTtBOTHRthi_there(R((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyRs
N(t__name__t
__module__RRRtNoneR(((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyRs			N(tTkinterRRttesttmainloop(((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyt<module>s
	PK�[���*hhentry-with-shared-variable.pycnu�[����
��^c@sSddlTddlZdefd��YZe�Zejjd�ej�dS(i����(t*NtAppcBs&eZdd�Zd�Zd�ZRS(cCs�tj||�|j�t|�|_|jj�t|ddd|j�|_|jj�t�|_	|j	j
d�|jjd|j	�|jjd|j
�dS(NttextsUppercase The Entrytcommandsthis is a variablettextvariables<Key-Return>(tFramet__init__tpacktEntrytentrythingytButtontuppertbuttont	StringVartcontentstsettconfigtbindtprint_contents(tselftmaster((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyRs


cCs,tj|jj��}|jj|�dS(N(tstringRRtgetR(Rtstr((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyR scCsdG|jj�GHdS(Ns"hi. contents of entry is now ---->(RR(Rtevent((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyR)sN(t__name__t
__module__tNoneRRR(((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyRs		tFoo(tTkinterRRRtrootRttitletmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyt<module>s

&	PK�[�X
���packer-and-placer-together.pynu�[���from Tkinter import *

# This is a program that tests the placer geom manager in conjunction with
# the packer. The background (green) is packed, while the widget inside is placed


def do_motion(event):
    app.button.place(x=event.x, y=event.y)

def dothis():
    print 'calling me!'

def createWidgets(top):
    # make a frame. Note that the widget is 200 x 200
    # and the window containing is 400x400. We do this
    # simply to show that this is possible. The rest of the
    # area is inaccesssible.
    f = Frame(top, width=200, height=200, background='green')

    # note that we use a different manager here.
    # This way, the top level frame widget resizes when the
    # application window does.
    f.pack(fill=BOTH, expand=1)

    # now make a button
    f.button = Button(f, foreground='red', text='amazing', command=dothis)

    # and place it so that the nw corner is
    # 1/2 way along the top X edge of its' parent
    f.button.place(relx=0.5, rely=0.0, anchor=NW)

    # allow the user to move the button SUIT-style.
    f.bind('<Control-Shift-Motion>', do_motion)

    return f

root = Tk()
app = createWidgets(root)
root.geometry("400x400")
root.maxsize(1000, 1000)
root.mainloop()
PK�[���*hhentry-with-shared-variable.pyonu�[����
��^c@sSddlTddlZdefd��YZe�Zejjd�ej�dS(i����(t*NtAppcBs&eZdd�Zd�Zd�ZRS(cCs�tj||�|j�t|�|_|jj�t|ddd|j�|_|jj�t�|_	|j	j
d�|jjd|j	�|jjd|j
�dS(NttextsUppercase The Entrytcommandsthis is a variablettextvariables<Key-Return>(tFramet__init__tpacktEntrytentrythingytButtontuppertbuttont	StringVartcontentstsettconfigtbindtprint_contents(tselftmaster((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyRs


cCs,tj|jj��}|jj|�dS(N(tstringRRtgetR(Rtstr((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyR scCsdG|jj�GHdS(Ns"hi. contents of entry is now ---->(RR(Rtevent((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyR)sN(t__name__t
__module__tNoneRRR(((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyRs		tFoo(tTkinterRRRtrootRttitletmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/entry-with-shared-variable.pyt<module>s

&	PK�[��t44entry-simple.pyonu�[����
��^c@sSddlTddlZdefd��YZe�Zejjd�ej�dS(i����(t*NtAppcBseZdd�Zd�ZRS(cCsMtj||�|j�t�|_|jj�|jjd|j�dS(Ns<Key-Return>(tFramet__init__tpacktEntrytentrythingytbindtprint_contents(tselftmaster((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyRs


cCsdG|jj�GHdS(Ns"hi. contents of entry is now ---->(Rtget(R	tevent((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyRsN(t__name__t
__module__tNoneRR(((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyRstFoo(tTkintertstringRRtrootR
ttitletmainloop(((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyt<module>s

	PK�[��ZZ��window-creation-more.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pytprintitscCsOt�}t|dd|jd|j�|_|jj�|jd|_dS(NttextsThis is window number %d.tcommandi(tTopleveltButtont	windownumt
makeWindowtlabeltpack(Rtfred((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyR

s		

cCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NRtQUITt
foregroundtredRtsidetfillsMake a New Window(RtquitRRtLEFTtBOTHR
thi_there(R((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyt
createWidgetsscCs4tj||�tj|�d|_|j�dS(Ni(tFramet__init__tPacktconfigR	R(Rtmaster((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyRs
	N(t__name__t
__module__RR
RtNoneR(((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyRs			
N(tTkinterRRttesttmainloop(((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyt<module>s
	PK�[��g00-HELLO-WORLD.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pytprintitscCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NttexttQUITt
foregroundtredtcommandtsidetfilltHello(tButtontquitRtpacktLEFTtBOTHRthi_there(R((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyt
createWidgets
scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyRs
N(t__name__t
__module__RRtNoneR(((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyRs		N(tTkinterRRttesttmainloop(((s8/usr/lib64/python2.7/Demo/tkinter/matt/00-HELLO-WORLD.pyt<module>s
	PK�[�3�--window-creation-w-location.pynu�[���from Tkinter import *

import sys
##sys.path.append("/users/mjc4y/projects/python/tkinter/utils")
##from TkinterUtils  import *

# this shows how to create a new window with a button in it that
# can create new windows

class QuitButton(Button):
    def __init__(self, master, *args, **kwargs):
        if not kwargs.has_key("text"):
            kwargs["text"] = "QUIT"
        if not kwargs.has_key("command"):
            kwargs["command"] = master.quit
        apply(Button.__init__, (self, master) + args, kwargs)

class Test(Frame):
    def makeWindow(self, *args):
        fred = Toplevel()

        fred.label = Canvas (fred, width="2i", height="2i")

        fred.label.create_line("0", "0", "2i", "2i")
        fred.label.create_line("0", "2i", "2i", "0")
        fred.label.pack()

        ##centerWindow(fred, self.master)

    def createWidgets(self):
        self.QUIT = QuitButton(self)
        self.QUIT.pack(side=LEFT, fill=BOTH)

        self.makeWindow = Button(self, text='Make a New Window',
                                 width=50, height=20,
                                 command=self.makeWindow)
        self.makeWindow.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[�P6��slider-demo-1.pynu�[���from Tkinter import *

# shows how to make a slider, set and get its value under program control


class Test(Frame):
    def print_value(self, val):
        print "slider now at", val

    def reset(self):
        self.slider.set(0)

    def createWidgets(self):
        self.slider = Scale(self, from_=0, to=100,
                            orient=HORIZONTAL,
                            length="3i",
                            label="happy slider",
                            command=self.print_value)

        self.reset = Button(self, text='reset slider',
                            command=self.reset)

        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)

        self.slider.pack(side=LEFT)
        self.reset.pack(side=LEFT)
        self.QUIT.pack(side=LEFT, fill=BOTH)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[��Vkkmenu-all-types-of-entries.pyonu�[����
��^c@sddlTd�Zd�Zd�Zdad�Zd�Zd�Zd	�Zd
�Z	d�Z
e�Ze
eded
d�Zejde�e�Ze�Ze�Ze	�Ze
�Zejeeeee�ejd�ejd�ej�dS(i����(t*cCs	dGHdS(Nsopening new file((((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytnew_file%scCs	dGHdS(Nsopening OLD file((((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pyt	open_file(scCs	dGHdS(Nspicked a menu item((((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytprint_something+sicCstadGtGHdS(Ns
anchovies?(t	anchovies(((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytprint_anchovies2scCs+ttdddd�}|jdtdd�t|�|_|jjdd	�|jjdd
t�|jjdddddt	�|jjdd
dddt
�|jjdddddddt�|jjdd�|jjd�|jjddddddddd|j
�|j|d<|S(NttextsSimple Button Commandst	underlineitsidetpadxt2mtlabeltUndotstatesNew...tcommandsOpen...sDifferent Fonttfonts&-*-helvetica-*-r-*-*-*-180-*-*-*-*-*-*tbitmaptinfot	separatortQuitt
backgroundtredtactivebackgroundtgreentmenu(t
MenubuttontmBartpacktLEFTtMenuRtadd_commandtentryconfigtDISABLEDRRRtaddtquit(tCommand_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeCommandMenu7s,	

cCs�ttdddd�}|jdtdd�t|�|_t|j�|j_t|jj�|jj_|jjjjdd	�|jjjjdd
�|jjjjdd�|jjjdd�|jjjdd
�|jjjdd�|jjjdd�|jjjdd�|jjjdd�|jjj	ddd|jjj�|jj	ddd|jj�|j|d<|S(NRsCascading MenusRiRR	R
Rtavacadosbelgian endivet	beefaronit	ChocolatetVanillatTuttiFruititWopBopaLoopBapABopBamBooms
Rocky Roadt	BubbleGums
Weird FlavorsRsmore choices(
RRRRRRtchoicest	weirdonesRtadd_cascade(tCascade_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeCascadeMenues*

cCs�ttdddd�}|jdtdd�t|�|_|jjdd	�|jjdd
�|jjdd�|jjddd
t�|jj|jj	d��|j|d<|S(NRsCheckbutton MenusRiRR	R
Rt	PepperonitSausagesExtra CheesetAnchovyRR(
RRRRRRtadd_checkbuttonRtinvoketindex(tCheckbutton_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeCheckbuttonMenu�s	
cCsttdddd�}|jdtdd�t|�|_|jjdd	�|jjdd
�|jjdd�|jjdd�|jjdd
�|jjdd�|jjdd�|jjdd�|jjdd�|jjdd�|j|d<|S(NRsRadiobutton MenusRiRR	R
Rt
RepublicantDemocrattLibertariantCommietFacistsLabor PartytTorietIndependentt	Anarchists
No OpinionR(RRRRRRtadd_radiobutton(tRadiobutton_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeRadiobuttonMenu�s 	
cCs<ttdddd�}|jdtdd�t|d<|S(	NRs	Dead MenuRiRR	R
R
(RRRRR (tDummy_button((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pytmakeDisabledMenu�s
trelieftborderwidthitfills	menu demoN(tTkinterRRRRRR$R0R8RCREtTktroottFrametRAISEDRRtXR#R/R7RBtNoMenut
tk_menuBarttitleticonnametmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/menu-all-types-of-entries.pyt<module>s,
$					.	&	,								

PK�[�w��bind-w-mult-calls-p-type.pynu�[���from Tkinter import *
import string

# This program  shows how to use a simple type-in box

class App(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()

        self.entrythingy = Entry()
        self.entrythingy.pack()

        # and here we get a callback when the user hits return. we could
        # make the key that triggers the callback anything we wanted to.
        # other typical options might be <Key-Tab> or <Key> (for anything)
        self.entrythingy.bind('<Key-Return>', self.print_contents)

        # Note that here is where we bind a completely different callback to
        # the same event. We pass "+" here to indicate that we wish to ADD
        # this callback to the list associated with this event type.
        # Not specifying "+" would simply override whatever callback was
        # defined on this event.
        self.entrythingy.bind('<Key-Return>', self.print_something_else, "+")

    def print_contents(self, event):
        print "hi. contents of entry is now ---->", self.entrythingy.get()


    def print_something_else(self, event):
        print "hi. Now doing something completely different"


root = App()
root.master.title("Foo")
root.mainloop()



# secret tip for experts: if you pass *any* non-false value as
# the third parameter to bind(), Tkinter.py will accumulate
# callbacks instead of overwriting. I use "+" here because that's
# the Tk notation for getting this sort of behavior. The perfect GUI
# interface would use a less obscure notation.
PK�[�Fֳ�menu-simple.pynu�[���from Tkinter import *

# some vocabulary to keep from getting confused. This terminology
# is something I cooked up for this file, but follows the man pages
# pretty closely
#
#
#
#       This is a MENUBUTTON
#       V
# +-------------+
# |             |
#
# +------------++------------++------------+
# |            ||            ||            |
# |  File      ||  Edit      || Options    |   <-------- the MENUBAR
# |            ||            ||            |
# +------------++------------++------------+
# | New...         |
# | Open...        |
# | Print          |
# |                |  <------ This is a MENU. The lines of text in the menu are
# |                |                          MENU ENTRIES
# |                +---------------+
# | Open Files >   | file1         |
# |                | file2         |
# |                | another file  | <------ this cascading part is also a MENU
# +----------------|               |
#                  |               |
#                  |               |
#                  |               |
#                  +---------------+



def new_file():
    print "opening new file"


def open_file():
    print "opening OLD file"


def makeFileMenu():
    # make menu button : "File"
    File_button = Menubutton(mBar, text='File', underline=0)
    File_button.pack(side=LEFT, padx="1m")
    File_button.menu = Menu(File_button)

    # add an item. The first param is a menu entry type,
    # must be one of: "cascade", "checkbutton", "command", "radiobutton", "separator"
    # see menu-demo-2.py for examples of use
    File_button.menu.add_command(label='New...', underline=0,
                                 command=new_file)


    File_button.menu.add_command(label='Open...', underline=0,
                                 command=open_file)

    File_button.menu.add_command(label='Quit', underline=0,
                                 command='exit')

    # set up a pointer from the file menubutton back to the file menu
    File_button['menu'] = File_button.menu

    return File_button



def makeEditMenu():
    Edit_button = Menubutton(mBar, text='Edit', underline=0)
    Edit_button.pack(side=LEFT, padx="1m")
    Edit_button.menu = Menu(Edit_button)

    # just to be cute, let's disable the undo option:
    Edit_button.menu.add('command', label="Undo")
    # Since the tear-off bar is the 0th entry,
    # undo is the 1st entry...
    Edit_button.menu.entryconfig(1, state=DISABLED)

    # and these are just for show. No "command" callbacks attached.
    Edit_button.menu.add_command(label="Cut")
    Edit_button.menu.add_command(label="Copy")
    Edit_button.menu.add_command(label="Paste")

    # set up a pointer from the file menubutton back to the file menu
    Edit_button['menu'] = Edit_button.menu

    return Edit_button


#################################################

#### Main starts here ...
root = Tk()


# make a menu bar
mBar = Frame(root, relief=RAISED, borderwidth=2)
mBar.pack(fill=X)

File_button = makeFileMenu()
Edit_button = makeEditMenu()

# finally, install the buttons in the menu bar.
# This allows for scanning from one menubutton to the next.
mBar.tk_menuBar(File_button, Edit_button)

root.title('menu demo')
root.iconname('packer')

root.mainloop()
PK�[�F�77not-what-you-might-think-2.pycnu�[����
��^c@sWddlTdefd��YZe�Zejjd�ejjd�ej�dS(i����(t*tTestcBseZd�Zdd�ZRS(cCs�t|dddddd�|_|jjd�|jjdt�t|jdd	d
dd|j�|j_|jjjdt�dS(
Ntwidtht1itheightt
backgroundtgreenitsidettexttQUITt
foregroundtredtcommand(tFrametGpanelt	propagatetpacktLEFTtButtontquitR	(tself((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(R
t__init__tPacktconfigR(Rtmaster((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyRs
N(t__name__t
__module__RtNoneR(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyRs	spacker demotpackerN(tTkinterR
RttestRttitleticonnametmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyt<module>s

	PK�[���llpacker-and-placer-together.pycnu�[����
��^c@seddlTd�Zd�Zd�Ze�Zee�Zejd�ejdd�ej	�dS(i����(t*cCs#tjjd|jd|j�dS(Ntxty(tapptbuttontplaceRR(tevent((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pyt	do_motionscCs	dGHdS(Nscalling me!((((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pytdothis
scCs�t|dddddd�}|jdtdd�t|d	d
ddd
t�|_|jjdddddt�|jdt	�|S(Ntwidthi�theightt
backgroundtgreentfilltexpandit
foregroundtredttexttamazingtcommandtrelxg�?trelygtanchors<Control-Shift-Motion>(
tFrametpacktBOTHtButtonRRRtNWtbindR(ttoptf((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pyt
createWidgets
s!t400x400i�N(
tTkinterRRRtTktrootRtgeometrytmaxsizetmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/packer-and-placer-together.pyt<module>s
				
PK�[��>;��packer-simple.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs|jdGHdS(Ntcommand(thi_there(tself((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pytprintitscCs�t|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�t|dd	�|_|jj�t|dd
�|_	|j	j�dS(NttexttQUITt
foregroundtredRtsidetfilltHellosbutton 2sbutton 3(
tButtontquitRtpacktLEFTtBOTHRRtguy2tguy3(R((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyt
createWidgetss
cCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyRs
N(t__name__t
__module__RRtNoneR(((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyRs		N(tTkinterRRttesttmainloop(((s7/usr/lib64/python2.7/Demo/tkinter/matt/packer-simple.pyt<module>s
	PK�[�� �yybind-w-mult-calls-p-type.pyonu�[����
��^c@sSddlTddlZdefd��YZe�Zejjd�ej�dS(i����(t*NtAppcBs&eZdd�Zd�Zd�ZRS(cCsftj||�|j�t�|_|jj�|jjd|j�|jjd|jd�dS(Ns<Key-Return>t+(tFramet__init__tpacktEntrytentrythingytbindtprint_contentstprint_something_else(tselftmaster((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyRs

cCsdG|jj�GHdS(Ns"hi. contents of entry is now ---->(Rtget(Rtevent((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyR	scCs	dGHdS(Ns,hi. Now doing something completely different((RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyR
sN(t__name__t
__module__tNoneRR	R
(((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyRs	tFoo(tTkintertstringRRtrootRttitletmainloop(((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyt<module>s

	PK�[ʥ�E��not-what-you-might-think-1.pynu�[���from Tkinter import *


class Test(Frame):
    def createWidgets(self):

        self.Gpanel = Frame(self, width='1i', height='1i',
                            background='green')
        self.Gpanel.pack(side=LEFT)

        # a QUIT button
        self.Gpanel.QUIT = Button(self.Gpanel, text='QUIT',
                                  foreground='red',
                                  command=self.quit)
        self.Gpanel.QUIT.pack(side=LEFT)


    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.master.title('packer demo')
test.master.iconname('packer')

test.mainloop()
PK�[v��	
	
rubber-band-box-demo-1.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pytprintitscCs{t|ddddddddd	|j�|_|jjd
tdt�t|dd
dd
�|_|jjd
t�dS(NttexttQUITt
backgroundtredt
foregroundtwhitetheightitcommandtsidetfilltwidtht5i(	tButtontquitRtpacktBOTTOMtBOTHtCanvastcanvasObjecttLEFT(R((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyt
createWidgetsscCs4|jj|j�|_|jj|j�|_dS(N(Rtcanvasxtxtstartxtcanvasytytstarty(Rtevent((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyt	mouseDownscCs�|jj|j�}|jj|j�}|j|jkr�|j|jkr�|jj|j�|jj	|j|j||�|_|j
�ndS(N(RRRRRRRtdeletet
rubberbandBoxtcreate_rectangletupdate_idletasks(RR RR((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pytmouseMotions$	cCs|jj|j�dS(N(RR"R#(RR ((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pytmouseUp'scCstj||�tj|�|j�d|_tj|j	d|j
�tj|j	d|j�tj|j	d|j�dS(Ns
<Button-1>s<Button1-Motion>s<Button1-ButtonRelease>(
tFramet__init__tPacktconfigRtNoneR#tWidgettbindRR!R&R'(Rtmaster((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyR)*s

	N(	t__name__t
__module__RRR!R&R'R,R)(((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyRs					N(tTkinterR(Rttesttmainloop(((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyt<module>s
5	PK�[�!��READMEnu�[���This directory contains some ad-hoc examples of Tkinter widget
creation. The files named 

		*-simple.py

are the ones to start with if you're looking for a bare-bones usage of
a widget. The other files are meant to show common usage patters that
are a tad more involved. 

If you have a suggestion for an example program, please send mail to 
	
	conway@virginia.edu

and I'll include it.


matt

TODO
-------
The X selection
Dialog Boxes
More canvas examples
Message widgets
Text Editors
Scrollbars
Listboxes



PK�[e��̍�canvas-demo-simple.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pytprintitscCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdddddd
�|jjdt	�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheightit3itblack(
tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawtcreate_rectangletLEFT(R((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyt
createWidgets	scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyRs
N(t__name__t
__module__RRtNoneR(((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyRs		N(tTkinterRRttesttmainloop(((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyt<module>s
	PK�[a>oQ��animation-w-velocity-ctrl.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pytprintit
sc	Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_t|dt	dd
dd�|_
|j
jdtdt�|jjdddddddd�|jjdt
�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheighttorienttfrom_i����ttoidii
ttagstthingtblue(tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawtScalet
HORIZONTALtspeedtXtcreate_rectangletLEFT(R((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyt
createWidgets
s!%cGsY|jj�}t|�d}d|f}|jjd||�|jd|j�dS(Ng@�@s%riRi
(RtgettfloatRtmovetaftert	moveThing(Rtargstvelocitytstr((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyR's

cCs>tj||�tj|�|j�|jd|j�dS(Ni
(tFramet__init__tPacktconfigR"R&R'(Rtmaster((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyR,#s

N(t__name__t
__module__RR"R'tNoneR,(((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyR	s			N(tTkinterR+Rttesttmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/animation-w-velocity-ctrl.pyt<module>s
!	PK�[	����slider-demo-1.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs
dG|GHdS(Ns
slider now at((tselftval((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pytprint_valuescCs|jjd�dS(Ni(tslidertset(R((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pytreset
scCs�t|dddddtdddd	d
|j�|_t|ddd
|j�|_t|dd
ddd
|j�|_|jjdt	�|jjdt	�|jjdt	dt
�dS(Ntfrom_ittoidtorienttlengtht3itlabelshappy slidertcommandttextsreset slidertQUITt
foregroundtredtsidetfill(tScalet
HORIZONTALRRtButtonRtquitRtpacktLEFTtBOTH(R((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyt
createWidgets
scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyRs
N(t__name__t
__module__RRRtNoneR(((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyRs			N(tTkinterRRttesttmainloop(((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyt<module>s
	PK�[Ca�33packer-simple.pynu�[���from Tkinter import *


class Test(Frame):
    def printit(self):
        print self.hi_there["command"]

    def createWidgets(self):
        # a hello button
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)

        self.hi_there = Button(self, text='Hello',
                               command=self.printit)
        self.hi_there.pack(side=LEFT)

        # note how Packer defaults to side=TOP

        self.guy2 = Button(self, text='button 2')
        self.guy2.pack()

        self.guy3 = Button(self, text='button 3')
        self.guy3.pack()

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[`MY��subclass-existing-widgets.pynu�[���from Tkinter import *

# This is a program that makes a simple two button application


class New_Button(Button):
    def callback(self):
        print self.counter
        self.counter = self.counter + 1

def createWidgets(top):
    f = Frame(top)
    f.pack()
    f.QUIT = Button(f, text='QUIT', foreground='red', command=top.quit)

    f.QUIT.pack(side=LEFT, fill=BOTH)

    # a hello button
    f.hi_there = New_Button(f, text='Hello')
    # we do this on a different line because we need to reference f.hi_there
    f.hi_there.config(command=f.hi_there.callback)
    f.hi_there.pack(side=LEFT)
    f.hi_there.counter = 43


root = Tk()
createWidgets(root)
root.mainloop()
PK�[|=4�>>canvas-with-scrollbars.pynu�[���from Tkinter import *

# This example program creates a scrolling canvas, and demonstrates
# how to tie scrollbars and canvases together. The mechanism
# is analogus for listboxes and other widgets with
# "xscroll" and "yscroll" configuration options.

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.question = Label(self, text="Can Find The BLUE Square??????")
        self.question.pack()

        self.QUIT = Button(self, text='QUIT', background='red',
                           height=3, command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)
        spacer = Frame(self, height="0.25i")
        spacer.pack(side=BOTTOM)

        # notice that the scroll region (20" x 20") is larger than
        # displayed size of the widget (5" x 5")
        self.draw = Canvas(self, width="5i", height="5i",
                           background="white",
                           scrollregion=(0, 0, "20i", "20i"))

        self.draw.scrollX = Scrollbar(self, orient=HORIZONTAL)
        self.draw.scrollY = Scrollbar(self, orient=VERTICAL)

        # now tie the three together. This is standard boilerplate text
        self.draw['xscrollcommand'] = self.draw.scrollX.set
        self.draw['yscrollcommand'] = self.draw.scrollY.set
        self.draw.scrollX['command'] = self.draw.xview
        self.draw.scrollY['command'] = self.draw.yview

        # draw something. Note that the first square
        # is visible, but you need to scroll to see the second one.
        self.draw.create_rectangle(0, 0, "3.5i", "3.5i", fill="black")
        self.draw.create_rectangle("10i", "10i", "13.5i", "13.5i", fill="blue")

        # pack 'em up
        self.draw.scrollX.pack(side=BOTTOM, fill=X)
        self.draw.scrollY.pack(side=RIGHT, fill=Y)
        self.draw.pack(side=LEFT)


    def scrollCanvasX(self, *args):
        print "scrolling", args
        print self.draw.scrollX.get()


    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.mainloop()
PK�[���'��canvas-gridding.pynu�[���from Tkinter import *

# this is the same as simple-demo-1.py, but uses
# subclassing.
# note that there is no explicit call to start Tk.
# Tkinter is smart enough to start the system if it's not already going.

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT',
                                  background='red',
                                  foreground='white',
                                  height=3,
                                  command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.canvasObject = Canvas(self, width="5i", height="5i")
        self.canvasObject.pack(side=LEFT)

    def mouseDown(self, event):
        # canvas x and y take the screen coords from the event and translate
        # them into the coordinate system of the canvas object
        self.startx = self.canvasObject.canvasx(event.x, self.griddingSize)
        self.starty = self.canvasObject.canvasy(event.y, self.griddingSize)

    def mouseMotion(self, event):
        # canvas x and y take the screen coords from the event and translate
        # them into the coordinate system of the canvas object
        x = self.canvasObject.canvasx(event.x, self.griddingSize)
        y = self.canvasObject.canvasy(event.y, self.griddingSize)

        if (self.startx != event.x)  and (self.starty != event.y) :
            self.canvasObject.delete(self.rubberbandBox)
            self.rubberbandBox = self.canvasObject.create_rectangle(
                self.startx, self.starty, x, y)
            # this flushes the output, making sure that
            # the rectangle makes it to the screen
            # before the next event is handled
            self.update_idletasks()

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

        # this is a "tagOrId" for the rectangle we draw on the canvas
        self.rubberbandBox = None

        # this is the size of the gridding squares
        self.griddingSize = 50

        Widget.bind(self.canvasObject, "<Button-1>", self.mouseDown)
        Widget.bind(self.canvasObject, "<Button1-Motion>", self.mouseMotion)


test = Test()

test.mainloop()
PK�[v��	
	
rubber-band-box-demo-1.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pytprintitscCs{t|ddddddddd	|j�|_|jjd
tdt�t|dd
dd
�|_|jjd
t�dS(NttexttQUITt
backgroundtredt
foregroundtwhitetheightitcommandtsidetfilltwidtht5i(	tButtontquitRtpacktBOTTOMtBOTHtCanvastcanvasObjecttLEFT(R((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyt
createWidgetsscCs4|jj|j�|_|jj|j�|_dS(N(Rtcanvasxtxtstartxtcanvasytytstarty(Rtevent((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyt	mouseDownscCs�|jj|j�}|jj|j�}|j|jkr�|j|jkr�|jj|j�|jj	|j|j||�|_|j
�ndS(N(RRRRRRRtdeletet
rubberbandBoxtcreate_rectangletupdate_idletasks(RR RR((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pytmouseMotions$	cCs|jj|j�dS(N(RR"R#(RR ((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pytmouseUp'scCstj||�tj|�|j�d|_tj|j	d|j
�tj|j	d|j�tj|j	d|j�dS(Ns
<Button-1>s<Button1-Motion>s<Button1-ButtonRelease>(
tFramet__init__tPacktconfigRtNoneR#tWidgettbindRR!R&R'(Rtmaster((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyR)*s

	N(	t__name__t
__module__RRR!R&R'R,R)(((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyRs					N(tTkinterR(Rttesttmainloop(((s@/usr/lib64/python2.7/Demo/tkinter/matt/rubber-band-box-demo-1.pyt<module>s
5	PK�[�;���window-creation-more.pynu�[���from Tkinter import *

# this shows how to create a new window with a button in it
# that can create new windows

class Test(Frame):
    def printit(self):
        print "hi"

    def makeWindow(self):
        fred = Toplevel()
        fred.label = Button(fred,
                            text="This is window number %d." % self.windownum,
                            command=self.makeWindow)
        fred.label.pack()
        self.windownum = self.windownum + 1

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)

        # a hello button
        self.hi_there = Button(self, text='Make a New Window',
                               command=self.makeWindow)
        self.hi_there.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.windownum = 0
        self.createWidgets()

test = Test()
test.mainloop()
PK�[�Q.�killing-window-w-wm.pynu�[���from Tkinter import *

# This file shows how to trap the killing of a window
# when the user uses window manager menus (typ. upper left hand corner
# menu in the decoration border).


### ******* this isn't really called -- read the comments
def my_delete_callback():
    print "whoops -- tried to delete me!"

class Test(Frame):
    def deathHandler(self, event):
        print self, "is now getting nuked. performing some save here...."

    def createWidgets(self):
        # a hello button
        self.hi_there = Button(self, text='Hello')
        self.hi_there.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

        ###
        ###  PREVENT WM kills from happening
        ###

        # the docs would have you do this:

#       self.master.protocol("WM_DELETE_WINDOW", my_delete_callback)

        # unfortunately, some window managers will not send this request to a window.
        # the "protocol" function seems incapable of trapping these "aggressive" window kills.
        # this line of code catches everything, tho. The window is deleted, but you have a chance
        # of cleaning up first.
        self.bind_all("<Destroy>", self.deathHandler)


test = Test()
test.mainloop()
PK�[������animation-simple.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pytprintitsc	Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjddddd
ddd�|jjdt�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheightii
ttagstthingtblue(	tButtontquitRtpacktLEFTtBOTHtCanvastdrawtcreate_rectangle(R((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyt
createWidgets	s%cGs-|jjddd�|jd|j�dS(NRs0.01ii
(Rtmovetaftert	moveThing(Rtargs((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyRscCs>tj||�tj|�|j�|jd|j�dS(Ni
(tFramet__init__tPacktconfigRRR(Rtmaster((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyR s

N(t__name__t
__module__RRRtNoneR (((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyRs			N(tTkinterRRttesttmainloop(((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyt<module>s
	PK�[;mDDcanvas-reading-tag-info.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pytprintitscCs!t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjddddddddddd
d�}|jj	|d�}dG|dGdGH|jj	|d�}dG|dGdGHdG|dGdGH|jj	|d
�}dG|dGH|jjdt
�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheighti
inttagstweeetfootgrootstipples#pgon's current stipple value is -->is<--s pgon's current fill value is -->s   when he is usually colored -->ispgon's tags are(RRR(tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawingtcreate_polygont
itemconfigtLEFT(Rtpgontoption_value((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyt
createWidgetss	
cCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR (Rtmaster((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyR"*s
N(t__name__t
__module__RR tNoneR"(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyRs		"N(tTkinterR!Rttesttmainloop(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-reading-tag-info.pyt<module>s
+	PK�[����rubber-line-demo-1.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs8eZd�Zd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pytprintitscCs{t|ddddddddd	|j�|_|jjd
tdt�t|dd
dd
�|_|jjd
t�dS(NttexttQUITt
backgroundtredt
foregroundtwhitetheightitcommandtsidetfilltwidtht5i(	tButtontquitRtpacktBOTTOMtBOTHtCanvastcanvasObjecttLEFT(R((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyt
createWidgetsscCs4|jj|j�|_|jj|j�|_dS(N(Rtcanvasxtxtstartxtcanvasytytstarty(Rtevent((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyt	mouseDownscCs�|jj|j�}|jj|j�}|j|jkr�|j|jkr�|jj|j�|jj	|j|j||�|_|j
�ndS(N(RRRRRRRtdeletetrubberbandLinetcreate_linetupdate_idletasks(RR RR((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pytmouseMotions$	cCsftj||�tj|�|j�d|_tj|j	d|j
�tj|j	d|j�dS(Ns
<Button-1>s<Button1-Motion>(tFramet__init__tPacktconfigRtNoneR#tWidgettbindRR!R&(Rtmaster((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyR('s

	N(t__name__t
__module__RRR!R&R+R((((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyRs
				N(tTkinterR'Rttesttmainloop(((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyt<module>s
.	PK�[S�"

placer-simple.pyonu�[����
��^c@seddlTd�Zd�Zd�Ze�Zee�Zejd�ejdd�ej	�dS(i����(t*cCs#tjjd|jd|j�dS(Ntxty(tapptbuttontplaceRR(tevent((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pyt	do_motionscCs	dGHdS(Nscalling me!((((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pytdothisscCs�t|dddddd�}|jdddd�t|d	d
ddd
t�|_|jjdddddt�|jdt�|S(Ntwidthi�theightt
backgroundtgreentrelxgtrelyt
foregroundtredttexttamazingtcommandg�?tanchors<Control-Shift-Motion>(tFrameRtButtonRRtNWtbindR(ttoptf((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pyt
createWidgetss!t400x400i�N(
tTkinterRRRtTktrootRtgeometrytmaxsizetmainloop(((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pyt<module>s
				
PK�[k�����dialog-box.pycnu�[����
��^c@sGddlTddlmZdefd��YZe�Zej�dS(i����(t*(tDialogtTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pytprintitsc
Cs1t|ddddddddd	d�}|jS(
s�Create a top-level dialog with some buttons.

        This uses the Dialog class, which is a wrapper around the Tcl/Tk
        tk_dialog script.  The function returns 0 if the user clicks 'yes'
        or 1 if the user clicks 'no'.
        ttitlesfred the dialog boxttextsclick on a choicetbitmaptinfotdefaultitstringstyestno(RR
(Rtnum(Rtd((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyt
makeWindows	cCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NRtQUITt
foregroundtredtcommandtsidetfillsMake a New Window(tButtontquitRtpacktLEFTtBOTHRthi_there(R((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyt
createWidgets.scCs4tj||�tj|�d|_|j�dS(Ni(tFramet__init__tPacktconfigt	windownumR(Rtmaster((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyR9s
	N(t__name__t
__module__RRRtNoneR(((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyRs		#	N(tTkinterRRRttesttmainloop(((s4/usr/lib64/python2.7/Demo/tkinter/matt/dialog-box.pyt<module>s
8	PK�[�		canvas-gridding.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs8eZd�Zd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pytprintit	scCs{t|ddddddddd	|j�|_|jjd
tdt�t|dd
dd
�|_|jjd
t�dS(NttexttQUITt
backgroundtredt
foregroundtwhitetheightitcommandtsidetfilltwidtht5i(	tButtontquitRtpacktBOTTOMtBOTHtCanvastcanvasObjecttLEFT(R((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyt
createWidgetsscCs@|jj|j|j�|_|jj|j|j�|_dS(N(RtcanvasxtxtgriddingSizetstartxtcanvasytytstarty(Rtevent((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyt	mouseDownscCs�|jj|j|j�}|jj|j|j�}|j|jkr�|j|jkr�|jj|j	�|jj
|j|j||�|_	|j�ndS(N(RRRRRRRR tdeletet
rubberbandBoxtcreate_rectangletupdate_idletasks(RR!RR((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pytmouseMotions$	cCsotj||�tj|�|j�d|_d|_tj	|j
d|j�tj	|j
d|j�dS(Ni2s
<Button-1>s<Button1-Motion>(
tFramet__init__tPacktconfigRtNoneR$RtWidgettbindRR"R'(Rtmaster((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyR),s

		N(t__name__t
__module__RRR"R'R,R)(((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyRs
				N(tTkinterR(Rttesttmainloop(((s9/usr/lib64/python2.7/Demo/tkinter/matt/canvas-gridding.pyt<module>s
3	PK�[��aI

canvas-moving-or-creating.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(c	Cs�|jjt�s�|jj|jd|jd|jd|jddddt�}|jj|d|j�|jj|d|j	�n|j|_
|j|_dS(Ni
tfilltgreenttagss<Any-Enter>s<Any-Leave>(twidgettfind_withtagtCURRENTtdrawtcreate_ovaltxtyttag_bindt
mouseEntert
mouseLeavetlastxtlasty(tselfteventtfred((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt	mouseDown
s	+cCsF|jjt|j|j|j|j�|j|_|j|_dS(N(RtmoveRR
RRR(RR((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt	mouseMoves*cCs|jjtdd�dS(NRtred(Rt
itemconfigR(RR((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyR
$scCs|jjtdd�dS(NRtblue(RRR(RR((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyR)scCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdt�tj	|jd|j
�tj	|jd|j�dS(
NttexttQUITt
foregroundRtcommandtsideRtwidtht5itheights<1>s<B1-Motion>(tButtontquitRtpacktLEFTtBOTHtCanvasRtWidgettbindRR(R((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt
createWidgets.scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR*(Rtmaster((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyR,8s
N(	t__name__t
__module__RRR
RR*tNoneR,(((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyRs					
N(tTkinterR+Rttesttmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt<module>s
7	PK�[0L���killing-window-w-wm.pycnu�[����
��^c@s@ddlTd�Zdefd��YZe�Zej�dS(i����(t*cCs	dGHdS(Nswhoops -- tried to delete me!((((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pytmy_delete_callback	stTestcBs&eZd�Zd�Zdd�ZRS(cCs
|GdGHdS(Ns3is now getting nuked. performing some save here....((tselftevent((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pytdeathHandler
scCs,t|dd�|_|jjdt�dS(NttexttHellotside(tButtonthi_theretpacktLEFT(R((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyt
createWidgetsscCs>tj||�tj|�|j�|jd|j�dS(Ns	<Destroy>(tFramet__init__tPacktconfigR
tbind_allR(Rtmaster((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyRs

N(t__name__t
__module__RR
tNoneR(((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyRs		N(tTkinterRRRttesttmainloop(((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyt<module>s
		PK�[	����slider-demo-1.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs
dG|GHdS(Ns
slider now at((tselftval((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pytprint_valuescCs|jjd�dS(Ni(tslidertset(R((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pytreset
scCs�t|dddddtdddd	d
|j�|_t|ddd
|j�|_t|dd
ddd
|j�|_|jjdt	�|jjdt	�|jjdt	dt
�dS(Ntfrom_ittoidtorienttlengtht3itlabelshappy slidertcommandttextsreset slidertQUITt
foregroundtredtsidetfill(tScalet
HORIZONTALRRtButtonRtquitRtpacktLEFTtBOTH(R((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyt
createWidgets
scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyRs
N(t__name__t
__module__RRRtNoneR(((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyRs			N(tTkinterRRttesttmainloop(((s7/usr/lib64/python2.7/Demo/tkinter/matt/slider-demo-1.pyt<module>s
	PK�[0L���killing-window-w-wm.pyonu�[����
��^c@s@ddlTd�Zdefd��YZe�Zej�dS(i����(t*cCs	dGHdS(Nswhoops -- tried to delete me!((((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pytmy_delete_callback	stTestcBs&eZd�Zd�Zdd�ZRS(cCs
|GdGHdS(Ns3is now getting nuked. performing some save here....((tselftevent((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pytdeathHandler
scCs,t|dd�|_|jjdt�dS(NttexttHellotside(tButtonthi_theretpacktLEFT(R((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyt
createWidgetsscCs>tj||�tj|�|j�|jd|j�dS(Ns	<Destroy>(tFramet__init__tPacktconfigR
tbind_allR(Rtmaster((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyRs

N(t__name__t
__module__RR
tNoneR(((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyRs		N(tTkinterRRRttesttmainloop(((s=/usr/lib64/python2.7/Demo/tkinter/matt/killing-window-w-wm.pyt<module>s
		PK�[S�"

placer-simple.pycnu�[����
��^c@seddlTd�Zd�Zd�Ze�Zee�Zejd�ejdd�ej	�dS(i����(t*cCs#tjjd|jd|j�dS(Ntxty(tapptbuttontplaceRR(tevent((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pyt	do_motionscCs	dGHdS(Nscalling me!((((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pytdothisscCs�t|dddddd�}|jdddd�t|d	d
ddd
t�|_|jjdddddt�|jdt�|S(Ntwidthi�theightt
backgroundtgreentrelxgtrelyt
foregroundtredttexttamazingtcommandg�?tanchors<Control-Shift-Motion>(tFrameRtButtonRRtNWtbindR(ttoptf((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pyt
createWidgetss!t400x400i�N(
tTkinterRRRtTktrootRtgeometrytmaxsizetmainloop(((s7/usr/lib64/python2.7/Demo/tkinter/matt/placer-simple.pyt<module>s
				
PK�[;U<��subclass-existing-widgets.pycnu�[����
��^c@sJddlTdefd��YZd�Ze�Zee�ej�dS(i����(t*t
New_ButtoncBseZd�ZRS(cCs|jGH|jd|_dS(Ni(tcounter(tself((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pytcallbacks(t__name__t
__module__R(((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pyRscCs�t|�}|j�t|ddddd|j�|_|jjdtdt�t|dd�|_|jj	d|jj
�|jjdt�d	|j_dS(
NttexttQUITt
foregroundtredtcommandtsidetfilltHelloi+(tFrametpacktButtontquitRtLEFTtBOTHRthi_theretconfigRR(ttoptf((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pyt
createWidgetss
$N(tTkinterRRRtTktroottmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/subclass-existing-widgets.pyt<module>s

		
PK�[�̆^not-what-you-might-think-1.pyonu�[����
��^c@sWddlTdefd��YZe�Zejjd�ejjd�ej�dS(i����(t*tTestcBseZd�Zdd�ZRS(cCsxt|dddddd�|_|jjdt�t|jddd	d
d|j�|j_|jjjdt�dS(Ntwidtht1itheightt
backgroundtgreentsidettexttQUITt
foregroundtredtcommand(tFrametGpaneltpacktLEFTtButtontquitR	(tself((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(R
t__init__tPacktconfigR(Rtmaster((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyRs
N(t__name__t
__module__RtNoneR(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyRs	
spacker demotpackerN(tTkinterR
RttestRttitleticonnametmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyt<module>s

	PK�[3��(jjwindow-creation-simple.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pytprintitscCs/t�}t|dd�|_|jj�dS(NttextsHere's a new window(tTopleveltLabeltlabeltpack(Rtfred((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyt
makeWindow	s	cCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NRtQUITt
foregroundtredtcommandtsidetfillsMake a New Window(tButtontquitRR	tLEFTtBOTHRthi_there(R((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyRs
N(t__name__t
__module__RRRtNoneR(((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyRs			N(tTkinterRRttesttmainloop(((s@/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-simple.pyt<module>s
	PK�[������animation-simple.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pytprintitsc	Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjddddd
ddd�|jjdt�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheightii
ttagstthingtblue(	tButtontquitRtpacktLEFTtBOTHtCanvastdrawtcreate_rectangle(R((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyt
createWidgets	s%cGs-|jjddd�|jd|j�dS(NRs0.01ii
(Rtmovetaftert	moveThing(Rtargs((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyRscCs>tj||�tj|�|j�|jd|j�dS(Ni
(tFramet__init__tPacktconfigRRR(Rtmaster((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyR s

N(t__name__t
__module__RRRtNoneR (((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyRs			N(tTkinterRRttesttmainloop(((s:/usr/lib64/python2.7/Demo/tkinter/matt/animation-simple.pyt<module>s
	PK�[Mh�Ω	�	canvas-moving-w-mouse.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(cCs|j|_|j|_dS(N(txtlastxtytlasty(tselftevent((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt	mouseDown	scCsF|jjt|j|j|j|j�|j|_|j|_dS(N(tdrawtmovetCURRENTRRRR(RR((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt	mouseMoves*cCs|jjtdd�dS(Ntfilltred(R	t
itemconfigR(RR((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt
mouseEnterscCs|jjtdd�dS(NR
tblue(R	RR(RR((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt
mouseLeavesc	Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdt�|jjdddddd
dd�}|jj	|d|j
�|jj	|d|j�tj
|jd|j�tj
|jd|j�dS(NttexttQUITt
foregroundRtcommandtsideR
twidtht5itheightiitgreenttagstselecteds<Any-Enter>s<Any-Leave>s<1>s<B1-Motion>(tButtontquitRtpacktLEFTtBOTHtCanvasR	tcreate_ovalttag_bindRRtWidgettbindRR(Rtfred((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt
createWidgets!scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR)(Rtmaster((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyR+1s
N(	t__name__t
__module__RRRRR)tNoneR+(((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyRs						N(tTkinterR*Rttesttmainloop(((s?/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-w-mouse.pyt<module>s
1	PK�[�nЈ	�	
dialog-box.pynu�[���from Tkinter import *
from Dialog import Dialog

# this shows how to create a new window with a button in it
# that can create new windows

class Test(Frame):
    def printit(self):
        print "hi"

    def makeWindow(self):
        """Create a top-level dialog with some buttons.

        This uses the Dialog class, which is a wrapper around the Tcl/Tk
        tk_dialog script.  The function returns 0 if the user clicks 'yes'
        or 1 if the user clicks 'no'.
        """
        # the parameters to this call are as follows:
        d = Dialog(
            self,                       ## name of a toplevel window
            title="fred the dialog box",## title on the window
            text="click on a choice",   ## message to appear in window
            bitmap="info",              ## bitmap (if any) to appear;
                                        ## if none, use ""
            #     legal values here are:
            #      string      what it looks like
            #      ----------------------------------------------
            #      error       a circle with a slash through it
            #      grey25      grey square
            #      grey50      darker grey square
            #      hourglass   use for "wait.."
            #      info        a large, lower case "i"
            #      questhead   a human head with a "?" in it
            #      question    a large "?"
            #      warning     a large "!"
            #        @fname    X bitmap where fname is the path to the file
            #
            default=0,    # the index of the default button choice.
                          # hitting return selects this
            strings=("yes", "no"))
                          # values of the 'strings' key are the labels for the
                          # buttons that appear left to right in the dialog box
        return d.num


    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)

        # a hello button
        self.hi_there = Button(self, text='Make a New Window',
                               command=self.makeWindow)
        self.hi_there.pack(side=LEFT)


    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.windownum = 0
        self.createWidgets()

test = Test()
test.mainloop()
PK�[�	��NNcanvas-moving-w-mouse.pynu�[���from Tkinter import *

# this file demonstrates the movement of a single canvas item under mouse control

class Test(Frame):
    ###################################################################
    ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
    ###################################################################
    def mouseDown(self, event):
        # remember where the mouse went down
        self.lastx = event.x
        self.lasty = event.y

    def mouseMove(self, event):
        # whatever the mouse is over gets tagged as CURRENT for free by tk.
        self.draw.move(CURRENT, event.x - self.lastx, event.y - self.lasty)
        self.lastx = event.x
        self.lasty = event.y

    ###################################################################
    ###### Event callbacks for canvas ITEMS (stuff drawn on the canvas)
    ###################################################################
    def mouseEnter(self, event):
        # the CURRENT tag is applied to the object the cursor is over.
        # this happens automatically.
        self.draw.itemconfig(CURRENT, fill="red")

    def mouseLeave(self, event):
        # the CURRENT tag is applied to the object the cursor is over.
        # this happens automatically.
        self.draw.itemconfig(CURRENT, fill="blue")

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)
        self.draw = Canvas(self, width="5i", height="5i")
        self.draw.pack(side=LEFT)

        fred = self.draw.create_oval(0, 0, 20, 20,
                                     fill="green", tags="selected")

        self.draw.tag_bind(fred, "<Any-Enter>", self.mouseEnter)
        self.draw.tag_bind(fred, "<Any-Leave>", self.mouseLeave)

        Widget.bind(self.draw, "<1>", self.mouseDown)
        Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[����rubber-line-demo-1.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs8eZd�Zd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pytprintitscCs{t|ddddddddd	|j�|_|jjd
tdt�t|dd
dd
�|_|jjd
t�dS(NttexttQUITt
backgroundtredt
foregroundtwhitetheightitcommandtsidetfilltwidtht5i(	tButtontquitRtpacktBOTTOMtBOTHtCanvastcanvasObjecttLEFT(R((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyt
createWidgetsscCs4|jj|j�|_|jj|j�|_dS(N(Rtcanvasxtxtstartxtcanvasytytstarty(Rtevent((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyt	mouseDownscCs�|jj|j�}|jj|j�}|j|jkr�|j|jkr�|jj|j�|jj	|j|j||�|_|j
�ndS(N(RRRRRRRtdeletetrubberbandLinetcreate_linetupdate_idletasks(RR RR((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pytmouseMotions$	cCsftj||�tj|�|j�d|_tj|j	d|j
�tj|j	d|j�dS(Ns
<Button-1>s<Button1-Motion>(tFramet__init__tPacktconfigRtNoneR#tWidgettbindRR!R&(Rtmaster((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyR('s

	N(t__name__t
__module__RRR!R&R+R((((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyRs
				N(tTkinterR'Rttesttmainloop(((s</usr/lib64/python2.7/Demo/tkinter/matt/rubber-line-demo-1.pyt<module>s
.	PK�[e��̍�canvas-demo-simple.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pytprintitscCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdddddd
�|jjdt	�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheightit3itblack(
tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawtcreate_rectangletLEFT(R((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyt
createWidgets	scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyRs
N(t__name__t
__module__RRtNoneR(((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyRs		N(tTkinterRRttesttmainloop(((s</usr/lib64/python2.7/Demo/tkinter/matt/canvas-demo-simple.pyt<module>s
	PK�[L�

printing-coords-of-items.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(cCs�|jjt�s�|jj|jd|jd|jd|jddd�}|jj|d|j�|jj|d|j	�n|j|_
|j|_dS(Ni
tfilltgreens<Enter>s<Leave>(twidgettfind_withtagtCURRENTtdrawtcreate_ovaltxtyttag_bindt
mouseEntert
mouseLeavetlastxtlasty(tselfteventtfred((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt	mouseDown	s	+	cCsF|jjt|j|j|j|j�|j|_|j|_dS(N(RtmoveRR	RR
R(RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt	mouseMoves*cCs+|jjtdd�|jjt�GHdS(NRtred(Rt
itemconfigRtcoords(RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyR"scCs|jjtdd�dS(NRtblue(RRR(RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyR
(scCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdt�tj	|jd|j
�tj	|jd|j�dS(
NttexttQUITt
foregroundRtcommandtsideRtwidtht5itheights<1>s<B1-Motion>(tButtontquitRtpacktLEFTtBOTHtCanvasRtWidgettbindRR(R((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt
createWidgets-scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR*(Rtmaster((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyR,7s
N(	t__name__t
__module__RRRR
R*tNoneR,(((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyRs					
N(tTkinterR+Rttesttmainloop(((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt<module>s
7	PK�[b�r;	;	canvas-with-scrollbars.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pytprintit	sc
Cs�t|dd�|_|jj�t|ddddddd|j�|_|jjd	td
t�t|dd�}|jd	t�t	|dd
dd
dddd�|_
t|dt�|j
_
t|dt�|j
_|j
j
j|j
d<|j
jj|j
d<|j
j|j
j
d<|j
j|j
jd<|j
jddddd
d�|j
jddddd
d�|j
j
jd	td
t�|j
jjd	td
t�|j
jd	t�dS(NttextsCan Find The BLUE Square??????tQUITt
backgroundtredtheightitcommandtsidetfills0.25itwidtht5itwhitetscrollregionit20itorienttxscrollcommandtyscrollcommands3.5itblackt10is13.5itblue(iiRR(tLabeltquestiontpacktButtontquitRtBOTTOMtBOTHtFrametCanvastdrawt	Scrollbart
HORIZONTALtscrollXtVERTICALtscrollYtsettxviewtyviewtcreate_rectangletXtRIGHTtYtLEFT(Rtspacer((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyt
createWidgetss*
cGsdG|GH|jjj�GHdS(Nt	scrolling(R!R$tget(Rtargs((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyt
scrollCanvasX0s	cCs+tj||�tj|�|j�dS(N(Rt__init__tPacktconfigR0(Rtmaster((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyR55s
N(t__name__t
__module__RR0R4tNoneR5(((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyRs		$	N(tTkinterRRttesttmainloop(((s@/usr/lib64/python2.7/Demo/tkinter/matt/canvas-with-scrollbars.pyt<module>s
2	PK�[��>kv	v	canvas-moving-or-creating.pynu�[���from Tkinter import *

# this file demonstrates a more sophisticated movement --
# move dots or create new ones if you click outside the dots

class Test(Frame):
    ###################################################################
    ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
    ###################################################################
    def mouseDown(self, event):
        # see if we're inside a dot. If we are, it
        # gets tagged as CURRENT for free by tk.
        if not event.widget.find_withtag(CURRENT):
            # there is no dot here, so we can make one,
            # and bind some interesting behavior to it.
            # ------
            # create a dot, and mark it as CURRENT
            fred = self.draw.create_oval(
                event.x - 10, event.y -10, event.x +10, event.y + 10,
                fill="green", tags=CURRENT)

            self.draw.tag_bind(fred, "<Any-Enter>", self.mouseEnter)
            self.draw.tag_bind(fred, "<Any-Leave>", self.mouseLeave)

        self.lastx = event.x
        self.lasty = event.y

    def mouseMove(self, event):
        self.draw.move(CURRENT, event.x - self.lastx, event.y - self.lasty)
        self.lastx = event.x
        self.lasty = event.y

    ###################################################################
    ###### Event callbacks for canvas ITEMS (stuff drawn on the canvas)
    ###################################################################
    def mouseEnter(self, event):
        # the CURRENT tag is applied to the object the cursor is over.
        # this happens automatically.
        self.draw.itemconfig(CURRENT, fill="red")

    def mouseLeave(self, event):
        # the CURRENT tag is applied to the object the cursor is over.
        # this happens automatically.
        self.draw.itemconfig(CURRENT, fill="blue")

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)
        self.draw = Canvas(self, width="5i", height="5i")
        self.draw.pack(side=LEFT)

        Widget.bind(self.draw, "<1>", self.mouseDown)
        Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[�x�#�#menu-all-types-of-entries.pynu�[���from Tkinter import *

# some vocabulary to keep from getting confused. This terminology
# is something I cooked up for this file, but follows the man pages
# pretty closely
#
#
#
#       This is a MENUBUTTON
#       V
# +-------------+
# |             |
#
# +------------++------------++------------+
# |            ||            ||            |
# |  File      ||  Edit      || Options    |   <-------- the MENUBAR
# |            ||            ||            |
# +------------++------------++------------+
# | New...         |
# | Open...        |
# | Print          |
# |                |  <-------- This is a MENU. The lines of text in the menu are
# |                |                            MENU ENTRIES
# |                +---------------+
# | Open Files >   | file1         |
# |                | file2         |
# |                | another file  | <------ this cascading part is also a MENU
# +----------------|               |
#                  |               |
#                  |               |
#                  |               |
#                  +---------------+



# some miscellaneous callbacks
def new_file():
    print "opening new file"

def open_file():
    print "opening OLD file"

def print_something():
    print "picked a menu item"



anchovies = 0

def print_anchovies():
    global anchovies
    anchovies = not anchovies
    print "anchovies?", anchovies

def makeCommandMenu():
    # make menu button
    Command_button = Menubutton(mBar, text='Simple Button Commands',
                                underline=0)
    Command_button.pack(side=LEFT, padx="2m")

    # make the pulldown part of the File menu. The parameter passed is the master.
    # we attach it to the button as a python attribute called "menu" by convention.
    # hopefully this isn't too confusing...
    Command_button.menu = Menu(Command_button)

    # just to be cute, let's disable the undo option:
    Command_button.menu.add_command(label="Undo")
    # undo is the 0th entry...
    Command_button.menu.entryconfig(0, state=DISABLED)

    Command_button.menu.add_command(label='New...', underline=0,
                                    command=new_file)
    Command_button.menu.add_command(label='Open...', underline=0,
                                    command=open_file)
    Command_button.menu.add_command(label='Different Font', underline=0,
                                    font='-*-helvetica-*-r-*-*-*-180-*-*-*-*-*-*',
                                    command=print_something)

    # we can make bitmaps be menu entries too. File format is X11 bitmap.
    # if you use XV, save it under X11 bitmap format. duh-uh.,..
    Command_button.menu.add_command(
        bitmap="info")
        #bitmap='@/home/mjc4y/dilbert/project.status.is.doomed.last.panel.bm')

    # this is just a line
    Command_button.menu.add('separator')

    # change the color
    Command_button.menu.add_command(label='Quit', underline=0,
                                    background='red',
                                    activebackground='green',
                                    command=Command_button.quit)

    # set up a pointer from the file menubutton back to the file menu
    Command_button['menu'] = Command_button.menu

    return Command_button



def makeCascadeMenu():
    # make menu button
    Cascade_button = Menubutton(mBar, text='Cascading Menus', underline=0)
    Cascade_button.pack(side=LEFT, padx="2m")

    # the primary pulldown
    Cascade_button.menu = Menu(Cascade_button)

    # this is the menu that cascades from the primary pulldown....
    Cascade_button.menu.choices = Menu(Cascade_button.menu)

    # ...and this is a menu that cascades from that.
    Cascade_button.menu.choices.weirdones = Menu(Cascade_button.menu.choices)

    # then you define the menus from the deepest level on up.
    Cascade_button.menu.choices.weirdones.add_command(label='avacado')
    Cascade_button.menu.choices.weirdones.add_command(label='belgian endive')
    Cascade_button.menu.choices.weirdones.add_command(label='beefaroni')

    # definition of the menu one level up...
    Cascade_button.menu.choices.add_command(label='Chocolate')
    Cascade_button.menu.choices.add_command(label='Vanilla')
    Cascade_button.menu.choices.add_command(label='TuttiFruiti')
    Cascade_button.menu.choices.add_command(label='WopBopaLoopBapABopBamBoom')
    Cascade_button.menu.choices.add_command(label='Rocky Road')
    Cascade_button.menu.choices.add_command(label='BubbleGum')
    Cascade_button.menu.choices.add_cascade(
        label='Weird Flavors',
        menu=Cascade_button.menu.choices.weirdones)

    # and finally, the definition for the top level
    Cascade_button.menu.add_cascade(label='more choices',
                                    menu=Cascade_button.menu.choices)

    Cascade_button['menu'] = Cascade_button.menu

    return Cascade_button

def makeCheckbuttonMenu():
    global fred
    # make menu button
    Checkbutton_button = Menubutton(mBar, text='Checkbutton Menus',
                                    underline=0)
    Checkbutton_button.pack(side=LEFT, padx='2m')

    # the primary pulldown
    Checkbutton_button.menu = Menu(Checkbutton_button)

    # and all the check buttons. Note that the "variable" "onvalue" and "offvalue" options
    # are not supported correctly at present. You have to do all your application
    # work through the calback.
    Checkbutton_button.menu.add_checkbutton(label='Pepperoni')
    Checkbutton_button.menu.add_checkbutton(label='Sausage')
    Checkbutton_button.menu.add_checkbutton(label='Extra Cheese')

    # so here's a callback
    Checkbutton_button.menu.add_checkbutton(label='Anchovy',
                                            command=print_anchovies)

    # and start with anchovies selected to be on. Do this by
    # calling invoke on this menu option. To refer to the "anchovy" menu
    # entry we need to know it's index. To do this, we use the index method
    # which takes arguments of several forms:
    #
    # argument        what it does
    # -----------------------------------
    # a number        -- this is useless.
    # "last"          -- last option in the menu
    # "none"          -- used with the activate command. see the man page on menus
    # "active"        -- the currently active menu option. A menu option is made active
    #                         with the 'activate' method
    # "@number"       -- where 'number' is an integer and is treated like a y coordinate in pixels
    # string pattern  -- this is the option used below, and attempts to match "labels" using the
    #                    rules of Tcl_StringMatch
    Checkbutton_button.menu.invoke(Checkbutton_button.menu.index('Anchovy'))

    # set up a pointer from the file menubutton back to the file menu
    Checkbutton_button['menu'] = Checkbutton_button.menu

    return Checkbutton_button


def makeRadiobuttonMenu():
    # make menu button
    Radiobutton_button = Menubutton(mBar, text='Radiobutton Menus',
                                    underline=0)
    Radiobutton_button.pack(side=LEFT, padx='2m')

    # the primary pulldown
    Radiobutton_button.menu = Menu(Radiobutton_button)

    # and all the Radio buttons. Note that the "variable" "onvalue" and "offvalue" options
    # are not supported correctly at present. You have to do all your application
    # work through the calback.
    Radiobutton_button.menu.add_radiobutton(label='Republican')
    Radiobutton_button.menu.add_radiobutton(label='Democrat')
    Radiobutton_button.menu.add_radiobutton(label='Libertarian')
    Radiobutton_button.menu.add_radiobutton(label='Commie')
    Radiobutton_button.menu.add_radiobutton(label='Facist')
    Radiobutton_button.menu.add_radiobutton(label='Labor Party')
    Radiobutton_button.menu.add_radiobutton(label='Torie')
    Radiobutton_button.menu.add_radiobutton(label='Independent')
    Radiobutton_button.menu.add_radiobutton(label='Anarchist')
    Radiobutton_button.menu.add_radiobutton(label='No Opinion')

    # set up a pointer from the file menubutton back to the file menu
    Radiobutton_button['menu'] = Radiobutton_button.menu

    return Radiobutton_button


def makeDisabledMenu():
    Dummy_button = Menubutton(mBar, text='Dead Menu', underline=0)
    Dummy_button.pack(side=LEFT, padx='2m')

    # this is the standard way of turning off a whole menu
    Dummy_button["state"] = DISABLED
    return Dummy_button


#################################################
#### Main starts here ...
root = Tk()


# make a menu bar
mBar = Frame(root, relief=RAISED, borderwidth=2)
mBar.pack(fill=X)

Command_button     = makeCommandMenu()
Cascade_button     = makeCascadeMenu()
Checkbutton_button = makeCheckbuttonMenu()
Radiobutton_button = makeRadiobuttonMenu()
NoMenu             = makeDisabledMenu()

# finally, install the buttons in the menu bar.
# This allows for scanning from one menubutton to the next.
mBar.tk_menuBar(Command_button, Cascade_button, Checkbutton_button, Radiobutton_button, NoMenu)


root.title('menu demo')
root.iconname('menu demo')

root.mainloop()
PK�[:���
�
canvas-mult-item-sel.pyonu�[����
��^c@sCddlTdZdZdefd��YZe�Zej�dS(i����(t*tredtbluetTestcBs8eZd�Zd�Zd�Zd�Zdd�ZRS(cCs�|jjt�s;|jjddt�|jjd�n,|jjddt�|jjddt�|j	|_
|j|_dS(Ntselectedtfilltwithtag(
twidgettfind_withtagtCURRENTtdrawt
itemconfigtUNSELECTED_COLORtdtagtaddtagtSELECTED_COLORtxtlastxtytlasty(tselftevent((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt	mouseDownscCsF|jjd|j|j|j|j�|j|_|j|_dS(NR(R
tmoveRRRR(RR((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt	mouseMove!s*c	CsA|jjdddddtdt�}|jjddt�dS(NiiRttagsRR(R
tcreate_ovalRR	R(Rtfred((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt
makeNewDot&scCs(t|ddddd|j�|_t|dddd�|_tj|jd	|j�tj|jd
|j�t|ddddd|j	�|_
d
ttf}t
|ddd|�|_|jjdtdt�|jjdtdtdd�|j
jdtdt�|jjdt�dS(NttexttQUITt
foregroundRtcommandtwidtht5itheights<1>s<B1-Motion>smake a new dotRs�%s dots are selected and can be dragged.
%s are not selected.
Click in a dot to select it.
Click on empty space to deselect all dots.tsideRtexpandi(tButtontquitRtCanvasR
tWidgettbindRRRtbuttonRRtMessagetlabeltpacktBOTTOMtBOTHtXtLEFT(Rtmessage((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt
createWidgets-s
cCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR4(Rtmaster((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyR6Hs
N(t__name__t
__module__RRRR4tNoneR6(((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyRs
				N(tTkinterRRR5Rttesttmainloop(((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt<module>s

E	PK�[�F�77not-what-you-might-think-2.pyonu�[����
��^c@sWddlTdefd��YZe�Zejjd�ejjd�ej�dS(i����(t*tTestcBseZd�Zdd�ZRS(cCs�t|dddddd�|_|jjd�|jjdt�t|jdd	d
dd|j�|j_|jjjdt�dS(
Ntwidtht1itheightt
backgroundtgreenitsidettexttQUITt
foregroundtredtcommand(tFrametGpanelt	propagatetpacktLEFTtButtontquitR	(tself((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(R
t__init__tPacktconfigR(Rtmaster((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyRs
N(t__name__t
__module__RtNoneR(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyRs	spacker demotpackerN(tTkinterR
RttestRttitleticonnametmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-2.pyt<module>s

	PK�[L�

printing-coords-of-items.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(cCs�|jjt�s�|jj|jd|jd|jd|jddd�}|jj|d|j�|jj|d|j	�n|j|_
|j|_dS(Ni
tfilltgreens<Enter>s<Leave>(twidgettfind_withtagtCURRENTtdrawtcreate_ovaltxtyttag_bindt
mouseEntert
mouseLeavetlastxtlasty(tselfteventtfred((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt	mouseDown	s	+	cCsF|jjt|j|j|j|j�|j|_|j|_dS(N(RtmoveRR	RR
R(RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt	mouseMoves*cCs+|jjtdd�|jjt�GHdS(NRtred(Rt
itemconfigRtcoords(RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyR"scCs|jjtdd�dS(NRtblue(RRR(RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyR
(scCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdt�tj	|jd|j
�tj	|jd|j�dS(
NttexttQUITt
foregroundRtcommandtsideRtwidtht5itheights<1>s<B1-Motion>(tButtontquitRtpacktLEFTtBOTHtCanvasRtWidgettbindRR(R((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt
createWidgets-scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR*(Rtmaster((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyR,7s
N(	t__name__t
__module__RRRR
R*tNoneR,(((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyRs					
N(tTkinterR+Rttesttmainloop(((sB/usr/lib64/python2.7/Demo/tkinter/matt/printing-coords-of-items.pyt<module>s
7	PK�[��aI

canvas-moving-or-creating.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBsAeZd�Zd�Zd�Zd�Zd�Zdd�ZRS(c	Cs�|jjt�s�|jj|jd|jd|jd|jddddt�}|jj|d|j�|jj|d|j	�n|j|_
|j|_dS(Ni
tfilltgreenttagss<Any-Enter>s<Any-Leave>(twidgettfind_withtagtCURRENTtdrawtcreate_ovaltxtyttag_bindt
mouseEntert
mouseLeavetlastxtlasty(tselfteventtfred((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt	mouseDown
s	+cCsF|jjt|j|j|j|j�|j|_|j|_dS(N(RtmoveRR
RRR(RR((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt	mouseMoves*cCs|jjtdd�dS(NRtred(Rt
itemconfigR(RR((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyR
$scCs|jjtdd�dS(NRtblue(RRR(RR((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyR)scCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_|jjdt�tj	|jd|j
�tj	|jd|j�dS(
NttexttQUITt
foregroundRtcommandtsideRtwidtht5itheights<1>s<B1-Motion>(tButtontquitRtpacktLEFTtBOTHtCanvasRtWidgettbindRR(R((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt
createWidgets.scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR*(Rtmaster((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyR,8s
N(	t__name__t
__module__RRR
RR*tNoneR,(((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyRs					
N(tTkinterR+Rttesttmainloop(((sC/usr/lib64/python2.7/Demo/tkinter/matt/canvas-moving-or-creating.pyt<module>s
7	PK�[���d��canvas-w-widget-draw-el.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pytprinthiscCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_t|ddd|j�|_	|jj
ddd
|j	�|jjdt�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheightsthis is a buttoni,twindow(tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawRtbuttont
create_windowtLEFT(R((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyt
createWidgets	scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyRs
N(t__name__t
__module__RRtNoneR(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyRs		N(tTkinterRRttesttmainloop(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyt<module>s
	PK�[�uk/��animation-simple.pynu�[���from Tkinter import *

# This program shows how to use the "after" function to make animation.

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)

        self.draw = Canvas(self, width="5i", height="5i")

        # all of these work..
        self.draw.create_rectangle(0, 0, 10, 10, tags="thing", fill="blue")
        self.draw.pack(side=LEFT)

    def moveThing(self, *args):
        # move 1/10 of an inch every 1/10 sec (1" per second, smoothly)
        self.draw.move("thing", "0.01i", "0.01i")
        self.after(10, self.moveThing)


    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()
        self.after(10, self.moveThing)


test = Test()

test.mainloop()
PK�[��t44entry-simple.pycnu�[����
��^c@sSddlTddlZdefd��YZe�Zejjd�ej�dS(i����(t*NtAppcBseZdd�Zd�ZRS(cCsMtj||�|j�t�|_|jj�|jjd|j�dS(Ns<Key-Return>(tFramet__init__tpacktEntrytentrythingytbindtprint_contents(tselftmaster((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyRs


cCsdG|jj�GHdS(Ns"hi. contents of entry is now ---->(Rtget(R	tevent((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyRsN(t__name__t
__module__tNoneRR(((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyRstFoo(tTkintertstringRRtrootR
ttitletmainloop(((s6/usr/lib64/python2.7/Demo/tkinter/matt/entry-simple.pyt<module>s

	PK�[�� �yybind-w-mult-calls-p-type.pycnu�[����
��^c@sSddlTddlZdefd��YZe�Zejjd�ej�dS(i����(t*NtAppcBs&eZdd�Zd�Zd�ZRS(cCsftj||�|j�t�|_|jj�|jjd|j�|jjd|jd�dS(Ns<Key-Return>t+(tFramet__init__tpacktEntrytentrythingytbindtprint_contentstprint_something_else(tselftmaster((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyRs

cCsdG|jj�GHdS(Ns"hi. contents of entry is now ---->(Rtget(Rtevent((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyR	scCs	dGHdS(Ns,hi. Now doing something completely different((RR((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyR
sN(t__name__t
__module__tNoneRR	R
(((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyRs	tFoo(tTkintertstringRRtrootRttitletmainloop(((sB/usr/lib64/python2.7/Demo/tkinter/matt/bind-w-mult-calls-p-type.pyt<module>s

	PK�[~ǁ���not-what-you-might-think-2.pynu�[���from Tkinter import *


class Test(Frame):
    def createWidgets(self):

        self.Gpanel = Frame(self, width='1i', height='1i',
                            background='green')

        # this line turns off the recalculation of geometry by masters.
        self.Gpanel.propagate(0)

        self.Gpanel.pack(side=LEFT)

        # a QUIT button
        self.Gpanel.QUIT = Button(self.Gpanel, text='QUIT', foreground='red',
                                  command=self.quit)
        self.Gpanel.QUIT.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.master.title('packer demo')
test.master.iconname('packer')

test.mainloop()
PK�[4+���two-radio-groups.pycnu�[����
��^c@s�ddlTd�Zd�Zd�Ze�Zeededd�Zej	de
�e�Ze
�Zee�Zee�Zejee�eed	d
ddd
e�Zej	de�ejd�ejd�ej�dS(i����(t*cCs�ttdddd�}|jdtdd�t|�|_|jjdd	d
|dd�|jjd
idd6|d
6dd6�|jjd
idd6|d
6dd6�|jd�|j|d<|S(NttextsPolitical Partyt	underlineitsidetpadxt2mtlabelt
RepublicantvariabletvalueitradiobuttontDemocratitLibertarianitmenu(	t
MenubuttontmBartpacktLEFTtMenuR
tadd_radiobuttontaddtset(tvartRadiobutton_button((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pytmakePoliticalPartiess	


cCs�ttdddd�}|jdtdd�t|�|_|jjdd	d
|dd	�|jjddd
|dd�|jjdd
d
|dd
�|jd�|j|d<|S(NRtFlavorsRiRRRRt
StrawberryRR	t	Chocolates
Rocky RoadR
(RRRRRR
RR(RR((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pytmakeFlavors2s	




cCs#dGtj�GHdGtj�GHHdS(Nsparty iss	flavor is(tpartytgettflavor(((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pyt
printStuffMstrelieftborderwidthitfillRsprint party and flavort
foregroundtredtcommandRs	menu demoN(tTkinterRRR tTktroottFrametRAISEDRRtXtIntVarRt	StringVarRRtRadiobutton_button2t
tk_menuBartButtontbtTOPttitleticonnametmainloop(((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pyt<module>s"
							

PK�[����PPpong-demo-1.pycnu�[����
��^c@sCddlTddlZdefd��YZe�Zej�dS(i����(t*NtPongcBs&eZd�Zd�Zdd�ZRS(c
Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_t|dt	dd
dddd�|_
|j
jdtdt�|jj
dddddd�|_d|_d|_d|_d|_|jjdt�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheighttorienttlabels
ball speedtfrom_i����ttoidt0is0.10ig�������?g333333�?g�?(tButtontquitRtpacktLEFTtBOTHtCanvastdrawtScalet
HORIZONTALtspeedtBOTTOMtXtcreate_ovaltballtxtyt
velocity_xt
velocity_y(tself((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyt
createWidgetss				cGs�|jdks|jdkr1d|j|_n|jdksO|jdkrbd|j|_n|j|jj�d}|j|jj�d}|j||_|j||_|jj|jd|d|�|j	d|j
�dS(Ng@gg�gY@s%rii
(RR!R R"RtgetRtmoveRtaftertmoveBall(R#targstdeltaxtdeltay((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyR(s!cCs>tj||�tj|�|j�|jd|j�dS(Ni
(tFramet__init__tPacktconfigR$R'R((R#tmaster((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyR--s

N(t__name__t
__module__R$R(tNoneR-(((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyRs		(tTkintertstringR,Rtgametmainloop(((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyt<module>s
.	PK�[:���
�
canvas-mult-item-sel.pycnu�[����
��^c@sCddlTdZdZdefd��YZe�Zej�dS(i����(t*tredtbluetTestcBs8eZd�Zd�Zd�Zd�Zdd�ZRS(cCs�|jjt�s;|jjddt�|jjd�n,|jjddt�|jjddt�|j	|_
|j|_dS(Ntselectedtfilltwithtag(
twidgettfind_withtagtCURRENTtdrawt
itemconfigtUNSELECTED_COLORtdtagtaddtagtSELECTED_COLORtxtlastxtytlasty(tselftevent((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt	mouseDownscCsF|jjd|j|j|j|j�|j|_|j|_dS(NR(R
tmoveRRRR(RR((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt	mouseMove!s*c	CsA|jjdddddtdt�}|jjddt�dS(NiiRttagsRR(R
tcreate_ovalRR	R(Rtfred((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt
makeNewDot&scCs(t|ddddd|j�|_t|dddd�|_tj|jd	|j�tj|jd
|j�t|ddddd|j	�|_
d
ttf}t
|ddd|�|_|jjdtdt�|jjdtdtdd�|j
jdtdt�|jjdt�dS(NttexttQUITt
foregroundRtcommandtwidtht5itheights<1>s<B1-Motion>smake a new dotRs�%s dots are selected and can be dragged.
%s are not selected.
Click in a dot to select it.
Click on empty space to deselect all dots.tsideRtexpandi(tButtontquitRtCanvasR
tWidgettbindRRRtbuttonRRtMessagetlabeltpacktBOTTOMtBOTHtXtLEFT(Rtmessage((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt
createWidgets-s
cCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR4(Rtmaster((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyR6Hs
N(t__name__t
__module__RRRR4tNoneR6(((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyRs
				N(tTkinterRRR5Rttesttmainloop(((s>/usr/lib64/python2.7/Demo/tkinter/matt/canvas-mult-item-sel.pyt<module>s

E	PK�[����PPpong-demo-1.pyonu�[����
��^c@sCddlTddlZdefd��YZe�Zej�dS(i����(t*NtPongcBs&eZd�Zd�Zdd�ZRS(c
Cs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_t|dt	dd
dddd�|_
|j
jdtdt�|jj
dddddd�|_d|_d|_d|_d|_|jjdt�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheighttorienttlabels
ball speedtfrom_i����ttoidt0is0.10ig�������?g333333�?g�?(tButtontquitRtpacktLEFTtBOTHtCanvastdrawtScalet
HORIZONTALtspeedtBOTTOMtXtcreate_ovaltballtxtyt
velocity_xt
velocity_y(tself((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyt
createWidgetss				cGs�|jdks|jdkr1d|j|_n|jdksO|jdkrbd|j|_n|j|jj�d}|j|jj�d}|j||_|j||_|jj|jd|d|�|j	d|j
�dS(Ng@gg�gY@s%rii
(RR!R R"RtgetRtmoveRtaftertmoveBall(R#targstdeltaxtdeltay((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyR(s!cCs>tj||�tj|�|j�|jd|j�dS(Ni
(tFramet__init__tPacktconfigR$R'R((R#tmaster((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyR--s

N(t__name__t
__module__R$R(tNoneR-(((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyRs		(tTkintertstringR,Rtgametmainloop(((s5/usr/lib64/python2.7/Demo/tkinter/matt/pong-demo-1.pyt<module>s
.	PK�[R��۩�menu-simple.pycnu�[����
��^c@s�ddlTd�Zd�Zd�Zd�Ze�Zeededd�Z	e	j
d	e�e�Ze�Z
e	jee
�ejd
�ejd�ej�dS(
i����(t*cCs	dGHdS(Nsopening new file((((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pytnew_file$scCs	dGHdS(Nsopening OLD file((((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pyt	open_file(scCs�ttdddd�}|jdtdd�t|�|_|jjdd	ddd
t�|jjddddd
t�|jjddddd
d
�|j|d<|S(NttexttFilet	underlineitsidetpadxt1mtlabelsNew...tcommandsOpen...tQuittexittmenu(	t
MenubuttontmBartpacktLEFTtMenuR
tadd_commandRR(tFile_button((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pytmakeFileMenu,s
cCs�ttdddd�}|jdtdd�t|�|_|jjdd	d
�|jjddt�|jj	d	d
�|jj	d	d�|jj	d	d�|j|d<|S(NRtEditRiRRRR
R	tUndoitstatetCuttCopytPasteR
(
RRRRRR
taddtentryconfigtDISABLEDR(tEdit_button((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pytmakeEditMenuFs
trelieftborderwidthitfills	menu demotpackerN(tTkinterRRRR tTktroottFrametRAISEDRRtXRRt
tk_menuBarttitleticonnametmainloop(((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pyt<module>s
#							

PK�[�}�`	`	printing-coords-of-items.pynu�[���from Tkinter import *

# this file demonstrates the creation of widgets as part of a canvas object

class Test(Frame):
    ###################################################################
    ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
    ###################################################################
    def mouseDown(self, event):
        # see if we're inside a dot. If we are, it
        # gets tagged as CURRENT for free by tk.

        if not event.widget.find_withtag(CURRENT):
            # there is no dot here, so we can make one,
            # and bind some interesting behavior to it.
            # ------
            # create a dot, and mark it as current
            fred = self.draw.create_oval(
                event.x - 10, event.y -10, event.x +10, event.y + 10,
                fill="green")
            self.draw.tag_bind(fred, "<Enter>", self.mouseEnter)
            self.draw.tag_bind(fred, "<Leave>", self.mouseLeave)
        self.lastx = event.x
        self.lasty = event.y

    def mouseMove(self, event):
        self.draw.move(CURRENT, event.x - self.lastx, event.y - self.lasty)
        self.lastx = event.x
        self.lasty = event.y

    ###################################################################
    ###### Event callbacks for canvas ITEMS (stuff drawn on the canvas)
    ###################################################################
    def mouseEnter(self, event):
        # the "current" tag is applied to the object the cursor is over.
        # this happens automatically.
        self.draw.itemconfig(CURRENT, fill="red")
        print self.draw.coords(CURRENT)

    def mouseLeave(self, event):
        # the "current" tag is applied to the object the cursor is over.
        # this happens automatically.
        self.draw.itemconfig(CURRENT, fill="blue")

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=LEFT, fill=BOTH)
        self.draw = Canvas(self, width="5i", height="5i")
        self.draw.pack(side=LEFT)

        Widget.bind(self.draw, "<1>", self.mouseDown)
        Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[�_ ��canvas-demo-simple.pynu�[���from Tkinter import *

# this program creates a canvas and puts a single polygon on the canvas

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.draw = Canvas(self, width="5i", height="5i")

        # see the other demos for other ways of specifying coords for a polygon
        self.draw.create_rectangle(0, 0, "3i", "3i", fill="black")

        self.draw.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.mainloop()
PK�[�>���two-radio-groups.pynu�[���from Tkinter import *

#       The way to think about this is that each radio button menu
#       controls a different variable -- clicking on one of the
#       mutually exclusive choices in a radiobutton assigns some value
#       to an application variable you provide. When you define a
#       radiobutton menu choice, you have the option of specifying the
#       name of a varaible and value to assign to that variable when
#       that choice is selected. This clever mechanism relieves you,
#       the programmer, from having to write a dumb callback that
#       probably wouldn't have done anything more than an assignment
#       anyway. The Tkinter options for this follow their Tk
#       counterparts:
#       {"variable" : my_flavor_variable, "value" : "strawberry"}
#       where my_flavor_variable is an instance of one of the
#       subclasses of Variable, provided in Tkinter.py (there is
#       StringVar(), IntVar(), DoubleVar() and BooleanVar() to choose
#       from)



def makePoliticalParties(var):
    # make menu button
    Radiobutton_button = Menubutton(mBar, text='Political Party',
                                    underline=0)
    Radiobutton_button.pack(side=LEFT, padx='2m')

    # the primary pulldown
    Radiobutton_button.menu = Menu(Radiobutton_button)

    Radiobutton_button.menu.add_radiobutton(label='Republican',
                                            variable=var, value=1)

    Radiobutton_button.menu.add('radiobutton', {'label': 'Democrat',
                                                'variable' : var,
                                                'value' : 2})

    Radiobutton_button.menu.add('radiobutton', {'label': 'Libertarian',
                                                'variable' : var,
                                                'value' : 3})

    var.set(2)

    # set up a pointer from the file menubutton back to the file menu
    Radiobutton_button['menu'] = Radiobutton_button.menu

    return Radiobutton_button


def makeFlavors(var):
    # make menu button
    Radiobutton_button = Menubutton(mBar, text='Flavors',
                                    underline=0)
    Radiobutton_button.pack(side=LEFT, padx='2m')

    # the primary pulldown
    Radiobutton_button.menu = Menu(Radiobutton_button)

    Radiobutton_button.menu.add_radiobutton(label='Strawberry',
                                            variable=var, value='Strawberry')

    Radiobutton_button.menu.add_radiobutton(label='Chocolate',
                                            variable=var, value='Chocolate')

    Radiobutton_button.menu.add_radiobutton(label='Rocky Road',
                                            variable=var, value='Rocky Road')

    # choose a default
    var.set("Chocolate")

    # set up a pointer from the file menubutton back to the file menu
    Radiobutton_button['menu'] = Radiobutton_button.menu

    return Radiobutton_button


def printStuff():
    print "party is", party.get()
    print "flavor is", flavor.get()
    print

#################################################
#### Main starts here ...
root = Tk()


# make a menu bar
mBar = Frame(root, relief=RAISED, borderwidth=2)
mBar.pack(fill=X)

# make two application variables,
# one to control each radio button set
party = IntVar()
flavor = StringVar()

Radiobutton_button = makePoliticalParties(party)
Radiobutton_button2 = makeFlavors(flavor)

# finally, install the buttons in the menu bar.
# This allows for scanning from one menubutton to the next.
mBar.tk_menuBar(Radiobutton_button, Radiobutton_button2)

b = Button(root, text="print party and flavor", foreground="red",
           command=printStuff)
b.pack(side=TOP)

root.title('menu demo')
root.iconname('menu demo')

root.mainloop()
PK�[�̆^not-what-you-might-think-1.pycnu�[����
��^c@sWddlTdefd��YZe�Zejjd�ejjd�ej�dS(i����(t*tTestcBseZd�Zdd�ZRS(cCsxt|dddddd�|_|jjdt�t|jddd	d
d|j�|j_|jjjdt�dS(Ntwidtht1itheightt
backgroundtgreentsidettexttQUITt
foregroundtredtcommand(tFrametGpaneltpacktLEFTtButtontquitR	(tself((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(R
t__init__tPacktconfigR(Rtmaster((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyRs
N(t__name__t
__module__RtNoneR(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyRs	
spacker demotpackerN(tTkinterR
RttestRttitleticonnametmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/not-what-you-might-think-1.pyt<module>s

	PK�[���d��canvas-w-widget-draw-el.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pytprinthiscCs�t|ddddd|j�|_|jjdtdt�t|dd	d
d	�|_t|ddd|j�|_	|jj
ddd
|j	�|jjdt�dS(NttexttQUITt
foregroundtredtcommandtsidetfilltwidtht5itheightsthis is a buttoni,twindow(tButtontquitRtpacktBOTTOMtBOTHtCanvastdrawRtbuttont
create_windowtLEFT(R((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyt
createWidgets	scCs+tj||�tj|�|j�dS(N(tFramet__init__tPacktconfigR(Rtmaster((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyRs
N(t__name__t
__module__RRtNoneR(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyRs		N(tTkinterRRttesttmainloop(((sA/usr/lib64/python2.7/Demo/tkinter/matt/canvas-w-widget-draw-el.pyt<module>s
	PK�[#~���entry-with-shared-variable.pynu�[���from Tkinter import *
import string

# This program  shows how to make a typein box shadow a program variable.

class App(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()

        self.entrythingy = Entry(self)
        self.entrythingy.pack()

        self.button = Button(self, text="Uppercase The Entry",
                             command=self.upper)
        self.button.pack()

        # here we have the text in the entry widget tied to a variable.
        # changes in the variable are echoed in the widget and vice versa.
        # Very handy.
        # there are other Variable types. See Tkinter.py for all
        # the other variable types that can be shadowed
        self.contents = StringVar()
        self.contents.set("this is a variable")
        self.entrythingy.config(textvariable=self.contents)

        # and here we get a callback when the user hits return. we could
        # make the key that triggers the callback anything we wanted to.
        # other typical options might be <Key-Tab> or <Key> (for anything)
        self.entrythingy.bind('<Key-Return>', self.print_contents)

    def upper(self):
        # notice here, we don't actually refer to the entry box.
        # we just operate on the string variable and we
        # because it's being looked at by the entry widget, changing
        # the variable changes the entry widget display automatically.
        # the strange get/set operators are clunky, true...
        str = string.upper(self.contents.get())
        self.contents.set(str)

    def print_contents(self, event):
        print "hi. contents of entry is now ---->", self.contents.get()

root = App()
root.master.title("Foo")
root.mainloop()
PK�[�J����radiobutton-simple.pynu�[���from Tkinter import *

# This is a demo program that shows how to
# create radio buttons and how to get other widgets to
# share the information in a radio button.
#
# There are other ways of doing this too, but
# the "variable" option of radiobuttons seems to be the easiest.
#
# note how each button has a value it sets the variable to as it gets hit.


class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):

        self.flavor = StringVar()
        self.flavor.set("chocolate")

        self.radioframe = Frame(self)
        self.radioframe.pack()

        # 'text' is the label
        # 'variable' is the name of the variable that all these radio buttons share
        # 'value' is the value this variable takes on when the radio button is selected
        # 'anchor' makes the text appear left justified (default is centered. ick)
        self.radioframe.choc = Radiobutton(
            self.radioframe, text="Chocolate Flavor",
            variable=self.flavor, value="chocolate",
            anchor=W)
        self.radioframe.choc.pack(fill=X)

        self.radioframe.straw = Radiobutton(
            self.radioframe, text="Strawberry Flavor",
            variable=self.flavor, value="strawberry",
            anchor=W)
        self.radioframe.straw.pack(fill=X)

        self.radioframe.lemon = Radiobutton(
            self.radioframe, text="Lemon Flavor",
            variable=self.flavor, value="lemon",
            anchor=W)
        self.radioframe.lemon.pack(fill=X)

        # this is a text entry that lets you type in the name of a flavor too.
        self.entry = Entry(self, textvariable=self.flavor)
        self.entry.pack(fill=X)
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)


    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.mainloop()
PK�[����canvas-w-widget-draw-el.pynu�[���from Tkinter import *

# this file demonstrates the creation of widgets as part of a canvas object

class Test(Frame):
    def printhi(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.draw = Canvas(self, width="5i", height="5i")

        self.button = Button(self, text="this is a button",
                             command=self.printhi)

        # note here the coords are given in pixels (form the
        # upper right and corner of the window, as usual for X)
        # but might just have well been given in inches or points or
        # whatever...use the "anchor" option to control what point of the
        # widget (in this case the button) gets mapped to the given x, y.
        # you can specify corners, edges, center, etc...
        self.draw.create_window(300, 300, window=self.button)

        self.draw.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()

test.mainloop()
PK�[o���VVrubber-band-box-demo-1.pynu�[���from Tkinter import *

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT',
                                  background='red',
                                  foreground='white',
                                  height=3,
                                  command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.canvasObject = Canvas(self, width="5i", height="5i")
        self.canvasObject.pack(side=LEFT)

    def mouseDown(self, event):
        # canvas x and y take the screen coords from the event and translate
        # them into the coordinate system of the canvas object
        self.startx = self.canvasObject.canvasx(event.x)
        self.starty = self.canvasObject.canvasy(event.y)

    def mouseMotion(self, event):
        # canvas x and y take the screen coords from the event and translate
        # them into the coordinate system of the canvas object
        x = self.canvasObject.canvasx(event.x)
        y = self.canvasObject.canvasy(event.y)

        if (self.startx != event.x)  and (self.starty != event.y) :
            self.canvasObject.delete(self.rubberbandBox)
            self.rubberbandBox = self.canvasObject.create_rectangle(
                self.startx, self.starty, x, y)
            # this flushes the output, making sure that
            # the rectangle makes it to the screen
            # before the next event is handled
            self.update_idletasks()

    def mouseUp(self, event):
        self.canvasObject.delete(self.rubberbandBox)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

        # this is a "tagOrId" for the rectangle we draw on the canvas
        self.rubberbandBox = None

        # and the bindings that make it work..
        Widget.bind(self.canvasObject, "<Button-1>", self.mouseDown)
        Widget.bind(self.canvasObject, "<Button1-Motion>", self.mouseMotion)
        Widget.bind(self.canvasObject, "<Button1-ButtonRelease>", self.mouseUp)


test = Test()

test.mainloop()
PK�[��ZZ��window-creation-more.pyonu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs/eZd�Zd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pytprintitscCsOt�}t|dd|jd|j�|_|jj�|jd|_dS(NttextsThis is window number %d.tcommandi(tTopleveltButtont	windownumt
makeWindowtlabeltpack(Rtfred((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyR

s		

cCsrt|ddddd|j�|_|jjdtdt�t|ddd|j�|_|jjdt�dS(	NRtQUITt
foregroundtredRtsidetfillsMake a New Window(RtquitRRtLEFTtBOTHR
thi_there(R((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyt
createWidgetsscCs4tj||�tj|�d|_|j�dS(Ni(tFramet__init__tPacktconfigR	R(Rtmaster((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyRs
	N(t__name__t
__module__RR
RtNoneR(((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyRs			
N(tTkinterRRttesttmainloop(((s>/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-more.pyt<module>s
	PK�[�j�HHradiobutton-simple.pycnu�[����
��^c@s7ddlTdefd��YZe�Zej�dS(i����(t*tTestcBs&eZd�Zd�Zdd�ZRS(cCs	dGHdS(Nthi((tself((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pytprintitsc
Csvt�|_|jjd�t|�|_|jj�t|jddd|jdddt�|j_|jjjdt	�t|jddd|jdd	dt�|j_
|jj
jdt	�t|jdd
d|jdddt�|j_|jjjdt	�t|d|j�|_
|j
jdt	�t|dd
ddd|j�|_|jjdtdt�dS(Nt	chocolatettextsChocolate FlavortvariabletvaluetanchortfillsStrawberry Flavort
strawberrysLemon FlavortlemonttextvariabletQUITt
foregroundtredtcommandtside(t	StringVartflavortsettFramet
radioframetpacktRadiobuttontWtchoctXtstrawRtEntrytentrytButtontquitRtBOTTOMtBOTH(R((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyt
createWidgetss0
cCs+tj||�tj|�|j�dS(N(Rt__init__tPacktconfigR$(Rtmaster((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyR%7s
N(t__name__t
__module__RR$tNoneR%(((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyR
s		&N(tTkinterRRttesttmainloop(((s</usr/lib64/python2.7/Demo/tkinter/matt/radiobutton-simple.pyt<module>s
/	PK�[�f� 44window-creation-w-location.pycnu�[����
��^c@sYddlTddlZdefd��YZdefd��YZe�Zej�dS(i����(t*Nt
QuitButtoncBseZd�ZRS(cOs\|jd�sd|d<n|jd�s;|j|d<nttj||f||�dS(NttexttQUITtcommand(thas_keytquittapplytButtont__init__(tselftmastertargstkwargs((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyR	s

(t__name__t
__module__R	(((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyR
stTestcBs&eZd�Zd�Zdd�ZRS(cGsgt�}t|dddd�|_|jjdddd�|jjdddd�|jj�dS(Ntwidtht2itheightt0(tTopleveltCanvastlabeltcreate_linetpack(R
Rtfred((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyt
makeWindows
	c
Csit|�|_|jjdtdt�t|ddddddd	|j�|_|jjdt�dS(
NtsidetfillRsMake a New WindowRi2RiR(RRRtLEFTtBOTHRR(R
((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyt
createWidgetsscCs+tj||�tj|�|j�dS(N(tFrameR	tPacktconfigR (R
R((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyR	's
N(RRRR tNoneR	(((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyRs			(tTkintertsysRRR!Rttesttmainloop(((sD/usr/lib64/python2.7/Demo/tkinter/matt/window-creation-w-location.pyt<module>s

	PK�[�(�canvas-mult-item-sel.pynu�[���from Tkinter import *

# allows moving dots with multiple selection.

SELECTED_COLOR = "red"
UNSELECTED_COLOR = "blue"

class Test(Frame):
    ###################################################################
    ###### Event callbacks for THE CANVAS (not the stuff drawn on it)
    ###################################################################
    def mouseDown(self, event):
        # see if we're inside a dot. If we are, it
        # gets tagged as CURRENT for free by tk.

        if not event.widget.find_withtag(CURRENT):
            # we clicked outside of all dots on the canvas. unselect all.

            # re-color everything back to an unselected color
            self.draw.itemconfig("selected", fill=UNSELECTED_COLOR)
            # unselect everything
            self.draw.dtag("selected")
        else:
            # mark as "selected" the thing the cursor is under
            self.draw.addtag("selected", "withtag", CURRENT)
            # color it as selected
            self.draw.itemconfig("selected", fill=SELECTED_COLOR)

        self.lastx = event.x
        self.lasty = event.y


    def mouseMove(self, event):
        self.draw.move("selected", event.x - self.lastx, event.y - self.lasty)
        self.lastx = event.x
        self.lasty = event.y

    def makeNewDot(self):
        # create a dot, and mark it as current
        fred = self.draw.create_oval(0, 0, 20, 20,
                                     fill=SELECTED_COLOR, tags=CURRENT)
        # and make it selected
        self.draw.addtag("selected", "withtag", CURRENT)

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT', foreground='red',
                           command=self.quit)

        ################
        # make the canvas and bind some behavior to it
        ################
        self.draw = Canvas(self, width="5i", height="5i")
        Widget.bind(self.draw, "<1>", self.mouseDown)
        Widget.bind(self.draw, "<B1-Motion>", self.mouseMove)

        # and other things.....
        self.button = Button(self, text="make a new dot", foreground="blue",
                             command=self.makeNewDot)

        message = ("%s dots are selected and can be dragged.\n"
                   "%s are not selected.\n"
                   "Click in a dot to select it.\n"
                   "Click on empty space to deselect all dots."
                   ) % (SELECTED_COLOR, UNSELECTED_COLOR)
        self.label = Message(self, width="5i", text=message)

        self.QUIT.pack(side=BOTTOM, fill=BOTH)
        self.label.pack(side=BOTTOM, fill=X, expand=1)
        self.button.pack(side=BOTTOM, fill=X)
        self.draw.pack(side=LEFT)

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()

test = Test()
test.mainloop()
PK�[Qrubber-line-demo-1.pynu�[���from Tkinter import *

class Test(Frame):
    def printit(self):
        print "hi"

    def createWidgets(self):
        self.QUIT = Button(self, text='QUIT',
                                  background='red',
                                  foreground='white',
                                  height=3,
                                  command=self.quit)
        self.QUIT.pack(side=BOTTOM, fill=BOTH)

        self.canvasObject = Canvas(self, width="5i", height="5i")
        self.canvasObject.pack(side=LEFT)

    def mouseDown(self, event):
        # canvas x and y take the screen coords from the event and translate
        # them into the coordinate system of the canvas object
        self.startx = self.canvasObject.canvasx(event.x)
        self.starty = self.canvasObject.canvasy(event.y)

    def mouseMotion(self, event):
        # canvas x and y take the screen coords from the event and translate
        # them into the coordinate system of the canvas object
        x = self.canvasObject.canvasx(event.x)
        y = self.canvasObject.canvasy(event.y)

        if (self.startx != event.x)  and (self.starty != event.y) :
            self.canvasObject.delete(self.rubberbandLine)
            self.rubberbandLine = self.canvasObject.create_line(
                self.startx, self.starty, x, y)
            # this flushes the output, making sure that
            # the rectangle makes it to the screen
            # before the next event is handled
            self.update_idletasks()

    def __init__(self, master=None):
        Frame.__init__(self, master)
        Pack.config(self)
        self.createWidgets()
        # this is a "tagOrId" for the rectangle we draw on the canvas
        self.rubberbandLine = None
        Widget.bind(self.canvasObject, "<Button-1>", self.mouseDown)
        Widget.bind(self.canvasObject, "<Button1-Motion>", self.mouseMotion)


test = Test()

test.mainloop()
PK�[R��۩�menu-simple.pyonu�[����
��^c@s�ddlTd�Zd�Zd�Zd�Ze�Zeededd�Z	e	j
d	e�e�Ze�Z
e	jee
�ejd
�ejd�ej�dS(
i����(t*cCs	dGHdS(Nsopening new file((((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pytnew_file$scCs	dGHdS(Nsopening OLD file((((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pyt	open_file(scCs�ttdddd�}|jdtdd�t|�|_|jjdd	ddd
t�|jjddddd
t�|jjddddd
d
�|j|d<|S(NttexttFilet	underlineitsidetpadxt1mtlabelsNew...tcommandsOpen...tQuittexittmenu(	t
MenubuttontmBartpacktLEFTtMenuR
tadd_commandRR(tFile_button((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pytmakeFileMenu,s
cCs�ttdddd�}|jdtdd�t|�|_|jjdd	d
�|jjddt�|jj	d	d
�|jj	d	d�|jj	d	d�|j|d<|S(NRtEditRiRRRR
R	tUndoitstatetCuttCopytPasteR
(
RRRRRR
taddtentryconfigtDISABLEDR(tEdit_button((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pytmakeEditMenuFs
trelieftborderwidthitfills	menu demotpackerN(tTkinterRRRR tTktroottFrametRAISEDRRtXRRt
tk_menuBarttitleticonnametmainloop(((s5/usr/lib64/python2.7/Demo/tkinter/matt/menu-simple.pyt<module>s
#							

PK�[4+���two-radio-groups.pyonu�[����
��^c@s�ddlTd�Zd�Zd�Ze�Zeededd�Zej	de
�e�Ze
�Zee�Zee�Zejee�eed	d
ddd
e�Zej	de�ejd�ejd�ej�dS(i����(t*cCs�ttdddd�}|jdtdd�t|�|_|jjdd	d
|dd�|jjd
idd6|d
6dd6�|jjd
idd6|d
6dd6�|jd�|j|d<|S(NttextsPolitical Partyt	underlineitsidetpadxt2mtlabelt
RepublicantvariabletvalueitradiobuttontDemocratitLibertarianitmenu(	t
MenubuttontmBartpacktLEFTtMenuR
tadd_radiobuttontaddtset(tvartRadiobutton_button((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pytmakePoliticalPartiess	


cCs�ttdddd�}|jdtdd�t|�|_|jjdd	d
|dd	�|jjddd
|dd�|jjdd
d
|dd
�|jd�|j|d<|S(NRtFlavorsRiRRRRt
StrawberryRR	t	Chocolates
Rocky RoadR
(RRRRRR
RR(RR((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pytmakeFlavors2s	




cCs#dGtj�GHdGtj�GHHdS(Nsparty iss	flavor is(tpartytgettflavor(((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pyt
printStuffMstrelieftborderwidthitfillRsprint party and flavort
foregroundtredtcommandRs	menu demoN(tTkinterRRR tTktroottFrametRAISEDRRtXtIntVarRt	StringVarRRtRadiobutton_button2t
tk_menuBartButtontbtTOPttitleticonnametmainloop(((s:/usr/lib64/python2.7/Demo/tkinter/matt/two-radio-groups.pyt<module>s"
							

PK�[#U����entry-simple.pynu�[���from Tkinter import *
import string

# This program  shows how to use a simple type-in box

class App(Frame):
    def __init__(self, master=None):
        Frame.__init__(self, master)
        self.pack()

        self.entrythingy = Entry()
        self.entrythingy.pack()

        # and here we get a callback when the user hits return. we could
        # make the key that triggers the callback anything we wanted to.
        # other typical options might be <Key-Tab> or <Key> (for anything)
        self.entrythingy.bind('<Key-Return>', self.print_contents)

    def print_contents(self, event):
        print "hi. contents of entry is now ---->", self.entrythingy.get()

root = App()
root.master.title("Foo")
root.mainloop()
PK�[�}N�

pong-demo-1.pynu�[���PK�[��>;��Kpacker-simple.pycnu�[���PK�[Mh�Ω	�	canvas-moving-w-mouse.pycnu�[���PK�[~����00-HELLO-WORLD.pynu�[���PK�[��)��#canvas-reading-tag-info.pynu�[���PK�[�f� 44�window-creation-w-location.pyonu�[���PK�[�		}(canvas-gridding.pycnu�[���PK�[k������1dialog-box.pyonu�[���PK�[a>oQ���9animation-w-velocity-ctrl.pyonu�[���PK�[�]���Banimation-w-velocity-ctrl.pynu�[���PK�[��VkkGmenu-all-types-of-entries.pycnu�[���PK�[b*�//�Zwindow-creation-simple.pynu�[���PK�[;U<��0^subclass-existing-widgets.pyonu�[���PK�[b�r;	;	Occanvas-with-scrollbars.pycnu�[���PK�[;mDD�lcanvas-reading-tag-info.pycnu�[���PK�[�j�HHctradiobutton-simple.pyonu�[���PK�[��g�{00-HELLO-WORLD.pycnu�[���PK�[���llF�packer-and-placer-together.pyonu�[���PK�[�D66�placer-simple.pynu�[���PK�[3��(jjv�window-creation-simple.pycnu�[���PK�[���*hh*�entry-with-shared-variable.pycnu�[���PK�[�X
����packer-and-placer-together.pynu�[���PK�[���*hh�entry-with-shared-variable.pyonu�[���PK�[��t44��entry-simple.pyonu�[���PK�[��ZZ���window-creation-more.pycnu�[���PK�[��g�00-HELLO-WORLD.pyonu�[���PK�[�3�--d�window-creation-w-location.pynu�[���PK�[�P6��޺slider-demo-1.pynu�[���PK�[��Vkk�menu-all-types-of-entries.pyonu�[���PK�[�w����bind-w-mult-calls-p-type.pynu�[���PK�[�Fֳ��menu-simple.pynu�[���PK�[�F�77�not-what-you-might-think-2.pycnu�[���PK�[���ll��packer-and-placer-together.pycnu�[���PK�[��>;��G�packer-simple.pyonu�[���PK�[�� �yy�bind-w-mult-calls-p-type.pyonu�[���PK�[ʥ�E���not-what-you-might-think-1.pynu�[���PK�[v��	
	
�rubber-band-box-demo-1.pycnu�[���PK�[�!�� 
READMEnu�[���PK�[e��̍�Wcanvas-demo-simple.pyonu�[���PK�[a>oQ��*animation-w-velocity-ctrl.pycnu�[���PK�[	����bslider-demo-1.pyonu�[���PK�[Ca�33S!packer-simple.pynu�[���PK�[`MY���$subclass-existing-widgets.pynu�[���PK�[|=4�>>�'canvas-with-scrollbars.pynu�[���PK�[���'��>0canvas-gridding.pynu�[���PK�[v��	
	
_9rubber-band-box-demo-1.pyonu�[���PK�[�;����Cwindow-creation-more.pynu�[���PK�[�Q.��Gkilling-window-w-wm.pynu�[���PK�[������JManimation-simple.pycnu�[���PK�[;mDDFTcanvas-reading-tag-info.pyonu�[���PK�[�����[rubber-line-demo-1.pyonu�[���PK�[S�"

�dplacer-simple.pyonu�[���PK�[k�����Jjdialog-box.pycnu�[���PK�[�		Brcanvas-gridding.pyonu�[���PK�[��aI

�{canvas-moving-or-creating.pyonu�[���PK�[0L�����killing-window-w-wm.pycnu�[���PK�[	�����slider-demo-1.pycnu�[���PK�[0L���	�killing-window-w-wm.pyonu�[���PK�[S�"

%�placer-simple.pycnu�[���PK�[;U<��s�subclass-existing-widgets.pycnu�[���PK�[�̆^��not-what-you-might-think-1.pyonu�[���PK�[3��(jj�window-creation-simple.pyonu�[���PK�[��������animation-simple.pyonu�[���PK�[Mh�Ω	�	��canvas-moving-w-mouse.pyonu�[���PK�[�nЈ	�	
��dialog-box.pynu�[���PK�[�	��NN[�canvas-moving-w-mouse.pynu�[���PK�[������rubber-line-demo-1.pycnu�[���PK�[e��̍��canvas-demo-simple.pycnu�[���PK�[L�

��printing-coords-of-items.pyonu�[���PK�[b�r;	;	M�canvas-with-scrollbars.pyonu�[���PK�[��>kv	v	�canvas-moving-or-creating.pynu�[���PK�[�x�#�#��menu-all-types-of-entries.pynu�[���PK�[:���
�
v#canvas-mult-item-sel.pyonu�[���PK�[�F�77�.not-what-you-might-think-2.pyonu�[���PK�[L�

94printing-coords-of-items.pycnu�[���PK�[��aI

�>canvas-moving-or-creating.pycnu�[���PK�[���d���Hcanvas-w-widget-draw-el.pyonu�[���PK�[�uk/��+Oanimation-simple.pynu�[���PK�[��t44Sentry-simple.pycnu�[���PK�[�� �yy�Wbind-w-mult-calls-p-type.pycnu�[���PK�[~ǁ���R]not-what-you-might-think-2.pynu�[���PK�[4+����`two-radio-groups.pycnu�[���PK�[����PP^ipong-demo-1.pycnu�[���PK�[:���
�
�qcanvas-mult-item-sel.pycnu�[���PK�[����PP+}pong-demo-1.pyonu�[���PK�[R��۩���menu-simple.pycnu�[���PK�[�}�`	`	��printing-coords-of-items.pynu�[���PK�[�_ ��M�canvas-demo-simple.pynu�[���PK�[�>���~�two-radio-groups.pynu�[���PK�[�̆^o�not-what-you-might-think-1.pycnu�[���PK�[���d��Ѯcanvas-w-widget-draw-el.pycnu�[���PK�[#~�����entry-with-shared-variable.pynu�[���PK�[�J�����radiobutton-simple.pynu�[���PK�[����=�canvas-w-widget-draw-el.pynu�[���PK�[o���VV!�rubber-band-box-demo-1.pynu�[���PK�[��ZZ����window-creation-more.pyonu�[���PK�[�j�HH��radiobutton-simple.pycnu�[���PK�[�f� 44M�window-creation-w-location.pycnu�[���PK�[�(���canvas-mult-item-sel.pynu�[���PK�[Q/�rubber-line-demo-1.pynu�[���PK�[R��۩��menu-simple.pyonu�[���PK�[4+����two-radio-groups.pyonu�[���PK�[#U�����entry-simple.pynu�[���PKgg#�