Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: How to Add a button to frame

from Tkinter import *                   
class SimpleFrame(Frame):
    def __init__(self, parent=None):
        Frame.__init__(self, parent)

Python: detects key and mouse events

from Tkinter import *
root = Tk( )
prompt='Press a key'
lbl = Label(root, text=prompt, width=len(prompt))
lbl.pack( )
def do_mouse(eventname):

Python: Get key pressed by the user

from Tkinter import *
root = Tk( )
prompt='Press a key'
lbl = Label(root, text=prompt, width=len(prompt))
lbl.pack( )
def key(event):
    """ Keybo

Python: Adding User-Defined Callback Handlers

from Tkinter import *
def hi(*ignore):
    """ This message appears whenever you press the enter key"""
    print 'Welcom to python TKinter'
root =

Python: How to create TitledBorder

from Tkinter import *
class TitledBorder(Frame):
    """
     GUI: with TKinter
    """
    def __init__(self):
        Frame.__init__(self)

Python: How to Disable a widget

from Tkinter import *                   
root=Tk()
root.title("Disabling a Button")
widget = Button(root, text='Welcom', command=root.quit)
widget.

Python: How to Add icon to a button

from Tkinter import *
top = Tk()
# Create an image object
igm = PhotoImage(file="c:/icon1.gif")
# bind the image to the widget
Button(top, image=ig

Python: show message dialog

import Tkinter                         
from tkMessageBox import askokcancel          
class Quitter(Frame):                          
    def _ _i

Python: digital clock

"""
Python in a Nutshell, 2nd Edition
By Alex Martelli
...............................................
Publisher: O'Reilly
Pub Date: July 2006
Prin

Python: Creating File open dialog

from Tkinter import *
from tkFileDialog   
import askopenfilename, askopenfilenames      
def open_one_myFile():
    """ Return the path of an exis

Python: How to Set Color using tkColorChooser module

from Tkinter import *
from tkColorChooser 
import askcolor
def setBgColor():
    """ Click event"""
    (rgb, hexstr) = askcolor() 
    if hexstr:

Python: Animation with threads

#/*
#Python and Tkinter Programming
#John E. Grayson
#ISBN: 1884777813
#Publisher: Manning
#*/
from Tkinter import *
import thread, time
trace = 0

Python: Background and foreground

from Tkinter import *
class Label(Frame):
    def __init__(self):
        Frame.__init__(self)
        self.pack()
        bt = Button(self, text='

Python: Create a simple TKinter’s application

import sys
import Tkinter 
Tkinter.Label(text="Hello Python TKinter!").pack( )
Tkinter.Button(text="Exit", command=sys.exit).pack( )
Tkinter.mainlo

Python: How to customize widgets borders

from Tkinter import *
win = Tk()
win.title('Widget Border')
for border in [RAISED, SUNKEN, FLAT, RIDGE, GROOVE, SOLID]:
    f = Frame(win, borderwi