1 / 6

As you arrive…

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:.

zoltin
Download Presentation

As you arrive…

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. 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

  4. 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

  5. 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.

  6. 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

More Related