CSN 332 - 002 : Graphical User Interface Design

Programming Assignment 1 - Due Thursday, February 7

For this assignment, you may find it useful to access information from the GTK + Reference Manual. A link exists on the course home page.

Also on the course home page is a link to the source code for all of the examples in the GNOME/ GTK + textbook. Create a directory on your account called GUI. All assignments for the course should be kept in directories contained in the course directory, GUI. Create a directory in GUI called buttonwin . Change directories to buttonwin and copy the source code and makefile for buttonwin.c (p.29) to your directory. Make and run the program.

Answer the following questions in a file called comments:

1. What happens when the button is pushed? What happens when the button is pushed but the cursor is moved off of the button before it is released?

2. What types of signals may be emitted for a gtk_button ?

3. Which kind of signal is emitted by GTK in the first case? In the second case?

Modify buttonwin.c as follows: change the eventButton callback function so that it responds to a "pressed" signal instead of a "clicked" signal. Make and run the program.

4. Now what happens when you press the button in the two ways described above?

Create two new callback functions, one for a "released" event, one for an "enter" event. The callback for the release event should print the message "The button was released."; the callback for the "enter" event should print the message "The cursor entered button region."

Make sure that your directory on eckserver (~ yourname /GUI/ buttonwin ) contains

makefile

buttonwin.c

comments