CS253

This file defines the header for each page. An optional "icon" image (I use the textbook):

A link to enable editing of this page: Edit TopBar Replace this with info about this class:

CS253: Problem Solving with C++

Spring 2012

Gtkmm Lab

Links to the various pages for this class:

Wish I could do this: * Schedule

Gtkmm Lab

Description

gtkmm is a C++ wrapper for GTK+, a library used to create graphical user interfaces. gtkmm was originally named gtk-- because GTK+ already has a + in the name. However, as -- is not easily indexed by search engines, the package generally went by the name gtkmm, and that’s what they stuck with.

We will be using gtkmm in a future homework assignment.

Tasks

  1. Go to http://www.gtkmm.org/documentation.shtml and find the Programming with gtkmm online book.
  2. In Chapter 3, Basics, there is a simple example that creates an empty 200×200 window.
    • You can download the source code, which might be easier than copy-and-paste.
    • Note the use of pkg-config. Try running pkg-config alone, just to see the work that it saves you: pkg-config gtkmm-3.0 --cflags --libs
    • Now, compile the program as shown, and execute it.
  3. Farther down in the same chapter, there is a “Hello World” example.
    • Compile it and execute it.
    • Change the button label to “Die, ye scurvy dogs!”, recompile and execute.
    • Try resizing the window.
  4. In the second half of Chapter 7, Multiple-item widgets, there is an improved “Hello World” example.
    • Download it (don’t get it mixed up with the earlier “Hello World”).
    • Compile and execute it.
    • Add a third button, below the first two, like this, whose width spans both existing buttons:
        +--------+  +--------+
        |Button 1|  |Button 2|
        +--------+  +--------+
        +--------------------+
        |      Big Shot      |
        +--------------------+

For Fame & Glory

Modified: 2012-04-09T23:33

User: Guest

Check: HTML CSS
Edit History Source
Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2015 Colorado State University
CS Building