ui/gtk/list.c

branch
newapi
changeset 390
b130f80ec7f9
parent 380
aad99285865c
child 391
fc0df448dfbc
equal deleted inserted replaced
389:d15eca5fd8b3 390:b130f80ec7f9
35 #include "../common/object.h" 35 #include "../common/object.h"
36 #include "container.h" 36 #include "container.h"
37 37
38 #include "list.h" 38 #include "list.h"
39 #include "icon.h" 39 #include "icon.h"
40 #include "menu.h"
40 41
41 42
42 void* ui_strmodel_getvalue(void *elm, int column) { 43 void* ui_strmodel_getvalue(void *elm, int column) {
43 return column == 0 ? elm : NULL; 44 return column == 0 ? elm : NULL;
44 } 45 }
233 selection, 234 selection,
234 "changed", 235 "changed",
235 G_CALLBACK(ui_listview_selection_event), 236 G_CALLBACK(ui_listview_selection_event),
236 event); 237 event);
237 } 238 }
239 if(args.contextmenu) {
240 UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, view);
241 ui_widget_set_contextmenu(view, menu);
242 }
238 243
239 244
240 // add widget to the current container 245 // add widget to the current container
241 GtkWidget *scroll_area = SCROLLEDWINDOW_NEW(); 246 GtkWidget *scroll_area = SCROLLEDWINDOW_NEW();
242 gtk_scrolled_window_set_policy( 247 gtk_scrolled_window_set_policy(
394 "changed", 399 "changed",
395 G_CALLBACK(ui_listview_selection_event), 400 G_CALLBACK(ui_listview_selection_event),
396 event); 401 event);
397 } 402 }
398 // TODO: destroy callback 403 // TODO: destroy callback
399 404
405 if(args.contextmenu) {
406 UIMENU menu = ui_contextmenu_create(args.contextmenu, obj, view);
407 ui_widget_set_contextmenu(view, menu);
408 }
400 409
401 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view)); 410 GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view));
402 if(args.multiselection) { 411 if(args.multiselection) {
403 gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); 412 gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
404 } 413 }

mercurial