Easy Graphical User Interfaces

Size: px
Start display at page:

Download "Easy Graphical User Interfaces"

Transcription

1 Easy Graphical User Interfaces with breezypythongui

2 Types of User Interfaces GUI (graphical user interface) TUI (terminal-based user interface) UI Inputs Outputs Computation

3 Terminal-Based User Interface (TUI) Supports input via the keyboard and output via the monitor In Python, the I/O functions are input and print import math radius = float(input('enter the radius: ')) area = math.pi * radius ** 2 print('the area is', area)

4 Problems with a TUI Must enter inputs in a certain order Cannot back up to correct input mistakes or change one s mind Must re-enter all inputs to change just one I/O restricted to text

5 A Simple Tax Code print("tax Calculator\n") RATE =.15 EXEMPTION_AMOUNT = income = float(input("please enter your income: $")) exemptions = int(input("please enter the number of exemptions: ")) tax = max(0.0, (income - exemptions * EXEMPTION_AMOUNT) * RATE) print("your total tax is $%0.2f" % tax, 0.0)

6 A Simple Tax Code

7 Graphical User Interface (GUI) Supports input via the keyboard Can output text and also graphical shapes representing desktop elements, such as windows, command buttons, data fields, and drop-down menus (also called widgets ) Supports direct manipulation of desktop elements via the mouse or touchscreen

8 TUI vs GUI Non-programmers (the 99%) do not use a TUI, they use a GUI Only programmers (the 1%) use a TUI (and also a GUI) Most beginning programmers program to a TUI, not a GUI

9 Programming a GUI Most modern programming languages (like Python and Java) include packages or modules for programming a GUI In Python, this module is called tkinter The model of computation for a GUI program is more complex than that of a TUI program, and tkinter is very complicated to use

10 What Is breezypythongui? A module of classes and functions that makes GUI programming with tkinter easy for beginners The module is free and open-source A tutorial and sample programs are available at the breezypythongui Web site

11 Easy GUIs with breezypythongui GUI-Based Application Program breezypythongui ezypythongui/index.html tkinter /tkinter.html#module-tkinter

12 Models of Computation TUI 1. Obtain user inputs 2. Perform computations 3. Print results GUI 1. Layout and pop up the window 2. Wait for user events 3. Handle a user event 4. Goto step 2

13 A First GUI Program: Hello World from breezypythongui import EasyFrame Import the abstract window class

14 A First GUI Program: Hello World from breezypythongui import EasyFrame class HelloWorld(EasyFrame): """Displays a greeting in a window.""" Define a subclass to specialize it for this application

15 A First GUI Program: Hello World from breezypythongui import EasyFrame class HelloWorld(EasyFrame): """Displays a greeting in a window.""" def init (self): """Sets up the window and the label.""" EasyFrame. init (self) self.addlabel(text = "Hello world!", row = 0, column = 0) Lay out the window and its widgets

16 A First GUI Program: Hello World from breezypythongui import EasyFrame class HelloWorld(EasyFrame): """Displays a greeting in a window.""" def init (self): """Sets up the window and the label.""" EasyFrame. init (self) self.addlabel(text = "Hello world!", row = 0, column = 0) # Instantiates and pops up the window. if name == " main ": HelloWorld().mainloop() Create and launch the application window

17 The Structure of Any GUI Program from breezypythongui import EasyFrame class <class name>(easyframe): def init (self): EasyFrame. init (self <optional args>) <code to set up widgets> <code to define event-handling methods> # Instantiates and pops up the window. if name == " main ": <class name>().mainloop()

18 Laying Out Widgets class LayoutDemo(EasyFrame): """Displays labels in the quadrants.""" def init (self): """Sets up the window and the labels.""" EasyFrame. init (self) self.addlabel(text = "(0, 0)", row = 0, column = 0) self.addlabel(text = "(0, 1)", row = 0, column = 1) self.addlabel(text = "(1, 0)", row = 1, column = 0) self.addlabel(text = "(1, 1)", row = 1, column = 1)

19 Alignment and Spanning def init (self): """Sets up the window and the labels.""" EasyFrame. init (self) self.addlabel(text = "(0, 0)", row = 0, column = 0, sticky = "NSEW") self.addlabel(text = "(0, 1)", row = 0, column = 1, sticky = "NSEW") self.addlabel(text = "(1, 0 and 1)", row = 1, column = 0, sticky = "NSEW", columnspan = 2)

