void ok_cb (GtkWidget *w, void *v) { gboolean edit=TRUE; GtkWidget *widget; GtkType type; GSList *current = widgets; while (current) { edit=TRUE; widget = (GtkWidget *)current->data; current = current->next; type = GTK_OBJECT_TYPE(widget); if (type == gtk_entry_get_type()) output_entry(widget); if (type == gtk_text_get_type()) output_text(widget,&edit); if (type == gtk_combo_get_type()) output_combo(widget); if (type == gtk_check_button_get_type()) output_check_button(widget); if (type == gtk_option_menu_get_type()) output_option_menu(widget); /* if there are more widgets with output values, separate them */ if (current && edit) { putchar ('\v'); } } quit(RETURN_OK); }
/* * Initializes the GbWidget structure. * I've placed this at the end of the file so we don't have to include * declarations of all the functions. */ GbWidget * gb_option_menu_init () { /* Initialise the GTK type */ volatile GtkType type; type = gtk_option_menu_get_type (); /* Initialize the GbWidget structure */ gb_widget_init_struct (&gbwidget); /* Fill in the pixmap struct & tooltip */ gbwidget.pixmap_struct = optionmenu_xpm; gbwidget.tooltip = _("Option Menu"); /* Fill in any functions that this GbWidget has */ gbwidget.gb_widget_new = gb_option_menu_new; gbwidget.gb_widget_create_properties = gb_option_menu_create_properties; gbwidget.gb_widget_get_properties = gb_option_menu_get_properties; gbwidget.gb_widget_set_properties = gb_option_menu_set_properties; gbwidget.gb_widget_add_child = gb_option_menu_add_child; gbwidget.gb_widget_write_source = gb_option_menu_write_source; gbwidget.gb_widget_write_add_child_source = gb_option_menu_write_add_child_source; /* gbwidget.gb_widget_create_popup_menu = gb_option_menu_create_popup_menu; */ return &gbwidget; }
if (gum->format) g_free (gum->format); if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } static void gimp_unit_menu_class_init (GimpUnitMenuClass *class) { GtkObjectClass *object_class; object_class = (GtkObjectClass*) class; parent_class = gtk_type_class (gtk_option_menu_get_type ()); gimp_unit_menu_signals[UNIT_CHANGED] = gtk_signal_new ("unit_changed", GTK_RUN_FIRST, GTK_OBJECT_TYPE( object_class ), GTK_SIGNAL_OFFSET (GimpUnitMenuClass, unit_changed), gtk_signal_default_marshaller, GTK_TYPE_NONE, 0); #if GTK_MAJOR_VERSION < 2 gtk_object_class_add_signals (object_class, gimp_unit_menu_signals, LAST_SIGNAL); #endif class->unit_changed = NULL;