Exemple #1
0
/**
 * gtk_recent_action_get_show_numbers:
 * @action: a #GtkRecentAction
 *
 * Returns the value set by gtk_recent_chooser_menu_set_show_numbers().
 *
 * Returns: %TRUE if numbers should be shown.
 *
 * Since: 2.12
 *
 * Deprecated: 3.10
 */
gboolean
gtk_recent_action_get_show_numbers (GtkRecentAction *action)
{
  g_return_val_if_fail (GTK_IS_RECENT_ACTION (action), FALSE);

  return action->priv->show_numbers;
}
Exemple #2
0
/**
 * gtk_recent_action_set_show_numbers:
 * @action: a #GtkRecentAction
 * @show_numbers: %TRUE if the shown items should be numbered
 *
 * Sets whether a number should be added to the items shown by the
 * widgets representing @action. The numbers are shown to provide
 * a unique character for a mnemonic to be used inside the menu item's
 * label. Only the first ten items get a number to avoid clashes.
 *
 * Since: 2.12
 *
 * Deprecated: 3.10
 */
void
gtk_recent_action_set_show_numbers (GtkRecentAction *action,
                                    gboolean         show_numbers)
{
  GtkRecentActionPrivate *priv;

  g_return_if_fail (GTK_IS_RECENT_ACTION (action));

  priv = action->priv;

  if (priv->show_numbers != show_numbers)
    {
      g_object_ref (action);

      priv->show_numbers = show_numbers;

      g_object_notify (G_OBJECT (action), "show-numbers");
      g_object_unref (action);
    }
}
static void
glade_recent_chooser_editor_load (GladeEditable *editable,
				  GladeWidget   *gwidget)
{
  GladeRecentChooserEditor *recent_editor = GLADE_RECENT_CHOOSER_EDITOR (editable);
  GladeRecentChooserEditorPrivate *priv = recent_editor->priv;

  /* Chain up to default implementation */
  parent_editable_iface->load (editable, gwidget);

  if (gwidget)
    {
      GObject *object = glade_widget_get_object (gwidget);
      gboolean has_show_numbers = (GTK_IS_RECENT_ACTION (object) || GTK_IS_RECENT_CHOOSER_MENU (object));

      /* Update subclass specific editor visibility */
      gtk_widget_set_visible (priv->select_multiple_editor, !has_show_numbers);
      gtk_widget_set_visible (priv->show_numbers_editor, has_show_numbers);
    }
}