20 def init (self): """Sets up the window and widgets.""" EasyFrame. init (self, title = "Circle Area ) # Label and field for the input self.addlabel(text = "Radius", row = 0, column = 0) self.radiusfield = self.addfloatfield(value = 0.0, row = 0, column = 1) # Label and field for the output self.addlabel(text = "Area", row = 1, column = 0) self.areafield = self.addfloatfield(value = 0.0, row = 1, column = 1) # The command button self.addbutton(text = "Compute", row = 2, column = 0, columnspan = 2, command = self.computearea) Circle Area class CircleWithGUI(EasyFrame): """Computes and displays the area of a circle."""

21 Circle Area class CircleWithGUI(EasyFrame): """Computes and displays the area of a circle.""" def init (self): """Sets up the window and widgets.""".. # The command button self.addbutton(text = "Compute", row = 2, column = 0, columnspan = 2, command = self.computearea) # The event handling method for the button def computearea(self): """Inputs the radius, computes the area, and outputs the result.""" radius = self.radiusfield.getnumber() area = math.pi * radius ** 2 self.areafield.setnumber(area)

22 Representing Colors: RGB The RGB system composes each color from red, green, and blue components Each component is an integer in the range means the total absence of a color component 255 means the highest saturation of a color component 256 * 256 * 256 = 16,777,216 distinct color values

23 Representing Colors: RGB Think of each color value as a triple of integers of the form (<r>, <g>, <b>) RGB Triple Color (0, 0, 0) Black (255, 0, 0) Red (0, 255, 0) Green (0, 0, 255) Blue (127, 127, 127) Medium Gray (255, 255, 255) White

24 Python Color Values Some common colors are black, red, etc. Or a string of the form xrrggbb, where RR is the red value in hexadecimal, etc. Example: xffffff is white, xff0000 is red, etc.

25 Python Color Values (127, 200, 255) is #7FC8FF as hex >>> hex(127) '0x7f' >>> hex(200) '0xc8' >>> hex(255) '0xff' >>> hex(6) '0x6' >>>

26 R, G, B to Hex String def rgbtohex(r, g, b): """Converts integer RGB values to a hax value with the format #RRGGBB.""" # Convert each int to hex string and extract the digit(s) r = hex(r)[2:] g = hex(g)[2:] b = hex(b)[2:] # Prepend a 0 to single digit values if len(r) == 1: r = "0" + r if len(g) == 1: g = "0" + g if len(b) == 1: b = "0" + b # Return the form #RRGGBB return "#" + r + g + b

27 The Canvas Widget A canvas is a rectangular area in which one can draw images or shapes, and detect mouse events The method addcanvas creates a new object of type EasyCanvas adds it to the window s grid at the given row and column returns the canvas optional arguments include background, width, and height

28 A Color Meter

29 Add a Canvas and a Sliding Scale class ColorMeter(EasyFrame): """A color meter. Uses sliding scales to update a canvas.""" def init (self): """Sets up the view.""" EasyFrame. init (self, title = "Color Meter") self.canvas = self.addcanvas(row = 0, column = 1, rowspan = 3, background = "black") # Sliding scale for red self.redscale = self.addscale(label = "Red", row = 0, column = 0, from_ = 0, to = 255, resolution = 1.00, length = 256, tickinterval = 0, command = self.setcolor) self.redscale.set(0)

30 Respond to a Sliding Scale Event def setcolor(self, x): """Updates the canvas color.""" red = self.redscale.get() green = self.greenscale.get() blue = self.bluescale.get() self.canvas["background"] = rgbtohex(red, green, blue)

Chapter 0 : MVC review / Threading & Concurrency. CSCI 251 Android App Development

Chapter 0 : MVC review / Threading & Concurrency. CSCI 251 Android App Development Chapter 0 : MVC review / Threading & Concurrency CSCI 251 Android App Development Part I: Model / View / Controller Review (courtesy of Prof. Lambert) TUI vs GUI Text-based I/O Sequential process Direct

More information

Graphical User Interfaces

Graphical User Interfaces to visualize Graphical User Interfaces 1 2 to visualize MCS 507 Lecture 12 Mathematical, Statistical and Scientific Software Jan Verschelde, 19 September 2011 Graphical User Interfaces to visualize 1 2

More information

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts

CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts CMPSCI 119 Fall 2018 Wednesday, November 14, 2018 Midterm #2 Solution Key Professor William T. Verts 25 Points What is the value of each expression below? Answer any 25; answer more for extra credit.

More information

Graphical User Interfaces

Graphical User Interfaces Graphical User Interfaces 1 User Interfaces GUIs in Python with Tkinter object oriented GUI programming 2 Mixing Colors specification of the GUI the widget Scale 3 Simulating a Bouncing Ball layout of

More information

[CHAPTER] 1 INTRODUCTION 1

[CHAPTER] 1 INTRODUCTION 1 FM_TOC C7817 47493 1/28/11 9:29 AM Page iii Table of Contents [CHAPTER] 1 INTRODUCTION 1 1.1 Two Fundamental Ideas of Computer Science: Algorithms and Information Processing...2 1.1.1 Algorithms...2 1.1.2

More information

Introduction to Programming Using Python Lecture 6. Dr. Zhang COSC 1437 Spring, 2018 March 01, 2018

Introduction to Programming Using Python Lecture 6. Dr. Zhang COSC 1437 Spring, 2018 March 01, 2018 Introduction to Programming Using Python Lecture 6 Dr. Zhang COSC 1437 Spring, 2018 March 01, 2018 Chapter 9 GUI Programming Using Tkinter Getting started with Tkinter with a simple example. Code example:

More information

Chapter 9 GUI Programming Using Tkinter. Copyright 2012 by Pearson Education, Inc. All Rights Reserved.

Chapter 9 GUI Programming Using Tkinter. Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 9 GUI Programming Using Tkinter 1 Motivations Tkinter is not only a useful tool for developing GUI projects, but also a valuable pedagogical tool for learning object-oriented programming. 2 Objectives

More information

Java Class Design. Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding

Java Class Design. Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding Java Class Design Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding eugeny.berkunsky@gmail.com http://www.berkut.mk.ua Objectives Implement encapsulation Implement inheritance

More information

Tkinter: Input and Output Bindings. Marquette University

Tkinter: Input and Output Bindings. Marquette University Tkinter: Input and Output Bindings Marquette University Tkinter Variables Tkinter contains a useful mechanism to connect widgets to variables This allows us to have variables change when widgets do and

More information

GUI Output. Adapted from slides by Michelle Strout with some slides from Rick Mercer. CSc 210

GUI Output. Adapted from slides by Michelle Strout with some slides from Rick Mercer. CSc 210 GUI Output Adapted from slides by Michelle Strout with some slides from Rick Mercer CSc 210 GUI (Graphical User Interface) We all use GUI s every day Text interfaces great for testing and debugging Infants

More information

CAS London CPD Day February 16

CAS London CPD Day February 16 Practical Sheet: GUI Programming This sheet is a set of exercises for introducing GUI programming in Python using Tkinter, assuming knowledge of basic Python programming. All materials are at http://www.eecs.qmul.ac.uk/~william/cas-london-2016.html

More information

Outline. making colors with scale widgets entering parameter values using the variables in Scale. sliding canvas coordinates animating a random walk

Outline. making colors with scale widgets entering parameter values using the variables in Scale. sliding canvas coordinates animating a random walk Outline 1 The Widget Scale making colors with scale widgets entering parameter values using the variables in Scale 2 Building an Animation sliding canvas coordinates animating a random walk 3 Summary +

More information

CS 101 Computer Science I Fall Instructor Muller. stddraw API. (DRAFT of 1/15/2013)

CS 101 Computer Science I Fall Instructor Muller. stddraw API. (DRAFT of 1/15/2013) CS 101 Computer Science I Fall 2013 Instructor Muller stddraw API (DRAFT of 1/15/2013) This document describes the application programmer interface (API) for the stddraw library. An API describes the set

More information

CS 112: Intro to Comp Prog

CS 112: Intro to Comp Prog CS 112: Intro to Comp Prog Tkinter Layout Managers: place, pack, grid Custom Frames Widgets In-depth StringVar tkfont Upcoming Tk To use Tkinter Widgets (components: buttons, labels, etc). You must import

More information

ENGR/CS 101 CS Session Lecture 15

ENGR/CS 101 CS Session Lecture 15 ENGR/CS 101 CS Session Lecture 15 Log into Windows/ACENET (reboot if in Linux) Use web browser to go to session webpage http://csserver.evansville.edu/~hwang/f14-courses/cs101.html Right-click on lecture15.py

More information

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created.

+ Inheritance. Sometimes we need to create new more specialized types that are similar to types we have already created. + Inheritance + Inheritance Classes that we design in Java can be used to model some concept in our program. For example: Pokemon a = new Pokemon(); Pokemon b = new Pokemon() Sometimes we need to create

More information

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Andriod Development Lecture 09

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Andriod Development Lecture 09 Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Andriod Development Lecture 09 Hello, today we will create another application called a math quiz. This

More information

An Introduction to Processing

An Introduction to Processing An Introduction to Processing Creating static drawings Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list Coordinate System in Computing.

More information

Scripting Tutorial - Lesson 11: Advanced: Introducing Classes

Scripting Tutorial - Lesson 11: Advanced: Introducing Classes Home TI-Nspire Authoring TI-Nspire Scripting HQ Scripting Tutorial - Lesson 11 Scripting Tutorial - Lesson 11: Advanced: Introducing Classes Download supporting files for this tutorial Texas Instruments

More information

UNIT 10A Visualizing Data: Graphics in Python. Drawing using Python. We will be using Python's interface to Tcl/Tk, a cross-plaoorm graphics library.

UNIT 10A Visualizing Data: Graphics in Python. Drawing using Python. We will be using Python's interface to Tcl/Tk, a cross-plaoorm graphics library. UNIT 10A Visualizing Data: Graphics in Python 1 Drawing using Python We will be using Python's interface to Tcl/Tk, a cross-plaoorm graphics library. To use this, you should be logged in directly into

More information

Adding CSS to your HTML

Adding CSS to your HTML Adding CSS to your HTML Lecture 3 CGS 3066 Fall 2016 September 27, 2016 Making your document pretty CSS is used to add presentation to the HTML document. We have seen 3 ways of adding CSS. In this lecture,

More information

Announcements. Project 2 due next Monday. Next Tuesday is review session; Midterm 1 on Wed., EE 129, 8:00 9:30pm

Announcements. Project 2 due next Monday. Next Tuesday is review session; Midterm 1 on Wed., EE 129, 8:00 9:30pm Project 2 due next Monday Next Tuesday is review session; Announcements Midterm 1 on Wed., EE 129, 8:00 9:30pm Project 3 to be posted Oct. 3 (next Wed) Preparing for the Midterm: Review Chapters 3-6 of

More information

Java Programming Lecture 6

Java Programming Lecture 6 Java Programming Lecture 6 Alice E. Fischer Feb 15, 2013 Java Programming - L6... 1/32 Dialog Boxes Class Derivation The First Swing Programs: Snow and Moving The Second Swing Program: Smile Swing Components

More information

# arrange Label in parent widget

# arrange Label in parent widget Much of today s software uses a point-and-click graphical user interface (GUI). The standard library modules Tkinter and Tix allow for portable, event-driven, GUI development in Python. A Python/Tkinter

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

CSE : Python Programming

CSE : Python Programming CSE 399-004: Python Programming Lecture 08: Graphical User Interfaces with wxpython March 12, 2005 http://www.seas.upenn.edu/~cse39904/ Plan for today and next time Today: wxpython (part 1) Aside: Arguments

More information

Python for Scientific Computations and Control

Python for Scientific Computations and Control Python for Scientific Computations and Control 1 Python for Scientific Computations and Control Project Report Georg Malte Kauf Python for Scientific Computations and Control 2 Contents 1 Introduction

More information

CISC 1600 Lecture 3.1 Introduction to Processing

CISC 1600 Lecture 3.1 Introduction to Processing CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists

More information

Warping & Blending AP

Warping & Blending AP Warping & Blending AP Operation about AP This AP provides three major functions including Warp, Edge Blending and Black Level. If the AP is already installed, please remove previous version before installing

More information

Chapter 2 First Java Programs

Chapter 2 First Java Programs First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Why is Java an important programming language? What is the Java virtual machine and byte code? What are

More information

Objects. say something to express one's disapproval of or disagreement with something.

Objects. say something to express one's disapproval of or disagreement with something. Objects say something to express one's disapproval of or disagreement with something. class Person: def init (self, name, age): self.name = name self.age = age p1 = Person("John", 36) class Person: def

More information

Object-Oriented Programming

Object-Oriented Programming iuliana@cs.ubbcluj.ro Babes-Bolyai University 2018 1 / 33 Overview 1 2 3 4 5 6 2 / 33 I Qt is a cross-platform application and UI framework in C++. Using Qt, one can write GUI applications once and deploy

More information

Tkinter Part II: Buttons, Lambda & Dynamic Content

Tkinter Part II: Buttons, Lambda & Dynamic Content Tkinter Part II: Buttons, Lambda & Dynamic Content July 8, 2015 Brian A. Malloy Slide 1 of 11 1. We further investigate Labels and Buttons and hook Python actions to these widgets. We present lambda functions,

More information

CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015

CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015 CS 100 Python commands, computing concepts, and algorithmic approaches for final Fall 2015 These pages will NOT BE INCLUDED IN THE MIDTERM. print - Displays a value in the command area - Examples: - print

More information

Object-Oriented Programming Design. Topic : Graphics Programming GUI Part I

Object-Oriented Programming Design. Topic : Graphics Programming GUI Part I Electrical and Computer Engineering Object-Oriented Topic : Graphics GUI Part I Maj Joel Young Joel.Young@afit.edu 15-Sep-03 Maj Joel Young A Brief History Lesson AWT Abstract Window Toolkit Implemented

More information

CS 2316 Exam 3 Fall 2011

CS 2316 Exam 3 Fall 2011 CS 2316 Exam 3 Fall 2011 Name : 1. (2 points) Grading TA: Integrity: By taking this exam, you pledge that this is your work and you have neither given nor received inappropriate help during the taking

More information

What is Widget Layout? Laying Out Components. Resizing a Window. Hierarchical Widget Layout. Interior Design for GUIs

What is Widget Layout? Laying Out Components. Resizing a Window. Hierarchical Widget Layout. Interior Design for GUIs What is Widget Layout? Laying Out Components Positioning widgets in their container (typically a JPanel or a JFrame s content pane) Basic idea: each widget has a size and position Main problem: what if

More information

CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts

CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts The goal of this Python programming assignment is to write your own code inside a provided program framework, with some new graphical and mathematical

More information

PyGame Unit ?

PyGame Unit ? PyGame Unit 1 1.1 1.? 1.1 Introduction to PyGame Text Book for Python Module Making Games With Python and PyGame By Al Swiegert Easily found on the Internet: http://inventwithpython.com/pygame/chapters

More information

""" helloio.py illustrate form IO (still procedural) works, but bad design: no main function """ from Tkinter import *

 helloio.py illustrate form IO (still procedural) works, but bad design: no main function  from Tkinter import * helloio.py illustrate form IO (still procedural) works, but bad design: no main function app = Tk() lbloutput = Label(app, text = "type your name") lbloutput.grid() txtinput = Entry(app) txtinput.grid()

More information

Customisation and production of Badges. Getting started with I-Color System Basic Light

Customisation and production of Badges. Getting started with I-Color System Basic Light Customisation and production of Badges Getting started with I-Color System Basic Light Table of contents 1 Creating a Badge Model 1.1 Configuration of Badge Format 1.2 Designing your Badge Model 1.2.1

More information

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more

Topic 9: Swing. Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 5: Will be an open-ended Swing project. "Programming Contest"

More information

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun!

Topic 9: Swing. Why are we studying Swing? GUIs Up to now: line-by-line programs: computer displays text user types text. Outline. 1. Useful & fun! Swing = Java's GUI library Topic 9: Swing Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Why are we studying Swing? 1. Useful & fun! 2. Good application of OOP techniques

More information

Outline. general information policies for the final exam

Outline. general information policies for the final exam Outline 1 final exam on Tuesday 5 May 2015, at 8AM, in BSB 337 general information policies for the final exam 2 some example questions strings, lists, dictionaries scope of variables in functions working

More information

Graphical User Interface (GUI)

Graphical User Interface (GUI) Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware

More information

Jumping into GEMstudio. User guide 2013

Jumping into GEMstudio. User guide 2013 Jumping into GEMstudio User guide 2013 Table of Contents Jumping into GEMstudio...3 Lesson 1) Launching GEMstudio...4 Lesson 2) Creating & Editing Pages...7 Lesson 3) Adding Buttons...13 Lesson 4) Assigning

