Exemplo n.º 1
0
static VEC(long) *get_list_ancestors(long node)
{
  VEC(long) *la;

  if (!visited[node]) {
    la = get_ancestors(&gi, node);
    ancestors[node] = la;
    visited[node] = true;
  } else {
    la = ancestors[node];
  }

  return la;
}
Exemplo n.º 2
0
static void
open_submenu (GtkWidget *button,
              gpointer   data)
{
  GtkMenuTrackerItem *item = data;
  GtkWidget *stack;
  GtkWidget *child;
  GtkWidget *focus;

  if (gtk_menu_tracker_item_get_should_request_show (item))
    gtk_menu_tracker_item_request_submenu_shown (item, TRUE);

  focus = GTK_WIDGET (g_object_get_data (G_OBJECT (button), "focus"));
  get_ancestors (focus, GTK_TYPE_STACK, &stack, &child);
  gtk_stack_set_visible_child (GTK_STACK (stack), child);
  gtk_widget_grab_focus (focus);
}