Lect03 GUI Programming1 GTK
Lect03 GUI Programming1 GTK
Lecture 3.
GUI Programming – part 1: GTK
2010-9-15 Slide 1
Outline
• Introduce basic GUI programming in Gtk.
• Learn the concept of widget, event and
signal, and callback, etc.
• Learn to create menu, open file, edit text,
and display figures, etc.
height
vbox
vbox
callback function
/* (1) Show the 1st menu item. */
gtk_widget_show (menu_item);
message passed to callback
gtk_main (); /* enter the gtk display loop until the window is destroyed */
return 0;
} /* END OF THE MAIN CODE */
all: $(PROGRAM)
$(PROGRAM): $(PROGRAM).c
$(CC) $< -o $@ \
`pkg-config gtk+-2.0 --cflags --libs`
Important: Learn to write “makefile” for compiling your project and for
multiple-task programming.