More information

c.def (pronounced SEE-def) Language Reference Manual

c.def (pronounced SEE-def) Language Reference Manual c.def (pronounced SEE-def) Macromedia Flash TM animation language Language Reference Manual Dennis Rakhamimov (dr524@columbia.edu), Group Leader Eric Poirier (edp29@columbia.edu) Charles Catanach (cnc26@columbia.edu)

More information

Programming Training. This Week: Tkinter for GUI Interfaces. Some examples

Programming Training. This Week: Tkinter for GUI Interfaces. Some examples Programming Training This Week: Tkinter for GUI Interfaces Some examples Tkinter Overview Set of widgets designed by John K. Ousterhout, 1987 Tkinter == Tool Kit Interface Mean to be driven by Tcl (Toolkit

More information

CS 251 Intermediate Programming Methods and Classes

CS 251 Intermediate Programming Methods and Classes CS 251 Intermediate Programming Methods and Classes Brooke Chenoweth University of New Mexico Fall 2018 Methods An operation that can be performed on an object Has return type and parameters Method with

More information

CS 251 Intermediate Programming Methods and More

CS 251 Intermediate Programming Methods and More CS 251 Intermediate Programming Methods and More Brooke Chenoweth University of New Mexico Spring 2018 Methods An operation that can be performed on an object Has return type and parameters Method with

More information

This text is used together with Mark Pilgrims book Dive Into Python 3 for the Arthead course Python Fundamentals.

This text is used together with Mark Pilgrims book Dive Into Python 3 for the Arthead course Python Fundamentals. 2 About this text This text is used together with Mark Pilgrims book Dive Into Python 3 for the Arthead course Python Fundamentals. The first part is written for Python 2 and at the end there is a section

More information

Game Programming with. presented by Nathan Baur

Game Programming with. presented by Nathan Baur Game Programming with presented by Nathan Baur What is libgdx? Free, open source cross-platform game library Supports Desktop, Android, HTML5, and experimental ios support available with MonoTouch license

More information

Laying Out Components. What is Widget Layout?

Laying Out Components. What is Widget Layout? Laying Out Components Interior Design for GUIs What is Widget Layout? Positioning widgets in their container (typically a JPanel or a JFrame s content pane) Basic idea: each widget has a size and position

More information

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics

Outline. Topic 9: Swing. GUIs Up to now: line-by-line programs: computer displays text user types text AWT. A. Basics Topic 9: Swing Outline Swing = Java's GUI library Swing is a BIG library Goal: cover basics give you concepts & tools for learning more Assignment 7: Expand moving shapes from Assignment 4 into game. "Programming

More information

CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random. Adapted from slides by Marty Stepp and Stuart Reges

CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random. Adapted from slides by Marty Stepp and Stuart Reges CSc 110, Spring 2018 Lecture 9: Parameters, Graphics and Random Adapted from slides by Marty Stepp and Stuart Reges Exercise: multiple parameters def main(): print_number(4, 9) print_number(17, 6) print_number(8,

More information

CS378 -Mobile Computing. User Interface Basics

CS378 -Mobile Computing. User Interface Basics CS378 -Mobile Computing User Interface Basics User Interface Elements View Control ViewGroup Layout Widget (Compound Control) Many pre built Views Button, CheckBox, RadioButton TextView, EditText, ListView

More information

Photoshop CS6 Section Notes 03

Photoshop CS6 Section Notes 03 Photoshop CS6 Section Notes 03 by Dr. Jim Watrous Objectives Converting Grayscale Photoshop file to RGB color files Creating and Saving a Separate Set of Color Swatches Loading and Using a Saved Color

More information

Adobe Flash CS5. Creating a web banner. Garvin Ling Juan Santa Cruz Bruno Venegas

Adobe Flash CS5. Creating a web banner. Garvin Ling Juan Santa Cruz Bruno Venegas Adobe Flash CS5 Creating a web banner Garvin Ling Juan Santa Cruz Bruno Venegas Introduction In this tutorial, you will be guided through a step-by-step process on how to create your very own animated

More information

ACS-1805 Introduction to Programming (with App Inventor)

ACS-1805 Introduction to Programming (with App Inventor) ACS-1805 Introduction to Programming (with App Inventor) Chapter 8 Creating Animated Apps 10/25/2018 1 What We Will Learn The methods for creating apps with simple animations objects that move Including

More information

New Features Overview for My Memories Suite 9

New Features Overview for My Memories Suite 9 New Features Overview for My Memories Suite 9 New Project Types You can now choose from several new project options such as Posters, Metal Prints, Canvas Prints, Social Media templates, and Photo Gifts

More information

Teaching London Computing

Teaching London Computing Teaching London Computing A Level Computer Science Programming GUI in Python William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London How the Session Works Outline

More information

Building a Java First-Person Shooter

Building a Java First-Person Shooter Building a Java First-Person Shooter Episode 9 Beginning 3D [Last Update 5/7/2017] Objective In this episode we create the class that we plan on using to render 3D images. We create a new class under the

More information

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming. Emmanuel Agu

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming. Emmanuel Agu CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming Emmanuel Agu Editting in Android Studio Recall: Editting Android Can edit apps in: Text View: edit XML directly Design

More information

Excel 2013 for Beginners

Excel 2013 for Beginners Excel 2013 for Beginners Class Objective: This class will familiarize you with the basics of using Microsoft Excel. Class Outline: Introduction to Microsoft Excel 2013... 1 Microsoft Excel...2-3 Getting

More information

Creating Vector Shapes Week 2 Assignment 1. Illustrator Defaults

Creating Vector Shapes Week 2 Assignment 1. Illustrator Defaults Illustrator Defaults Before we begin, we are going to make sure that all of us are using the same settings within our application. For this class, we will always want to make sure that our application

More information

Next Generation Intelligent LCDs

Next Generation Intelligent LCDs Next Generation Intelligent LCDs 2D Run-Length Encoding Application Note Version 1.0 Document Date: April 30, 2013 Copyright by demmel products gmbh 2004-2013 Unless otherwise noted, all materials contained

More information

CS/ENGRD 2110 FALL Lecture 2: Objects and classes in Java

CS/ENGRD 2110 FALL Lecture 2: Objects and classes in Java 1 CS/ENGRD 2110 FALL 2017 Lecture 2: Objects and classes in Java http://courses.cs.cornell.edu/cs2110 CMS VideoNote.com, PPT slides, DrJava 2 CMS. Visit course webpage, click Links, then CMS for 2110.

More information

LAYOUT. Chapter 3 of Pro WPF : By Matthew MacDonald Assist Lect. Wadhah R. Baiee. College of IT Univ. of Babylon

LAYOUT. Chapter 3 of Pro WPF : By Matthew MacDonald Assist Lect. Wadhah R. Baiee. College of IT Univ. of Babylon LAYOUT Chapter 3 of Pro WPF : By Matthew MacDonald Assist Lect. Wadhah R. Baiee. College of IT Univ. of Babylon - 2014 Loading and Compiling XAML (See Codes in your Textbook) There are three distinct coding

More information

Tutorial 3 - Welcome Application

Tutorial 3 - Welcome Application 1 Tutorial 3 - Welcome Application Introduction to Visual Programming Outline 3.1 Test-Driving the Welcome Application 3.2 Constructing the Welcome Application 3.3 Objects used in the Welcome Application

More information

RENDERING TECHNIQUES

RENDERING TECHNIQUES RENDERING TECHNIQUES Colors in Flash In Flash, colors are specified as numbers. A color number can be anything from 0 to 16,777,215 for 24- bit color which is 256 * 256 * 256. Flash uses RGB color, meaning

More information

CS 2110 Fall Instructions. 1 Installing the code. Homework 4 Paint Program. 0.1 Grading, Partners, Academic Integrity, Help

CS 2110 Fall Instructions. 1 Installing the code. Homework 4 Paint Program. 0.1 Grading, Partners, Academic Integrity, Help CS 2110 Fall 2012 Homework 4 Paint Program Due: Wednesday, 12 November, 11:59PM In this assignment, you will write parts of a simple paint program. Some of the functionality you will implement is: 1. Freehand

More information

2.6 Graphics SIMPLE DRAWINGS 9/9/16 74

2.6 Graphics SIMPLE DRAWINGS 9/9/16 74 2.6 Graphics SIMPLE DRAWINGS 9/9/16 74 Drawing Simple Graphics To help you create simple drawings, we have included a graphics module with the book that is a simplified version of Python s more complex

More information

CS103L PA4. March 25, 2018

CS103L PA4. March 25, 2018 CS103L PA4 March 25, 2018 1 Introduction In this assignment you will implement a program to read an image and identify different objects in the image and label them using a method called Connected-component

More information

User Interfaces. getting arguments of the command line a command line interface to store points fitting points with polyfit of numpy

User Interfaces. getting arguments of the command line a command line interface to store points fitting points with polyfit of numpy User Interfaces 1 Command Line Interfaces getting arguments of the command line a command line interface to store points fitting points with polyfit of numpy 2 Encapsulation by Object Oriented Programming

More information

Interface Builders and Interface Description Languages

Interface Builders and Interface Description Languages Interface Builders and Interface Description Languages Interface Builders (IB) and Interface Description Languages (IDL) enable Drag and Drop construction of GUI's are part of man;y Visual Studio(2013)

More information

Use the scantron sheet to enter the answer to questions (pages 1-6)

Use the scantron sheet to enter the answer to questions (pages 1-6) Use the scantron sheet to enter the answer to questions 1-100 (pages 1-6) Part I. Mark A for True, B for false. (1 point each) 1. Abstraction allow us to specify an object regardless of how the object

More information

Lesson 2: First Java Programs

Lesson 2: First Java Programs Lesson 2: First Java Programs Lesson 2: First Java Programs Objectives: Discuss why Java is an important programming language. Explain the Java virtual machine and byte code. Choose a user interface style.

More information

SPRINGBOARD UNIT 5 GEOMETRY

SPRINGBOARD UNIT 5 GEOMETRY SPRINGBOARD UNIT 5 GEOMETRY 5.1 Area and Perimeter Perimeter the distance around an object. To find perimeter, add all sides. Area the amount of space inside a 2 dimensional object. Measurements for area

More information

Recitation 3 Further Work with Dreamweaver and Photoshop: Refining your Web Site

Recitation 3 Further Work with Dreamweaver and Photoshop: Refining your Web Site Recitation 3 Further Work with Dreamweaver and Photoshop: Refining your Web Site More Photoshop skills Selecting areas of the image - using the selection tools In Recitation 2 we learned there are several

More information

Level 3 Computing Year 2 Lecturer: Phil Smith

Level 3 Computing Year 2 Lecturer: Phil Smith Level 3 Computing Year 2 Lecturer: Phil Smith Previously We started to build a GUI program using visual studio 2010 and vb.net. We have a form designed. We have started to write the code to provided the

More information

When to use the Grid Manager

When to use the Grid Manager 第 1 页共 5 页 2015/6/8 8:02 back next The Grid geometry manager puts the widgets in a 2-dimensional table. The master widget is split into a number of rows and columns, and each cell in the resulting table

More information

Center for Faculty Development and Support Creating Powerful and Accessible Presentation

Center for Faculty Development and Support Creating Powerful and Accessible Presentation Creating Powerful and Accessible Presentation PowerPoint 2007 Windows Tutorial Contents Create a New Document... 3 Navigate in the Normal View (default view)... 3 Input and Manipulate Text in a Slide...

More information

CS/ENGRD 2110 SPRING Lecture 2: Objects and classes in Java

CS/ENGRD 2110 SPRING Lecture 2: Objects and classes in Java 1 CS/ENGRD 2110 SPRING 2014 Lecture 2: Objects and classes in Java http://courses.cs.cornell.edu/cs2110 Java OO (Object Orientation) 2 Python and Matlab have objects and classes. Strong-typing nature of

More information

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department 0901212 Python Programming 1 st Semester 2014/2015 Course Catalog This course introduces

More information

Composite Pattern Diagram. Explanation. JavaFX Subclass Hierarchy, cont. JavaFX: Node. JavaFX Layout Classes. Top-Level Containers 10/12/2018

Composite Pattern Diagram. Explanation. JavaFX Subclass Hierarchy, cont. JavaFX: Node. JavaFX Layout Classes. Top-Level Containers 10/12/2018 Explanation Component has Operation( ), which is a method that applies to all components, whether composite or leaf. There are generally many operations. Component also has composite methods: Add( ), Remove(

More information

Maya Lesson 3 Temple Base & Columns

Maya Lesson 3 Temple Base & Columns Maya Lesson 3 Temple Base & Columns Make a new Folder inside your Computer Animation Folder and name it: Temple Save using Save As, and select Incremental Save, with 5 Saves. Name: Lesson3Temple YourName.ma

More information

How to Open Excel. Introduction to Excel TIP: Right click Excel on list and select PIN to Start Menu. When you open Excel, a new worksheet opens

How to Open Excel. Introduction to Excel TIP: Right click Excel on list and select PIN to Start Menu. When you open Excel, a new worksheet opens Introduction to Excel 2010 What is Excel? It is a Microsoft Office computer software program to organize and analyze numbers, data and labels in spreadsheet form. Excel makes it easy to translate data

More information

Part 3. Useful Python

Part 3. Useful Python Part 3 Useful Python Parts one and two gave you a good foundation in the Python language and a good understanding of software design. You ve built some substantial applications, and hopefully you ve built

More information

IMAGE COMPRESSION USING FOURIER TRANSFORMS

IMAGE COMPRESSION USING FOURIER TRANSFORMS IMAGE COMPRESSION USING FOURIER TRANSFORMS Kevin Cherry May 2, 2008 Math 4325 Compression is a technique for storing files in less space than would normally be required. This in general, has two major

More information

Graphical User Interfaces (GUIs)

Graphical User Interfaces (GUIs) CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Model-View-Controller (MVC) Model for GUI programming (Xerox

More information

UNIVERSITY OF CALIFORNIA AT BERKELEY. Name:

UNIVERSITY OF CALIFORNIA AT BERKELEY. Name: UNIVERSITY OF CALIFORNIA AT BERKELEY COMPUTER SCIENCE DIVISION - EECS CS160 Second Midterm Examination Prof L.A. Rowe Spring 2001 Name: Score: Question Possible Points 1 (50 points) 2 (10 points) 3 (20

More information

COMP-202: Foundations of Programming. Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015

COMP-202: Foundations of Programming. Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015 COMP-202: Foundations of Programming Lecture 26: Image Manipulation; Wrap-Up Jackie Cheung, Winter 2015 Announcements Assignment 6 due Tue Apr 14 at 11:59pm Final is scheduled for Apr 29, 6pm 9pm Please

More information

1. Open up PRO-DESKTOP from your programmes menu. Then click on the file menu > new> design.

1. Open up PRO-DESKTOP from your programmes menu. Then click on the file menu > new> design. Radio Tutorial Draw your spatula shape by:- 1. Open up PRO-DESKTOP from your programmes menu. Then click on the file menu > new> design. 2. The new design window will now open. Double click on design 1

More information

Human-Computer Interaction IS4300

Human-Computer Interaction IS4300 Human-Computer Interaction IS4300 1 Quiz 3 1 I5 due next class Your mission in this exercise is to implement a very simple Java painting applet. The applet must support the following functions: Draw curves,

More information

GOALS [HTDP/2e Chapters 1 through 3.5]

GOALS [HTDP/2e Chapters 1 through 3.5] Lab 1 GOALS [HTDP/2e Chapters 1 through 3.5] This week's lab will help you to practice: Using Dr.Racket: Interactions vs. Definitions; Stepper; Error messages; Indentation Simple image functions; using

More information

CMPSCI 119 LAB #2 Greebles / Anime Eyes Professor William T. Verts

CMPSCI 119 LAB #2 Greebles / Anime Eyes Professor William T. Verts CMPSCI 119 LAB #2 Greebles / Anime Eyes Professor William T. Verts The goal of this Python programming assignment is to write your own code inside a provided program framework, with some new graphical

More information

This homework has an opportunity for substantial extra credit, which is described at the end of this document.

This homework has an opportunity for substantial extra credit, which is described at the end of this document. CS 2316 Pair Homework Box Packer Due: Tuesday, June 17th, before 11:55 PM Out of 100 points Files to submit: 1. boxpacker.py For Help: - TA Helpdesk Schedule posted on class website. - Email TA's or use

More information

Scalable Vector Graphics (SVG) vector image World Wide Web Consortium (W3C) defined with XML searched indexed scripted compressed Mozilla Firefox

Scalable Vector Graphics (SVG) vector image World Wide Web Consortium (W3C) defined with XML searched indexed scripted compressed Mozilla Firefox SVG SVG Scalable Vector Graphics (SVG) is an XML-based vector image format for twodimensional graphics with support for interactivity and animation. The SVG specification is an open standard developed

More information

TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill

TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill dewan@cs.unc.edu Code available at: https://github.com/pdewan/colabteaching PRE-REQUISITES Model-

More information

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) Web Development & Design Foundations with HTML5 Ninth Edition Chapter 3 Configuring Color and Text with CSS Slides in this presentation contain hyperlinks. JAWS users should be able to get a list of links

More information