Event Driven Programming Dick Steflik

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
C H A P T E R T E N Event-Driven Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview Part 2: History (continued)
Dale Roberts Introduction to Visual Programming Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and.
OPERATING SYSTEM - program that is loaded into the computer and coordinates all the activities among computer hardware devices. -controls the hardware.
X-WindowsP.K.K.Thambi The X Window System Module 5.
MIT 6.893; SMA 5508 Spring 2004 Larry Rudolph Lecture 4: Graphic User Interface Graphical User Interface Larry Rudolph MIT 6.893; SMA 5508 Spring 2004.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
I/O Organization Competency – C6. Important facts to remember when I/O devices are to be connected to CPU There is a vast variety of I/O devices. Some.
An operating system (OS) is a collection of system programs that together control the operation of a computer system.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
Sockets A popular API for client-server interaction.
WHAT IS HARDWARE ? Computer hardware is the collection of physical elements that comprise a COMPUTER SYSTEM LIKE A MOUSE, MONITOR, KEYBOARD, SPEAKER MICROPHONE,
The operating system may be loaded into the computers memory in two ways.  it is already present in ROM (so is permanent, immediately accessible and.
X Window System
Introduction to Operating Systems Concepts
Computer System Structures Interrupts
3-Tier Architectures (or 3-Tier Applications)
Operating System & Application Software
Interrupts and exceptions
Lecture 1: Operating System Services
Resource Management IB Computer Science.
Clocks, I/O devices, Thin Clients, and Power Management
Event Loops and GUI Intro2CS – weeks
CompSci 230 S Software Construction
68HC11 Interrupts & Resets.
HARDWARE The hardware is the part you can see the computer, ie all components of their physical structure. The screen, keyboard, and mouse tower of the.
Event-driven programming
Event loops 16-Jun-18.
Console and GUI Programs
MVC and other n-tier Architectures
Introduction to Computers and Java
CS 3305 System Calls Lecture 7.
CSC461 Lecture 8: Input Devices
Understanding an App’s Architecture
Introduction to Operating System (OS)
Intro to Processes CSSE 332 Operating Systems
Chapter 8 I/O.
Prepared by: Ms. Amira al-Ghanem Prepared for: Ms. Omarine
What is an operating system?
Database Driven Websites
Event Driven Programming
Programmable Logic Controllers (PLCs) An Overview.
CSCI 315 Operating Systems Design
Introduction to Computing Using Java
Chapter 2: System Structures
X Windows.
Event loops.
I/O Systems I/O Hardware Application I/O Interface
Event Driven Programming
GTK + Programming.
Language Processors Application Domain – ideas concerning the behavior of a software. Execution Domain – Ideas implemented in Computer System. Semantic.
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Introduction to Computer Software
Computer Science 111 Fundamentals of Programming I User Interfaces
Event loops 8-Apr-19.
LING 408/508: Computational Techniques for Linguists
Graphics and FLTK CSCE 121 J. Michael Moore
Chapter 2: Operating-System Structures
Event loops.
February 16th, 2004 Class Meeting 5
Introduction to Operating Systems
Event loops.
Event loops 19-Aug-19.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Event Driven Programming Dick Steflik CS-260 Event Driven Programming Dick Steflik

What is it? Program execution is determined by user or sensor generated events rather than the old linear (begining to end) execution of command line programs. Execution is non-linear

Embedded Systems Interrupts – these are usually sensor generated asynchronous real-world events. Usually handled by an ISS (Interrupt Servicing Subroutine) that gains control via a hardware controlled vector (automatic hardware branch). Ex. A microcontroller based humidifier that has a low water interrupt that automatically puts the device into a non-damaging state when it runs out of water and displays a low water message.

Event Handling The IBM Series 1 (circa 1980s) process control computer was one of the first event driven computers, it responded to external sensor generated events and was used to control industrial processes. Programmed via EDL (Event Driven Language). For each possible event a handler was provided, a typical program would initialize the environment then enter a do forever loop. When an event occurred, program control would transfer from the loop to the appropriate handler, execute the handler then return to the loop.

GUI Event Processing With the advent of the personal computer and the modern day Graphical User Interface the model used for Event Processing in process control applications was extended to the GUI. Initialize the environment register the event generators loop forever (wait for an event) when an even occurs, put it into the event queue the dispatcher will examine the next event in the queue and invoke the correct handler

Initializing the Environment Mask off all events (don’t allow events) Register all of the widgets that create events what they are, where they are, names Register the event handlers bind the various events to their handlers Unmask the events (allow them to happen.

Event Queues most systems enqueue events before dispatching a queue may be a simple fifo but more likely a priority queue, that way some events can be dispatched before others

GUI Events Keyboard Events Mouse Events Screen Events (touch screens) Pen Events

Cross Platform GUI Toolkits Tcl/Tk – The Tk GUI toolkit Tkinter: python wrappers for Tk; open source GTK+ (Gimp Toolkit) PyGTK : Python wrappers for the GTK+; open source wxWidgets wxPython: Python bindings for wxWidgets; open source Qt PyQt: Python bindings for Qt; PyQt is a licensed product (as is Qt)

Tkinter : Tk Interface a Python binding to the Tk GUI toolkit de-facto GUI standard for Python written by Fredrik Lundh Python wrapper around a Tcl interpreter embedded in the Python interpretor; this lets you mix Python and Tcl in the same program. “themed Tk” - Tk widgets can be themed to look like the hosting OS.

Toolkit Relationships

Previous Slide The previous slide shows the relationships on UNIX and LINUX systems where the toolkits are based on X11, remember X11 is a client-server display system where the app is an X-client and makes calls to xlib to send commands to an display things and uses an x-server to display them. This is very different than the way it is done on Windows

X11 Architecture Example deployment of X server: the X server receives input from a local keyboard and mouse and displays to a screen. A web browser and a terminal emulator run on the user's workstation and a software update application runs on a remote computer but is controlled and monitored from the user's machine