60 likes | 150 Views
As you arrive…. Get you laptop out and get ready to program some python Go to the course website and load all the example programs that are posted there for the day If you haven’t done it already, attempt to fix my broken code from last week. What I wanted you to do last Thursday:.
E N D
As you arrive… • Get you laptop out and get ready to program some python • Go to the course website and load all the example programs that are posted there for the day • If you haven’t done it already, attempt to fix my broken code from last week
What I wanted you to do last Thursday: • Write some GUI callbacks (review from last time, but still useful) • Explain how callbacks are actually Asynchronous Programming • Explain what a “thread” is • Write code that uses a thread you’ve built yourself
Question What is a thread? • It’s a part of a GUI window. In Jython, each window you display has one and it deals with user input. • It’s a path of execution in your program. If you use threads, multiple parts of your program can execute at the same time. • It’s a principle of design. You want each “thread” of your program to be a separate class • All of the above
Today in Class • You’ll write a bit more GUI code • You should be able to articulate why using globals in GUI code can be problematic • You’ll modify some code to separate a GUI into several classes that encapsulate data • If we have time, we’ll look at how GUIs respond to external events
Modify LineExample1 so that when you click you get a continuous line starting at 0,0 If you finish early, go ahead and uncomment the lines at the bottom and try to figure out the bug. And fix it, if you know how.
Modify SportsTrackerExample so it works correctly • You’ll want to create two classes: one for the main window and one for the tracker windows • There should be no globals your final solution