{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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.
Image of page 1

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

View Full Document Right 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/
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..
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern