/* vim: set et sts=4 sw=4 fdm=indent fdn=1 fo+=t tw=80 fileencoding=utf-8:
*
- * Taller de ProgramaciÃ\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82³n (75.42).
+ * Taller de Programación (75.42).
*
- * Ejercicio NÃ\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82ºmero 5:
+ * Ejercicio Número 5:
* Graficador de figuras.
*
* Copyleft 2003 - Leandro Lucarella <llucare@fi.uba.ar>
- * Puede copiar, modificar y distribuir este programa bajo los tÃ\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82©rminos de
+ * Puede copiar, modificar y distribuir este programa bajo los términos de
* la licencia GPL (http://www.gnu.org/).
*
- * Creado: miÃ\83Â\83Ã\82Â\83Ã\83Â\82Ã\82Â\83Ã\83Â\83Ã\82Â\82Ã\83Â\82Ã\82© oct 1 23:31:40 ART 2003
+ * Creado: mié oct 1 23:31:40 ART 2003
*
* $Id$
*/
#include "interface.h"
#include "dibujo.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
+//#include <sys/types.h>
+//#include <sys/stat.h>
+//#include <unistd.h>
+//#include <string.h>
+//#include <stdio.h>
-#include <gdk/gdkkeysyms.h>
+//#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
-#define GLADE_HOOKUP_OBJECT(component,widget,name) \
- g_object_set_data_full (G_OBJECT (component), name, \
- gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
-
-#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
- g_object_set_data (G_OBJECT (component), name, widget)
-
-GtkWidget*
-create_window (Dibujo* dibujo)
-{
- GtkWidget *window;
+TP5Window::TP5Window(void) {
GtkWidget *vbox;
GtkWidget *hbox_botones;
GtkWidget *frame_dibujo;
- GtkWidget *drawingarea;
GtkWidget *label_dibujo;
GtkWidget *vbuttonbox_botones;
- GtkWidget *button_limpiar;
- GtkWidget *button_actualizar;
- GtkWidget *button_salir;
GtkWidget *hbox;
GtkWidget *frame_figura;
GtkWidget *vbox_figura;
- GtkWidget *radiobutton_linea;
- GSList *radiobutton_linea_group = NULL;
- GtkWidget *radiobutton_cuadrado;
- GtkWidget *radiobutton_rectangulo;
- GtkWidget *radiobutton_circulo;
+ GSList *radiobutton_group = NULL;
GtkWidget *label_figura;
GtkWidget *vbox_comun;
GtkWidget *table_comun;
GtkWidget *label_nombre;
GtkWidget *label_color;
GtkWidget *label_grosor;
- GtkWidget *entry_nombre;
- GtkWidget *combo_color;
- GList *combo_color_items = NULL;
+ GList *combo_color_items = NULL;
GtkWidget *combo_entry;
GtkObject *spinbutton_grosor_adj;
- GtkWidget *spinbutton_grosor;
- GtkWidget *button_agregar;
GtkWidget *vbox_otros;
GtkWidget *table_puntos;
GtkWidget *label_centro;
GtkWidget *label_x;
GtkWidget *label_y;
GtkObject *spinbutton_centro_x_adj;
- GtkWidget *spinbutton_centro_x;
GtkObject *spinbutton_centro_y_adj;
- GtkWidget *spinbutton_centro_y;
GtkObject *spinbutton_inicio_x_adj;
- GtkWidget *spinbutton_inicio_x;
GtkObject *spinbutton_inicio_y_adj;
- GtkWidget *spinbutton_inicio_y;
GtkObject *spinbutton_fin_x_adj;
- GtkWidget *spinbutton_fin_x;
GtkObject *spinbutton_fin_y_adj;
- GtkWidget *spinbutton_fin_y;
GtkWidget *table_otros;
GtkWidget *label_alto;
GtkWidget *label_ancho;
GtkWidget *label_radio;
GtkObject *spinbutton_alto_adj;
- GtkWidget *spinbutton_alto;
GtkObject *spinbutton_ancho_adj;
- GtkWidget *spinbutton_ancho;
GtkObject *spinbutton_radio_adj;
- GtkWidget *spinbutton_radio;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
- gtk_window_set_title (GTK_WINDOW (window), "Trabajo Práctico V");
+ gtk_window_set_title (GTK_WINDOW (window), "Trabajo PrÃ\83¡ctico V");
vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox);
gtk_container_add (GTK_CONTAINER (window), vbox);
hbox_botones = gtk_hbox_new (FALSE, 5);
- gtk_widget_show (hbox_botones);
gtk_box_pack_start (GTK_BOX (vbox), hbox_botones, TRUE, TRUE, 0);
frame_dibujo = gtk_frame_new (NULL);
- gtk_widget_show (frame_dibujo);
gtk_box_pack_start (GTK_BOX (hbox_botones), frame_dibujo, TRUE, TRUE, 0);
drawingarea = gtk_drawing_area_new ();
- gtk_widget_show (drawingarea);
gtk_container_add (GTK_CONTAINER (frame_dibujo), drawingarea);
gtk_widget_set_size_request (drawingarea, 200, 200);
label_dibujo = gtk_label_new ("Dibujo");
- gtk_widget_show (label_dibujo);
gtk_frame_set_label_widget (GTK_FRAME (frame_dibujo), label_dibujo);
gtk_label_set_justify (GTK_LABEL (label_dibujo), GTK_JUSTIFY_LEFT);
vbuttonbox_botones = gtk_vbutton_box_new ();
- gtk_widget_show (vbuttonbox_botones);
gtk_box_pack_start (GTK_BOX (hbox_botones), vbuttonbox_botones, FALSE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbuttonbox_botones), 5);
gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox_botones), GTK_BUTTONBOX_SPREAD);
button_limpiar = gtk_button_new_from_stock ("gtk-clear");
- gtk_widget_show (button_limpiar);
gtk_container_add (GTK_CONTAINER (vbuttonbox_botones), button_limpiar);
GTK_WIDGET_SET_FLAGS (button_limpiar, GTK_CAN_DEFAULT);
button_actualizar = gtk_button_new_from_stock ("gtk-refresh");
- gtk_widget_show (button_actualizar);
gtk_container_add (GTK_CONTAINER (vbuttonbox_botones), button_actualizar);
GTK_WIDGET_SET_FLAGS (button_actualizar, GTK_CAN_DEFAULT);
button_salir = gtk_button_new_from_stock ("gtk-quit");
- gtk_widget_show (button_salir);
gtk_container_add (GTK_CONTAINER (vbuttonbox_botones), button_salir);
GTK_WIDGET_SET_FLAGS (button_salir, GTK_CAN_DEFAULT);
hbox = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
frame_figura = gtk_frame_new (NULL);
- gtk_widget_show (frame_figura);
gtk_box_pack_start (GTK_BOX (hbox), frame_figura, FALSE, FALSE, 0);
vbox_figura = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox_figura);
gtk_container_add (GTK_CONTAINER (frame_figura), vbox_figura);
- radiobutton_linea = gtk_radio_button_new_with_mnemonic (NULL, "Línea");
- gtk_widget_show (radiobutton_linea);
+ radiobutton_linea = gtk_radio_button_new_with_mnemonic (NULL, "LÃnea");
gtk_box_pack_start (GTK_BOX (vbox_figura), radiobutton_linea, FALSE, FALSE, 0);
- gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_linea), radiobutton_linea_group);
- radiobutton_linea_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_linea));
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_linea), radiobutton_group);
+ radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_linea));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_linea), TRUE);
radiobutton_cuadrado = gtk_radio_button_new_with_mnemonic (NULL, "_Cuadrado");
- gtk_widget_show (radiobutton_cuadrado);
gtk_box_pack_start (GTK_BOX (vbox_figura), radiobutton_cuadrado, FALSE, FALSE, 0);
- gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_cuadrado), radiobutton_linea_group);
- radiobutton_linea_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_cuadrado));
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_cuadrado), radiobutton_group);
+ radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_cuadrado));
- radiobutton_rectangulo = gtk_radio_button_new_with_mnemonic (NULL, "_Rectángulo");
- gtk_widget_show (radiobutton_rectangulo);
+ radiobutton_rectangulo = gtk_radio_button_new_with_mnemonic (NULL, "_Rectángulo");
gtk_box_pack_start (GTK_BOX (vbox_figura), radiobutton_rectangulo, FALSE, FALSE, 0);
- gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_rectangulo), radiobutton_linea_group);
- radiobutton_linea_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_rectangulo));
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_rectangulo), radiobutton_group);
+ radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_rectangulo));
- radiobutton_circulo = gtk_radio_button_new_with_mnemonic (NULL, "Círc_ulo");
- gtk_widget_show (radiobutton_circulo);
+ radiobutton_circulo = gtk_radio_button_new_with_mnemonic (NULL, "CÃrc_ulo");
gtk_box_pack_start (GTK_BOX (vbox_figura), radiobutton_circulo, FALSE, FALSE, 0);
- gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_circulo), radiobutton_linea_group);
- radiobutton_linea_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_circulo));
+ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton_circulo), radiobutton_group);
+ radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radiobutton_circulo));
label_figura = gtk_label_new ("Figura");
- gtk_widget_show (label_figura);
gtk_frame_set_label_widget (GTK_FRAME (frame_figura), label_figura);
gtk_label_set_justify (GTK_LABEL (label_figura), GTK_JUSTIFY_LEFT);
vbox_comun = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox_comun);
gtk_box_pack_start (GTK_BOX (hbox), vbox_comun, TRUE, TRUE, 0);
table_comun = gtk_table_new (3, 2, FALSE);
- gtk_widget_show (table_comun);
gtk_box_pack_start (GTK_BOX (vbox_comun), table_comun, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (table_comun), 5);
gtk_table_set_row_spacings (GTK_TABLE (table_comun), 3);
gtk_table_set_col_spacings (GTK_TABLE (table_comun), 5);
label_nombre = gtk_label_new ("Nombre");
- gtk_widget_show (label_nombre);
gtk_table_attach (GTK_TABLE (table_comun), label_nombre, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_nombre), 0, 0.5);
label_color = gtk_label_new ("Color");
- gtk_widget_show (label_color);
gtk_table_attach (GTK_TABLE (table_comun), label_color, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_color), 0, 0.5);
label_grosor = gtk_label_new ("Grosor");
- gtk_widget_show (label_grosor);
gtk_table_attach (GTK_TABLE (table_comun), label_grosor, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_grosor), 0, 0.5);
entry_nombre = gtk_entry_new ();
- gtk_widget_show (entry_nombre);
gtk_table_attach (GTK_TABLE (table_comun), entry_nombre, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
combo_color = gtk_combo_new ();
g_object_set_data (G_OBJECT (GTK_COMBO (combo_color)->popwin),
"GladeParentKey", combo_color);
- gtk_widget_show (combo_color);
gtk_table_attach (GTK_TABLE (table_comun), combo_color, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
g_list_free (combo_color_items);
combo_entry = GTK_COMBO (combo_color)->entry;
- gtk_widget_show (combo_entry);
gtk_editable_set_editable (GTK_EDITABLE (combo_entry), FALSE);
gtk_entry_set_text (GTK_ENTRY (combo_entry), "Negro");
spinbutton_grosor_adj = gtk_adjustment_new (1, 1, 10, 1, 10, 10);
spinbutton_grosor = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_grosor_adj), 1, 0);
- gtk_widget_show (spinbutton_grosor);
gtk_table_attach (GTK_TABLE (table_comun), spinbutton_grosor, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
gtk_widget_set_size_request (spinbutton_grosor, 48, -1);
button_agregar = gtk_button_new_from_stock ("gtk-add");
- gtk_widget_show (button_agregar);
gtk_box_pack_start (GTK_BOX (vbox_comun), button_agregar, FALSE, FALSE, 0);
vbox_otros = gtk_vbox_new (FALSE, 5);
- gtk_widget_show (vbox_otros);
gtk_box_pack_start (GTK_BOX (hbox), vbox_otros, FALSE, FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox_otros), 5);
table_puntos = gtk_table_new (4, 3, FALSE);
- gtk_widget_show (table_puntos);
gtk_box_pack_start (GTK_BOX (vbox_otros), table_puntos, FALSE, FALSE, 0);
gtk_table_set_col_spacings (GTK_TABLE (table_puntos), 2);
label_centro = gtk_label_new ("Centro");
- gtk_widget_show (label_centro);
gtk_table_attach (GTK_TABLE (table_puntos), label_centro, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_centro), 0, 0.5);
label_inicio = gtk_label_new ("Inicio");
- gtk_widget_show (label_inicio);
gtk_table_attach (GTK_TABLE (table_puntos), label_inicio, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_inicio), 0, 0.5);
label_fin = gtk_label_new ("Fin");
- gtk_widget_show (label_fin);
gtk_table_attach (GTK_TABLE (table_puntos), label_fin, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_fin), 0, 0.5);
label_puntos = gtk_label_new ("");
- gtk_widget_show (label_puntos);
gtk_table_attach (GTK_TABLE (table_puntos), label_puntos, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_puntos), 0, 0.5);
label_x = gtk_label_new ("X");
- gtk_widget_show (label_x);
gtk_table_attach (GTK_TABLE (table_puntos), label_x, 1, 2, 0, 1,
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_x), 0, 0.5);
label_y = gtk_label_new ("Y");
- gtk_widget_show (label_y);
gtk_table_attach (GTK_TABLE (table_puntos), label_y, 2, 3, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (0), 0, 0);
spinbutton_centro_x_adj = gtk_adjustment_new (0, 0, 1000, 1, 10, 10);
spinbutton_centro_x = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_centro_x_adj), 1, 0);
- gtk_widget_show (spinbutton_centro_x);
gtk_table_attach (GTK_TABLE (table_puntos), spinbutton_centro_x, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_centro_y_adj = gtk_adjustment_new (0, 0, 1000, 1, 10, 10);
spinbutton_centro_y = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_centro_y_adj), 1, 0);
- gtk_widget_show (spinbutton_centro_y);
gtk_table_attach (GTK_TABLE (table_puntos), spinbutton_centro_y, 2, 3, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_inicio_x_adj = gtk_adjustment_new (0, 0, 1000, 1, 10, 10);
spinbutton_inicio_x = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_inicio_x_adj), 1, 0);
- gtk_widget_show (spinbutton_inicio_x);
gtk_table_attach (GTK_TABLE (table_puntos), spinbutton_inicio_x, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_inicio_y_adj = gtk_adjustment_new (0, 0, 1000, 1, 10, 10);
spinbutton_inicio_y = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_inicio_y_adj), 1, 0);
- gtk_widget_show (spinbutton_inicio_y);
gtk_table_attach (GTK_TABLE (table_puntos), spinbutton_inicio_y, 2, 3, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_fin_x_adj = gtk_adjustment_new (0, 0, 1000, 1, 10, 10);
spinbutton_fin_x = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_fin_x_adj), 1, 0);
- gtk_widget_show (spinbutton_fin_x);
gtk_table_attach (GTK_TABLE (table_puntos), spinbutton_fin_x, 1, 2, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_fin_y_adj = gtk_adjustment_new (0, 0, 1000, 1, 10, 10);
spinbutton_fin_y = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_fin_y_adj), 1, 0);
- gtk_widget_show (spinbutton_fin_y);
gtk_table_attach (GTK_TABLE (table_puntos), spinbutton_fin_y, 2, 3, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
table_otros = gtk_table_new (3, 2, FALSE);
- gtk_widget_show (table_otros);
gtk_box_pack_start (GTK_BOX (vbox_otros), table_otros, FALSE, FALSE, 0);
gtk_table_set_col_spacings (GTK_TABLE (table_otros), 2);
label_alto = gtk_label_new ("Alto");
- gtk_widget_show (label_alto);
gtk_table_attach (GTK_TABLE (table_otros), label_alto, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_alto), 0, 0.5);
label_ancho = gtk_label_new ("Ancho");
- gtk_widget_show (label_ancho);
gtk_table_attach (GTK_TABLE (table_otros), label_ancho, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_ancho), 0, 0.5);
label_radio = gtk_label_new ("Radio");
- gtk_widget_show (label_radio);
gtk_table_attach (GTK_TABLE (table_otros), label_radio, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_alto_adj = gtk_adjustment_new (1, 1, 1000, 1, 10, 10);
spinbutton_alto = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_alto_adj), 1, 0);
- gtk_widget_show (spinbutton_alto);
gtk_table_attach (GTK_TABLE (table_otros), spinbutton_alto, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_ancho_adj = gtk_adjustment_new (1, 1, 1000, 1, 10, 10);
spinbutton_ancho = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_ancho_adj), 1, 0);
- gtk_widget_show (spinbutton_ancho);
gtk_table_attach (GTK_TABLE (table_otros), spinbutton_ancho, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
spinbutton_radio_adj = gtk_adjustment_new (1, 1, 1000, 1, 10, 10);
spinbutton_radio = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_radio_adj), 1, 0);
- gtk_widget_show (spinbutton_radio);
gtk_table_attach (GTK_TABLE (table_otros), spinbutton_radio, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
NULL);
g_signal_connect((gpointer) button_agregar, "clicked",
G_CALLBACK (on_button_agregar_clicked),
- dibujo);
+ this);
g_signal_connect((gpointer) radiobutton_linea, "toggled",
G_CALLBACK (on_radiobutton_linea_toggled),
- NULL);
+ this);
g_signal_connect((gpointer) radiobutton_cuadrado, "toggled",
G_CALLBACK (on_radiobutton_cuadrado_toggled),
- NULL);
+ this);
g_signal_connect((gpointer) radiobutton_rectangulo, "toggled",
G_CALLBACK (on_radiobutton_rectangulo_toggled),
- NULL);
+ this);
g_signal_connect((gpointer) radiobutton_circulo, "toggled",
G_CALLBACK (on_radiobutton_circulo_toggled),
- NULL);
+ this);
- /* Store pointers to all widgets, for use by lookup_widget(). */
- GLADE_HOOKUP_OBJECT_NO_REF (window, window, "window");
- GLADE_HOOKUP_OBJECT (window, vbox, "vbox");
- GLADE_HOOKUP_OBJECT (window, hbox_botones, "hbox_botones");
- GLADE_HOOKUP_OBJECT (window, frame_dibujo, "frame_dibujo");
- GLADE_HOOKUP_OBJECT (window, drawingarea, "drawingarea");
- GLADE_HOOKUP_OBJECT (window, label_dibujo, "label_dibujo");
- GLADE_HOOKUP_OBJECT (window, vbuttonbox_botones, "vbuttonbox_botones");
- GLADE_HOOKUP_OBJECT (window, button_limpiar, "button_limpiar");
- GLADE_HOOKUP_OBJECT (window, button_actualizar, "button_actualizar");
- GLADE_HOOKUP_OBJECT (window, button_salir, "button_salir");
- GLADE_HOOKUP_OBJECT (window, hbox, "hbox");
- GLADE_HOOKUP_OBJECT (window, frame_figura, "frame_figura");
- GLADE_HOOKUP_OBJECT (window, vbox_figura, "vbox_figura");
- GLADE_HOOKUP_OBJECT (window, radiobutton_linea, "radiobutton_linea");
- GLADE_HOOKUP_OBJECT (window, radiobutton_cuadrado, "radiobutton_cuadrado");
- GLADE_HOOKUP_OBJECT (window, radiobutton_rectangulo, "radiobutton_rectangulo");
- GLADE_HOOKUP_OBJECT (window, radiobutton_circulo, "radiobutton_circulo");
- GLADE_HOOKUP_OBJECT (window, label_figura, "label_figura");
- GLADE_HOOKUP_OBJECT (window, vbox_comun, "vbox_comun");
- GLADE_HOOKUP_OBJECT (window, table_comun, "table_comun");
- GLADE_HOOKUP_OBJECT (window, label_nombre, "label_nombre");
- GLADE_HOOKUP_OBJECT (window, label_color, "label_color");
- GLADE_HOOKUP_OBJECT (window, label_grosor, "label_grosor");
- GLADE_HOOKUP_OBJECT (window, entry_nombre, "entry_nombre");
- GLADE_HOOKUP_OBJECT (window, combo_color, "combo_color");
- GLADE_HOOKUP_OBJECT (window, combo_entry, "combo_entry");
- GLADE_HOOKUP_OBJECT (window, spinbutton_grosor, "spinbutton_grosor");
- GLADE_HOOKUP_OBJECT (window, button_agregar, "button_agregar");
- GLADE_HOOKUP_OBJECT (window, vbox_otros, "vbox_otros");
- GLADE_HOOKUP_OBJECT (window, table_puntos, "table_puntos");
- GLADE_HOOKUP_OBJECT (window, label_centro, "label_centro");
- GLADE_HOOKUP_OBJECT (window, label_inicio, "label_inicio");
- GLADE_HOOKUP_OBJECT (window, label_fin, "label_fin");
- GLADE_HOOKUP_OBJECT (window, label_puntos, "label_puntos");
- GLADE_HOOKUP_OBJECT (window, label_x, "label_x");
- GLADE_HOOKUP_OBJECT (window, label_y, "label_y");
- GLADE_HOOKUP_OBJECT (window, spinbutton_centro_x, "spinbutton_centro_x");
- GLADE_HOOKUP_OBJECT (window, spinbutton_centro_y, "spinbutton_centro_y");
- GLADE_HOOKUP_OBJECT (window, spinbutton_inicio_x, "spinbutton_inicio_x");
- GLADE_HOOKUP_OBJECT (window, spinbutton_inicio_y, "spinbutton_inicio_y");
- GLADE_HOOKUP_OBJECT (window, spinbutton_fin_x, "spinbutton_fin_x");
- GLADE_HOOKUP_OBJECT (window, spinbutton_fin_y, "spinbutton_fin_y");
- GLADE_HOOKUP_OBJECT (window, table_otros, "table_otros");
- GLADE_HOOKUP_OBJECT (window, label_alto, "label_alto");
- GLADE_HOOKUP_OBJECT (window, label_ancho, "label_ancho");
- GLADE_HOOKUP_OBJECT (window, label_radio, "label_radio");
- GLADE_HOOKUP_OBJECT (window, spinbutton_alto, "spinbutton_alto");
- GLADE_HOOKUP_OBJECT (window, spinbutton_ancho, "spinbutton_ancho");
- GLADE_HOOKUP_OBJECT (window, spinbutton_radio, "spinbutton_radio");
-
- return window;
+ // Muestro la ventana principal y todos sus componentes.
+ gtk_widget_show_all(window);
}
+TP5Window::~TP5Window(void) {
+ dibujo.borrar_todo();
+}