FAQ
Hi,
I am writing a program teach myself python and tkinter.
Below given is a program which displays label with different fonts and
sizes.
How to highlight text and change font size if the up/down arrow keys are
pressed ?
from Tkinter import *
import tkFont

class MyFrame(Frame):

def __init__(self, root):
Frame.__init__(self, root)
self.txt = Label(self, text="Arial 10 bold",
font=("Arial",10,"bold"))
self.txt.grid(row=1,column=1)
self.txt = Label(self, text="Courier 12 bold",
font=("Courier",12,"bold"))
self.txt.grid(row=2,column=1)
self.txt = Label(self, text="Comic Sans MS 14 bold", font=("Comic
Sans MS",14,"bold"))
self.txt.grid(row=3,column=1)
self.txt = Label(self, text="Fixedsys 16 bold",
font=("Fixedsys",16,"bold"))
self.txt.grid(row=4,column=1)
self.txt = Label(self, text="MS Sans Serif 18 bold", font=("MS Sans
Serif",18,"bold"))
self.txt.grid(row=5,column=1)
self.txt = Label(self, text="MS Serif, Symbol 20 bold", font=("MS
Serif, Symbol",20,"bold"))
self.txt.grid(row=6,column=1)
self.txt = Label(self, text="System 22 bold",
font=("System",22,"bold"))
self.txt.grid(row=7,column=1)
self.txt = Label(self, text="Verdana 24 bold",
font=("Verdana",24,"bold"))
self.txt.grid(row=8,column=1)

if __name__ == '__main__':
root = Tk()
c = MyFrame(root)
c.pack(fill=BOTH, expand=1)
root.mainloop()

any help?

Regards,
VGNU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101103/ce2e0c3f/attachment.html>

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedNov 3, '10 at 6:32a
activeNov 3, '10 at 10:47a
posts2
users1
websitepython.org

1 user in discussion

VGNU Linux: 2 posts

People

Translate

site design / logo © 2022 Grokbase