• Keine Ergebnisse gefunden

Exercise 4: Procedures versus Call Backs Winter Term 2018/19

N/A
N/A
Protected

Academic year: 2021

Aktie "Exercise 4: Procedures versus Call Backs Winter Term 2018/19"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Exercise 4: Procedures versus Call Backs

Winter Term 2018/19

As opposed to regular C-style programming, graphical user interfaces adopt the idea of call-back functions. This exercise is supposed to give you some ideas about this scheme.

Unit 1: Implement a regular C-function that simulates a regular traffic light. The functions output should be in ASCII; a complete cycle may look as follows:

R RY

G Y

withR,Y,Gindicating red, yellow, and green, and indicating a blank or a dot. Your function should print three complete cycles.

Unit 2: Convert your function into a call-back function. To this end, the function has to remember its own “state”. In each call, the function should print its current state and should advance to the next one.

Question: What parameters does this function require?

Unit 3: Convert your function from the previous unit into a regular C++ class.

Have fun, Theo and Ralf

1

Referenzen

ÄHNLICHE DOKUMENTE

Design a graphical user interface for such a notepad application that incorporates the considera- tions discussed above.. Use paper and a pencil to arrange the layout of your

The application should be complete in that it contains a main-window and optinally menus, a toolbar as well as a statusbar.. Also, the program should feature the

Unit 2: Implement a stopwatch that should contain a stop-button, a start-button, and a display (QLCDNumber) that displays the elapsed time in seconds. Have fun, Theo

The complete tutorials, including the description and source files, are available at /opt/lehre/qt-tut/qt-tut.zip1. The top-level file of the tutorials is

Chapters 4 to 7 are dealing with the creation of an own widget, the use of the signal-and-slot mechanism, and the layout of widgets in a window.. Work through Chapters 4 to 7 of

Unit 10: Go to the University’s home page www.uni-rostock.de and find students sports recreation’s home page (Seite des Hochschulsports).. Unit 11: Go to the University’s home

15 Appellate Body Report, European Communities and Certain Member States – Measures Affecting Trade in Large Civil Aircraft, WT/DS316/AB/R.. 16 Panel Report, European Communities

The ESCAPE lead-in character is not shown. The characters that follow will display at normal intensity. The characters that follow will display at high