4834_lecture_24_ho

4834_lecture_24_ho - EEL 4834: Lecture 24 EEL 4834: Lecture...

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

View Full Document Right Arrow Icon
EEL 4834: Lecture 24 EEL 4834: Lecture 24 GUI Programming 3 Professor O. Boykin University of Florida, Department of Electrical and Computer Engineering October 29, 2009 EEL 4834: Lecture 24 What have we seen? So far we’ve seen the following widgets: Label: write text Entry: get string input Button: user “event” input Frame: organize layout of widgets.
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 24 What’s the basic pattern? Generally widgets are doing one or both of the following: Give output to the user: they are bound to some variable (StringVar, IntVar, or DoubleVar). Get some input: they are connected to some callback function (or command). Look for that pattern: data bound to a widget, and callback functions to handle changes to the widget! EEL 4834: Lecture 24 Python Mega Widgets (Pmw) The Python Mega Widgets package makes many TK compatible widgets easier. I recommend installing it: http://pmw.sourceforge.net/
Background image of page 2
EEL 4834: Lecture 24 Option Menu: Pmw An option menu give the choice to select one of several options. When the user makes a selection, a callback function is called. This is in the Pmw module. EEL 4834: Lecture 24 #!/usr/bin/env python import Tkinter as TK import Pmw root = TK.Tk() root.title( ’option test’ ) frame = TK.Frame(root) frame.pack() opt string = TK.StringVar() def update(value): #print value or: print opt string.get() opt widget = Pmw.OptionMenu(frame, labelpos= ’w’ , #west, or n,nw,ne,e,etc. . label
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/11/2010 for the course EEL 4834 taught by Professor Staff during the Fall '08 term at University of Florida.

Page1 / 9

4834_lecture_24_ho - EEL 4834: Lecture 24 EEL 4834: Lecture...

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

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