Exemple #1
0
static void combo_changed(GtkComboBox *combo)
{
     if (!updating_flag)
	  gtk_signal_emit(GTK_OBJECT(combo),combo_signals[CHANGED_SIGNAL]);
     if (GTK_COMBO_BOX_CLASS(parent_class)->changed)
	  GTK_COMBO_BOX_CLASS(parent_class)->changed(combo);
}
static void
gweather_timezone_menu_class_init (GWeatherTimezoneMenuClass *timezone_menu_class)
{
    GObjectClass *object_class = G_OBJECT_CLASS (timezone_menu_class);
    GtkComboBoxClass *combo_class = GTK_COMBO_BOX_CLASS (timezone_menu_class);

    object_class->finalize = finalize;
    object_class->set_property = set_property;
    object_class->get_property = get_property;

    combo_class->changed = changed;

    /* properties */
    g_object_class_install_property (
	object_class, PROP_TOP,
	g_param_spec_boxed ("top",
			    "Top Location",
			    "The GWeatherLocation whose children will be used to fill in the menu",
			    GWEATHER_TYPE_LOCATION,
			    G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
    g_object_class_install_property (
	object_class, PROP_TZID,
	g_param_spec_string ("tzid",
			     "TZID",
			     "The selected TZID",
			     NULL,
			     G_PARAM_READWRITE));
}
static void
gimp_container_combo_box_changed (GtkComboBox       *combo_box,
                                  GimpContainerView *view)
{
  GtkTreeIter iter;

  if (GTK_COMBO_BOX_CLASS (parent_class)->changed)
    GTK_COMBO_BOX_CLASS (parent_class)->changed (combo_box);

  if (gtk_combo_box_get_active_iter (combo_box, &iter))
    {
      GimpViewRenderer *renderer;

      gtk_tree_model_get (gtk_combo_box_get_model (combo_box), &iter,
                          COLUMN_RENDERER, &renderer,
                          -1);

      gimp_container_view_item_selected (view, renderer->viewable);
      g_object_unref (renderer);
    }
}
Exemple #4
0
static void
charset_combo_box_changed (GtkComboBox *combo_box)
{
	ECharsetComboBoxPrivate *priv;

	priv = E_CHARSET_COMBO_BOX_GET_PRIVATE (combo_box);

	/* Chain up to parent's changed() method. */
	GTK_COMBO_BOX_CLASS (parent_class)->changed (combo_box);

	/* Notify -before- updating previous index. */
	g_object_notify (G_OBJECT (combo_box), "charset");
	priv->previous_index = gtk_combo_box_get_active (combo_box);
}
Exemple #5
0
static void combo_class_init(GtkObjectClass *klass)
{
     parent_class = gtk_type_class(COMBO_PARENT_TYPE_FUNC());
     klass->destroy = combo_destroy;
     GTK_COMBO_BOX_CLASS(klass)->changed = combo_changed;
     COMBO_CLASS(klass)->selection_changed = NULL;
     GTK_WIDGET_CLASS(klass)->size_request = combo_size_request;
     combo_signals[CHANGED_SIGNAL] = 
	  gtk_signal_new("selection_changed",GTK_RUN_LAST,
			 GTK_CLASS_TYPE(klass),
			 GTK_SIGNAL_OFFSET(ComboClass,selection_changed),
			 gtk_marshal_NONE__NONE,GTK_TYPE_NONE,0);
     gtk_object_class_add_signals(klass,combo_signals,LAST_SIGNAL);     
}
static void
brasero_medium_selection_class_init (BraseroMediumSelectionClass *klass)
{
    GObjectClass *object_class = G_OBJECT_CLASS (klass);
    GtkComboBoxClass *combo_class = GTK_COMBO_BOX_CLASS (klass);

    g_type_class_add_private (klass, sizeof (BraseroMediumSelectionPrivate));

    object_class->constructed = brasero_medium_selection_constructed;
    object_class->finalize = brasero_medium_selection_finalize;
    object_class->set_property = brasero_medium_selection_set_property;
    object_class->get_property = brasero_medium_selection_get_property;

    combo_class->changed = brasero_medium_selection_changed;

    g_object_class_install_property (object_class, PROP_MEDIUM,
                                     g_param_spec_object ("medium",
                                             "Selected medium",
                                             "The currently selected medium",
                                             BRASERO_TYPE_MEDIUM, G_PARAM_READWRITE));

    g_object_class_install_property (object_class, PROP_MEDIA_TYPE,
                                     g_param_spec_uint ("media-type",
                                             "The type of media",
                                             "The type of media displayed",
                                             0, BRASERO_MEDIA_TYPE_ALL,
                                             BRASERO_MEDIA_TYPE_NONE,
                                             G_PARAM_READWRITE));
    /**
    * BraseroMediumSelection::medium-changed:
    * @monitor: the object which received the signal
    * @medium: the new selected medium
    *
    * This signal gets emitted when the selected medium has changed.
    **/
    brasero_medium_selection_signals [CHANGED_SIGNAL] =
        g_signal_new ("medium_changed",
                      BRASERO_TYPE_MEDIUM_SELECTION,
                      G_SIGNAL_RUN_FIRST|G_SIGNAL_ACTION|G_SIGNAL_NO_RECURSE,
                      G_STRUCT_OFFSET (BraseroMediumSelectionClass, medium_changed),
                      NULL,
                      NULL,
                      g_cclosure_marshal_VOID__OBJECT,
                      G_TYPE_NONE,
                      1,
                      BRASERO_TYPE_MEDIUM);
}
static void
gimp_color_profile_combo_box_class_init (GimpColorProfileComboBoxClass *klass)
{
  GObjectClass     *object_class = G_OBJECT_CLASS (klass);
  GtkComboBoxClass *combo_class  = GTK_COMBO_BOX_CLASS (klass);

  object_class->set_property = gimp_color_profile_combo_box_set_property;
  object_class->get_property = gimp_color_profile_combo_box_get_property;
  object_class->finalize     = gimp_color_profile_combo_box_finalize;

  combo_class->changed       = gimp_color_profile_combo_box_changed;

  /**
   * GimpColorProfileComboBox:dialog:
   *
   * #GtkDialog to present when the user selects the
   * "Select color profile from disk..." item.
   *
   * Since: GIMP 2.4
   */
  g_object_class_install_property (object_class,
                                   PROP_DIALOG,
                                   g_param_spec_object ("dialog", NULL, NULL,
                                                        GTK_TYPE_DIALOG,
                                                        G_PARAM_CONSTRUCT_ONLY |
                                                        GIMP_PARAM_READWRITE));
  /**
   * GimpColorProfileComboBox:model:
   *
   * Overrides the "model" property of the #GtkComboBox class.
   * #GimpColorProfileComboBox requires the model to be a
   * #GimpColorProfileStore.
   *
   * Since: GIMP 2.4
   */
  g_object_class_install_property (object_class,
                                   PROP_MODEL,
                                   g_param_spec_object ("model", NULL, NULL,
                                                        GIMP_TYPE_COLOR_PROFILE_STORE,
                                                        GIMP_PARAM_READWRITE));

  g_type_class_add_private (object_class,
                            sizeof (GimpColorProfileComboBoxPrivate));
}
static void
gtk_app_chooser_button_class_init (GtkAppChooserButtonClass *klass)
{
  GObjectClass *oclass = G_OBJECT_CLASS (klass);
  GtkComboBoxClass *combo_class = GTK_COMBO_BOX_CLASS (klass);
  GParamSpec *pspec;

  oclass->set_property = gtk_app_chooser_button_set_property;
  oclass->get_property = gtk_app_chooser_button_get_property;
  oclass->finalize = gtk_app_chooser_button_finalize;
  oclass->constructed = gtk_app_chooser_button_constructed;

  combo_class->changed = gtk_app_chooser_button_changed;

  g_object_class_override_property (oclass, PROP_CONTENT_TYPE, "content-type");

  /**
   * GtkAppChooserButton:show-dialog-item:
   *
   * The #GtkAppChooserButton:show-dialog-item property determines whether the dropdown menu
   * should show an item that triggers a #GtkAppChooserDialog when clicked.
   */
  pspec =
    g_param_spec_boolean ("show-dialog-item",
                          P_("Include an 'Other...' item"),
                          P_("Whether the combobox should include an item that triggers a GtkAppChooserDialog"),
                          FALSE,
                          G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (oclass, PROP_SHOW_DIALOG_ITEM, pspec);

  /**
   * GtkAppChooserButton:heading:
   *
   * The text to show at the top of the dialog that can be
   * opened from the button. The string may contain Pango markup.
   */
  pspec = g_param_spec_string ("heading",
                               P_("Heading"),
                               P_("The text to show at the top of the dialog"),
                               NULL,
                               G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
  g_object_class_install_property (oclass, PROP_HEADING, pspec);


  /**
   * GtkAppChooserButton::custom-item-activated:
   * @self: the object which received the signal
   * @item_name: the name of the activated item
   *
   * Emitted when a custom item, previously added with
   * gtk_app_chooser_button_append_custom_item(), is activated from the
   * dropdown menu.
   */
  signals[SIGNAL_CUSTOM_ITEM_ACTIVATED] =
    g_signal_new ("custom-item-activated",
                  GTK_TYPE_APP_CHOOSER_BUTTON,
                  G_SIGNAL_RUN_FIRST | G_SIGNAL_DETAILED,
                  G_STRUCT_OFFSET (GtkAppChooserButtonClass, custom_item_activated),
                  NULL, NULL,
                  _gtk_marshal_VOID__STRING,
                  G_TYPE_NONE,
                  1, G_TYPE_STRING);

  g_type_class_add_private (klass, sizeof (GtkAppChooserButtonPrivate));
}