home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / imagemap / imap_table.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-22  |  2.6 KB  |  81 lines

  1. /*
  2.  * This is a plug-in for the GIMP.
  3.  *
  4.  * Generates clickable image maps.
  5.  *
  6.  * Copyright (C) 1998-1999 Maurits Rijk  lpeek.mrijk@consunet.nl
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21.  *
  22.  */
  23.  
  24. #include "imap_table.h"
  25.  
  26. GtkWidget*
  27. create_spin_button_in_table(GtkWidget *table, int row, int col,
  28.                 int value, int min, int max)
  29. {
  30.    GtkObject *adj = gtk_adjustment_new(value, min, max, 1, 1, 1);
  31.    GtkWidget *button = gtk_spin_button_new(GTK_ADJUSTMENT(adj), 1, 0);
  32.    gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(button), TRUE);
  33.    gtk_table_attach_defaults(GTK_TABLE(table), button, col, col + 1,
  34.                  row, row + 1);
  35.    gtk_widget_show(button);
  36.    return button;
  37. }
  38.  
  39. GtkWidget*
  40. create_check_button_in_table(GtkWidget *table, int row, int col,
  41.                  const char *text)
  42. {
  43.    GtkWidget *button = gtk_check_button_new_with_label(text);
  44.    gtk_table_attach_defaults(GTK_TABLE(table), button, col, col + 1,
  45.                  row, row + 1);
  46.    gtk_widget_show(button);
  47.    return button;
  48. }
  49.  
  50. GtkWidget*
  51. create_radio_button_in_table(GtkWidget *table, GSList *group, 
  52.                  int row, int col, const char *text)
  53. {
  54.    GtkWidget *button = gtk_radio_button_new_with_label(group, text);
  55.    gtk_table_attach_defaults(GTK_TABLE(table), button, col, col + 1,
  56.                  row, row + 1);
  57.    gtk_widget_show(button);
  58.    return button;
  59. }
  60.  
  61. GtkWidget*
  62. create_label_in_table(GtkWidget *table, int row, int col, const char *text)
  63. {
  64.    GtkWidget *label = gtk_label_new(text);
  65.    gtk_table_attach_defaults(GTK_TABLE(table), label, col, col + 1, 
  66.                  row, row + 1);
  67.    gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
  68.    gtk_widget_show(label);
  69.    return label;
  70. }
  71.  
  72. GtkWidget*
  73. create_entry_in_table(GtkWidget *table, int row, int col)
  74. {
  75.    GtkWidget *entry = gtk_entry_new();
  76.    gtk_table_attach_defaults(GTK_TABLE(table), entry, col, col + 1,
  77.                  row, row + 1);
  78.    gtk_widget_show(entry);
  79.    return entry;
  80. }
  81.