Blame tests/simple.c

Packit 98cdb6
/* simple.c
Packit 98cdb6
 * Copyright (C) 1997  Red Hat, Inc
Packit 98cdb6
 * Author: Elliot Lee
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Library General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
 * Library General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Library General Public
Packit 98cdb6
 * License along with this library; if not, write to the
Packit 98cdb6
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
 * Boston, MA 02111-1307, USA.
Packit 98cdb6
 */
Packit 98cdb6
#include "config.h"
Packit 98cdb6
#include <gtk/gtk.h>
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
void
Packit 98cdb6
hello (void)
Packit 98cdb6
{
Packit 98cdb6
  g_print ("hello world\n");
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
int
Packit 98cdb6
main (int argc, char *argv[])
Packit 98cdb6
{
Packit 98cdb6
  GtkWidget *window;
Packit 98cdb6
  GtkWidget *button;
Packit 98cdb6
Packit 98cdb6
  /* FIXME: This is not allowable - what is this supposed to be? */
Packit 98cdb6
  /*  gdk_progclass = g_strdup ("XTerm"); */
Packit 98cdb6
  gtk_init (&argc, &argv);
Packit 98cdb6
  
Packit 98cdb6
  window = g_object_connect (g_object_new (gtk_window_get_type (),
Packit 98cdb6
					     "user_data", NULL,
Packit 98cdb6
					     "type", GTK_WINDOW_TOPLEVEL,
Packit 98cdb6
					     "title", "hello world",
Packit 98cdb6
					     "allow_grow", FALSE,
Packit 98cdb6
					     "allow_shrink", FALSE,
Packit 98cdb6
					     "border_width", 10,
Packit 98cdb6
					     NULL),
Packit 98cdb6
			     "signal::destroy", gtk_main_quit, NULL,
Packit 98cdb6
			     NULL);
Packit 98cdb6
  button = g_object_connect (g_object_new (gtk_button_get_type (),
Packit 98cdb6
					     "GtkButton::label", "hello world",
Packit 98cdb6
					     "GtkWidget::parent", window,
Packit 98cdb6
					     "GtkWidget::visible", TRUE,
Packit 98cdb6
					     NULL),
Packit 98cdb6
			     "signal::clicked", hello, NULL,
Packit 98cdb6
			     NULL);
Packit 98cdb6
  gtk_widget_show (window);
Packit 98cdb6
Packit 98cdb6
  gtk_main ();
Packit 98cdb6
Packit 98cdb6
  return 0;
Packit 98cdb6
}