name="<imain@gtk.org>"></tt>,
Tony Gale <tt><htmlurl url="mailto:gale@gtk.org"
name="<gale@gtk.org>"></tt>
-<date>May 29th, 1998
+<date>June 2nd, 1998
<!-- ***************************************************************** -->
<sect>Introduction
world ala GTK.
<tscreen><verb>
-/* example-start helloworld/helloworld.c */
+/* example-start helloworld helloworld.c */
#include <gtk/gtk.h>
widgets.
<tscreen><verb>
-/* example-start helloworld2/helloworld2.c */
+/* example-start helloworld2 helloworld2.c */
#include <gtk/gtk.h>
<sect1>Packing Demonstration Program
<p>
<tscreen><verb>
-/* example-start packbox/packbox.c */
+/* example-start packbox packbox.c */
#include "gtk/gtk.h"
Here's the source code:
<tscreen><verb>
-/* example-start table/table.c */
+/* example-start table table.c */
+
#include <gtk/gtk.h>
/* our callback.
the rest so you can use it in your programs.
<tscreen><verb>
-/* example-start buttons/buttons.c */
+/* example-start buttons buttons.c */
#include <gtk/gtk.h>
The following example creates a radio button group with three buttons.
<tscreen><verb>
-/* example-start radiobuttons/radiobuttons.c */
+/* example-start radiobuttons radiobuttons.c */
#include <gtk/gtk.h>
#include <glib.h>
gtk_main();
return(0);
}
+/* example-end */
</verb></tscreen>
You can shorten this slightly by using the following syntax, which
code also shows you how to reset the Progress Bar.
<tscreen><verb>
-/* example-start progressbar/progressbar.c */
+/* example-start progressbar progressbar.c */
#include <gtk/gtk.h>
The following is an example of using a pixmap in a button.
<tscreen><verb>
-/* example-start pixmap/pixmap.c */
+/* example-start pixmap pixmap.c */
#include <gtk/gtk.h>
desktop.
<tscreen><verb>
-/* example-start wheelbarrow/wheelbarrow.c */
+/* example-start wheelbarrow wheelbarrow.c */
#include <gtk/gtk.h>
return 0;
}
+/* example-end */
</verb></tscreen>
To make the wheelbarrow image sensitive, we could attach the button press
Placement of the drawing area and the rulers are done using a table.
<tscreen><verb>
-/* example-start rulers/rulers.c */
+/* example-start rulers rulers.c */
#include <gtk/gtk.h>
onto the statusbar, and one for popping the last item back off.
<tscreen><verb>
-/* example-start statusbar/statusbar.c */
+/* example-start statusbar statusbar.c */
#include <gtk/gtk.h>
#include <glib.h>
The following code is an example of using an Entry widget.
<tscreen><verb>
-/* example-start entry/entry.c */
+/* example-start entry entry.c */
#include <gtk/gtk.h>
changes the background color.
<tscreen><verb>
-/* example-start colorsel/colorsel.c */
+/* example-start colorsel colorsel.c */
#include <glib.h>
#include <gdk/gdk.h>
screen, it does nothing as there is not a signal attached to it.
<tscreen><verb>
-/* example-start filesel/filesel.c */
+/* example-start filesel filesel.c */
#include <gtk/gtk.h>
and exit the program.
<tscreen><verb>
-/* example-start notebooknotebook.c */
+/* example-start notebook notebook.c */
#include <gtk/gtk.h>
I've only commented on the parts that may be new to you.
<tscreen><verb>
-/* example-start scrolledwin/scrolledwin.c */
+/* example-start scrolledwin scrolledwin.c */
#include <gtk/gtk.h>
shrink instead of being pushed off the bottom of the window.
<tscreen><verb>
-/* example-start paned/paned.c */
+/* example-start paned paned.c */
#include <gtk/gtk.h>
matter how the user resizes the top-level window.
<tscreen><verb>
-/* example-start aspectframe/aspectframe.c */
+/* example-start aspectframe aspectframe.c */
#include <gtk/gtk.h>
into a prison by selecting them with the rightmost mouse button.
<tscreen><verb>
-/* example-start list/list.c */
+/* example-start list list.c */
/* include the gtk+ header files
* include stdio.h, we need that for the printf() function
That should about do it. Let's take a look at an example to help clarify.
<tscreen><verb>
-/* example-start menu/menu.c */
+/* example-start menu menu.c */
#include <gtk/gtk.h>
of the global variables used in the menufactory.c file.
<tscreen><verb>
-/* example-start menu/menufactory.h */
+/* example-start menu menufactory.h */
#ifndef __MENUFACTORY_H__
#define __MENUFACTORY_H__
And here is the menufactory.c file.
<tscreen><verb>
-/* example-start menu/menufactory.c */
+/* example-start menu menufactory.c */
#include <gtk/gtk.h>
#include <strings.h>
And here's the mfmain.h
<tscreen><verb>
-/* example-start menu/mfmain.h */
+/* example-start menu mfmain.h */
#ifndef __MFMAIN_H__
#define __MFMAIN_H__
And mfmain.c
<tscreen><verb>
-/* example-start menu/mfmain.c */
+/* example-start menu mfmain.c */
#include <gtk/gtk.h>
mouse-click on the label causes the program to exit.
<tscreen><verb>
-/* example-start eventbox/eventbox.c */
+/* example-start eventbox eventbox.c */
#include <gtk/gtk.h>
converted.
<tscreen><verb>
-/* example-start selection/gettargets.c */
+/* example-start selection gettargets.c */
#include <gtk/gtk.h>
string representation of the time is returned.
<tscreen><verb>
-/* example-start selection/setselection.c */
+/* example-start selection setselection.c */
#include <gtk/gtk.h>
#include <time.h>