From 0963419d89f1711cfbf964b75133121a74e90a9e Mon Sep 17 00:00:00 2001 From: Jody Goldberg Date: Thu, 7 Sep 2000 14:56:59 +0000 Subject: Merge in the colour combo emhancements. 2000-09-06 Jody Goldberg * color-group.c (color_group_new_named) : strdup the name if it is supplied by the user. (color_group_class_init) : Use the destroy method. 2000-09-03 Michael Levy * color-group.c : Re-write of color-combo-group.c to allow for arbitrary widgets to share a common color history. * widget-color-combo.c : Extracted all the code required to make the color table and moved it to a new object (ColorPalette). Changed the ColorCombo so that it uses the ColorPalette (and the shared color hsitory provided by the groupped ColorPalettes). All the code that refered to the creation of the color table was removed, and when appropriate, moved to color-palette.c Removed all mention of ColorComboGroups (as these no longer exist). * color-palette.c : Extracted from widget-color-combo.c (color_palette_new) : Creates a color palette. (color_palette_get_current_color) : returns the current color. 2000-07-30 Michael Levy * color-combo-group.c : New GtkObject meant to group color combo boxes so that their custom color histories are shared. Includes functions to create and destroy the object, as well as those required size, and navigate through the custom color history. * widget-color-combo.c (group_new_custom_color) : New function to handle the new_custom_color signal emitted by the ColorComboGroup (custom_color_history_setup) : New function which initialises a combo box's custom color history with the one stored in the group (color_table_setup) : Added call to custom_color_history_setup. (cust_color_set) : Removed call to cust_color_row_shift and moved it to group_new_custom_color. Also added call to color_combo_group_add_color in order to notify group of change (color_combo_new_with_vals) : Added mandatory group name to function prototype. Also added call to color_combo_group_new_named and connected the "new_custom_color" signal emitted by the newly created group to group_new_custom_color (color_combo_new) : Added mandatory group name to function prototype. * widget-color-combo.c (color_combo_new) : Added mandatory group name to function prototype. svn path=/trunk/; revision=5229 --- widgets/misc/test-color.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 widgets/misc/test-color.c (limited to 'widgets/misc') diff --git a/widgets/misc/test-color.c b/widgets/misc/test-color.c new file mode 100644 index 0000000000..0b01682d8f --- /dev/null +++ b/widgets/misc/test-color.c @@ -0,0 +1,46 @@ +#include +#include "color.h" +#include "pixmaps/font.xpm" +#include "widget-color-combo.h" +#include "color-palette.h" +/* To compile (from src/widgets): + +gcc -I.. -I../.. -L. -Wall -o tester tester.c ../color.c `gnome-config --cflags --libs gnome gnomeui` -lwidgets + +*/ + + +gint +main ( gint argc, gchar* argv[] ) +{ + GtkWidget * dialog; + GtkWidget * T; + + gnome_init ("tester", "1.0", argc, argv); + + dialog = gnome_dialog_new ("TESTER", GNOME_STOCK_BUTTON_OK, + GNOME_STOCK_BUTTON_CANCEL, NULL); + T = color_palette_new("Color Palette", NULL, "for_colorgroup"); + + gtk_box_pack_start(GTK_BOX (GNOME_DIALOG (dialog)-> vbox ), + T, TRUE, TRUE, 5); + gtk_widget_show_all (T); + + T = color_combo_new (font_xpm, _("Automatic"), + &gs_black, + "for_colorgroup"); + gtk_box_pack_start(GTK_BOX (GNOME_DIALOG (dialog)-> vbox ), + T, TRUE, TRUE, 5); + gtk_widget_show_all (T); + + T = color_combo_new (font_xpm, _("Automatic"), + &gs_black, + "back_colorgroup"); + gtk_box_pack_start(GTK_BOX (GNOME_DIALOG (dialog)-> vbox ), + T, TRUE, TRUE, 5); + gtk_widget_show_all (T); + + gnome_dialog_run_and_close ( GNOME_DIALOG (dialog) ); + return 0; +} + -- cgit v1.2.3