ui/gtk/list.c

branch
newapi
changeset 391
fc0df448dfbc
parent 390
b130f80ec7f9
child 392
df62b7205bd3
equal deleted inserted replaced
390:b130f80ec7f9 391:fc0df448dfbc
400 G_CALLBACK(ui_listview_selection_event), 400 G_CALLBACK(ui_listview_selection_event),
401 event); 401 event);
402 } 402 }
403 // TODO: destroy callback 403 // TODO: destroy callback
404 404
405 if(args.contextmenu) { 405
406 UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, view);
407 ui_widget_set_contextmenu(view, menu);
408 }
409
410 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); 406 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view));
411 if(args.multiselection) { 407 if(args.multiselection) {
412 gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); 408 gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
413 } 409 }
414 410
417 gtk_scrolled_window_set_policy( 413 gtk_scrolled_window_set_policy(
418 GTK_SCROLLED_WINDOW(scroll_area), 414 GTK_SCROLLED_WINDOW(scroll_area),
419 GTK_POLICY_AUTOMATIC, 415 GTK_POLICY_AUTOMATIC,
420 GTK_POLICY_AUTOMATIC); // GTK_POLICY_ALWAYS 416 GTK_POLICY_AUTOMATIC); // GTK_POLICY_ALWAYS
421 SCROLLEDWINDOW_SET_CHILD(scroll_area, view); 417 SCROLLEDWINDOW_SET_CHILD(scroll_area, view);
418
419 if(args.contextmenu) {
420 UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, scroll_area);
421 ui_widget_set_contextmenu(scroll_area, menu);
422 }
422 423
423 UI_APPLY_LAYOUT1(current, args); 424 UI_APPLY_LAYOUT1(current, args);
424 current->container->add(current->container, scroll_area, FALSE); 425 current->container->add(current->container, scroll_area, FALSE);
425 426
426 // ct->current should point to view, not scroll_area, to make it possible 427 // ct->current should point to view, not scroll_area, to make it possible

mercurial