Esempio n. 1
0
gboolean
_gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash,
			     guint            keyval)
{
  GSList *list, *targets;
  GtkWidget *widget, *chosen_widget;
  GdkWindow *window;
  gboolean overloaded;

  targets = g_hash_table_lookup (mnemonic_hash->hash,
				 GUINT_TO_POINTER (keyval));
  if (!targets)
    return FALSE;
  
  overloaded = FALSE;
  chosen_widget = NULL;
  for (list = targets; list; list = list->next)
    {
      widget = GTK_WIDGET (list->data);
      window = gtk_widget_get_window (widget);

      if (gtk_widget_is_sensitive (widget) &&
	  gtk_widget_get_mapped (widget) &&
          window && gdk_window_is_viewable (window))
	{
	  if (chosen_widget)
	    {
	      overloaded = TRUE;
	      break;
	    }
	  else
	    chosen_widget = widget;
	}
    }

  if (chosen_widget)
    {
      /* For round robin we put the activated entry on
       * the end of the list after activation
       */
      targets = g_slist_remove (targets, chosen_widget);
      targets = g_slist_append (targets, chosen_widget);
      g_hash_table_insert (mnemonic_hash->hash,
			   GUINT_TO_POINTER (keyval),
			   targets);

      return gtk_widget_mnemonic_activate (chosen_widget, overloaded);
    }
  return FALSE;
}
Esempio n. 2
0
static VALUE
rg_mnemonic_activate(VALUE self, VALUE group_cycling)
{
    return CBOOL2RVAL(gtk_widget_mnemonic_activate(_SELF(self), RVAL2CBOOL(group_cycling)));
}
static gboolean gebr_sequence_edit_on_mnemonic_activate(GebrGuiSequenceEdit *self)
{
	gtk_widget_mnemonic_activate(self->widget, TRUE);
	return TRUE;
}