levo

Graphical User Interface Objects and Events

The event loop and the event queue

  • 3 things to know
  • AS Unit 2

Overview

Event in an event driven program, event queue and event loop.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

What is the event queue?

Key term

Describe the event loop.

Key term

Where do events come from before they reach the queue?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is an event in an event driven program?

    Model answer

    An event is a record that something has happened, such as a mouse click or a key press, that the program may choose to respond to.

  2. 2

    What is the event queue?

    Model answer

    The event queue is the ordered store of events waiting to be dealt with, and events are taken from the front in the order they arrived.

  3. 3

    Describe the event loop.

    Model answer

    The event loop repeatedly takes the next event from the queue, finds the handlers registered for it, runs them, then goes back for the next event.

  4. 4

    Where do events come from before they reach the queue?

    Model answer

    The operating system detects the physical input from the mouse, keyboard or touch screen and passes a message to the application, which queues it.

  5. 5

    Why is the event loop described as running until the application closes?

    Model answer

    The event loop must keep waiting for the next user action, so the loop only stops when the application is told to exit.

  6. 6

    What is the event dispatch thread?

    Model answer

    The event dispatch thread is the single thread that takes events from the queue and runs the handlers, so two handlers never run at the same time.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Software and the Development Environment
Defining Data: Types, Variables and Classes
Program Control Structures
Objects, Classes and Data Structures

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A null is the of one.
absencepresencetype

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

AA null means no value has been recorded.
BZero and an empty string are values.
CA null is the absence of a value.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

An error is the mistake a person made.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Graphical User Interface Objects and Events, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.