Windowing classes

Course links

Exercise 1

Create your own variant of the greeting program, replacing the frame title and the MrEd-message-object label with strings of your own choice. Run it. Use the frame buttons to maximize the window (so that it fills the screen), and then to restore it to normal size. Resize the window by tugging at a side or corner of the frame.

Exercise 2

Revise the click-tallier program so that its user interface includes a Dismiss button as well as the Click here button.

Exercise 3

An alternative approach to the click-tallier procedure would be to create an object of the tally% class defined in the reading on classes and objects in DrScheme, and to use a normal, non-tallying Click here button in which the callback procedure first sends a :bump! message to the tally and then changes the text of click-tallier-message to reflect the new state of the tally. Revise the click-tallier program so that it uses this approach.

Exercise 4

One advantage of the approach described in the previous exercise is that the same tally can receive messages from various sources. Revise the program again so that its user interface includes a Reset button that resets the tally to zero.

Exercise 5

Develop a program that displays, in a separate window, a slider whose values range from 33 (the ASCII character code for #\!) to 126 (the ASCII character code for #\~). The MrEd-message-object should display the character whose ASCII code is currently selected by the slider.