Skip to content

Commit

Permalink
* x11dialg.c (SelectDialogClose): use GtkMultiSelection to get select…
Browse files Browse the repository at this point in the history
…ed items.
  • Loading branch information
htrb committed Nov 26, 2023
1 parent 299eac3 commit ef9f03c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/gtk/x11dialg.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,25 +467,23 @@ static void
SelectDialogClose(GtkWidget *w, void *data)
{
struct SelectDialog *d;
GListStore *list;
GListModel *list;
NgraphInst *ni;
int n, i;

d = (struct SelectDialog *) data;
list = columnview_get_list(d->list);
list = G_LIST_MODEL(gtk_column_view_get_model (GTK_COLUMN_VIEW (d->list)));
if (list == NULL) {
d->ret = IDOK;
return;
}
n = g_list_model_get_n_items (G_LIST_MODEL (list));

if (d->ret == IDOK) {
GtkSelectionModel *selection;

selection = gtk_column_view_get_model (GTK_COLUMN_VIEW (d->list));
for (i = 0; i < n; i++) {
if (gtk_selection_model_is_selected (selection, i)) {
ni = g_list_model_get_item (G_LIST_MODEL (list), i);
if (gtk_selection_model_is_selected (GTK_SELECTION_MODEL (list), i)) {
ni = g_list_model_get_item (list, i);
arrayadd(d->sel, &ni->id);
}
}
Expand Down

0 comments on commit ef9f03c

Please sign in to comment.