4834_lecture_22_ho

4834_lecture_22_ho - EEL 4834: Lecture 22 EEL 4834: Lecture...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
EEL 4834: Lecture 22 EEL 4834: Lecture 22 GUI Programming 1 Professor O. Boykin University of Florida, Department of Electrical and Computer Engineering October 20, 2009 EEL 4834: Lecture 22 Toolkits We don’t want to manage drawing every pixel on the screen. “Toolkits” are modules developed to handle drawing the common objects on the screen: scrollbars, buttons, text, etc. .. There is one built in to Python called Tk. It was originally used in a language called Tcl. It’s not pretty, but it works everywhere Python works. If you want to draw prettier GUIs I recommend PyQT or PyGTK, which are also portable to Linux, OSX, and Windows, but not a standard part of Python (which means you have to install them separately before you use them).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
EEL 4834: Lecture 22 Basics of GUIs Basic objects: Frame: the “box” that all the stuff is inside: the whole window. Label: some text. In the above “Hello, World! The sine of” Entry: a place to enter a string. The above has an entry box with “1.2”. Button: something we can click on that will cause some action to take place. The above has a button labeled “equals”. In many GUI toolkits, these (and other) visual objects are called widgets. EEL 4834: Lecture 22 #!/usr/bin/env python import Tkinter as TK import math root = TK.Tk() # root (main) window top = TK.Frame(root) # create frame top.pack(side= ’top’ )
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

4834_lecture_22_ho - EEL 4834: Lecture 22 EEL 4834: Lecture...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online