diff options
author | GMT 1999 Tony Gake <gale@gtk.org> | 1999-01-29 09:53:14 +0000 |
---|---|---|
committer | Tony Gale <gale@src.gnome.org> | 1999-01-29 09:53:14 +0000 |
commit | c39dffed55915a9367df8aba7c6eb237da30a66f (patch) | |
tree | 8bb8ed8e79f4b2f69edcdab29bdae6dddbb86d04 /examples/frame | |
parent | e735ac6c86bd97fb62dd157ab3a4ec9661427547 (diff) | |
download | gdk-pixbuf-c39dffed55915a9367df8aba7c6eb237da30a66f.tar.gz |
examples/fixed/*, examples/frame/* - Examples from the Tutorial
Fri Jan 29 09:44:37 GMT 1999 Tony Gake <gale@gtk.org>
* examples/fixed/*, examples/frame/*
- Examples from the Tutorial
Diffstat (limited to 'examples/frame')
-rw-r--r-- | examples/frame/Makefile | 8 | ||||
-rw-r--r-- | examples/frame/frame.c | 52 |
2 files changed, 60 insertions, 0 deletions
diff --git a/examples/frame/Makefile b/examples/frame/Makefile new file mode 100644 index 000000000..0afdbf2aa --- /dev/null +++ b/examples/frame/Makefile @@ -0,0 +1,8 @@ + +CC = gcc + +frame: frame.c + $(CC) `gtk-config --cflags` frame.c -o frame `gtk-config --libs` + +clean: + rm -f *.o frame diff --git a/examples/frame/frame.c b/examples/frame/frame.c new file mode 100644 index 000000000..6091f0131 --- /dev/null +++ b/examples/frame/frame.c @@ -0,0 +1,52 @@ +/* example-start frame frame.c */ + +#include <gtk/gtk.h> + +int main( int argc, + char *argv[] ) +{ + /* GtkWidget is the storage type for widgets */ + GtkWidget *window; + GtkWidget *frame; + GtkWidget *button; + gint i; + + /* Initialise GTK */ + gtk_init(&argc, &argv); + + /* Create a new window */ + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(window), "Frame Example"); + + /* Here we connect the "destroy" event to a signal handler */ + gtk_signal_connect (GTK_OBJECT (window), "destroy", + GTK_SIGNAL_FUNC (gtk_main_quit), NULL); + + gtk_widget_set_usize(window, 300, 300); + /* Sets the border width of the window. */ + gtk_container_set_border_width (GTK_CONTAINER (window), 10); + + /* Create a Frame */ + frame = gtk_frame_new(NULL); + gtk_container_add(GTK_CONTAINER(window), frame); + + /* Set the frames label */ + gtk_frame_set_label( GTK_FRAME(frame), "GTK Frame Widget" ); + + /* Align the label at the right of the frame */ + gtk_frame_set_label_align( GTK_FRAME(frame), 1.0, 0.0); + + /* Set the style of the frame */ + gtk_frame_set_shadow_type( GTK_FRAME(frame), GTK_SHADOW_ETCHED_OUT); + + gtk_widget_show(frame); + + /* Display the window */ + gtk_widget_show (window); + + /* Enter the event loop */ + gtk_main (); + + return(0); +} +/* example-end */ |