~artem-anufrij/granite/granite-modebutton-clear-selected

« back to all changes in this revision

Viewing changes to demo/GraniteDemo.vala

  • Committer: Artem Anufrij
  • Date: 2015-09-08 17:28:35 UTC
  • Revision ID: artem.anufrij@live.de-20150908172835-vs8tznpvb03osolp
'selected = -1' clear selected items

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
        expandable_grid_start.expand = true;
221
221
        var expandable_grid_end = new Gtk.Grid ();
222
222
        expandable_grid_end.expand = true;
 
223
        var clear_button = new Gtk.Button.with_label("Clear Selected");
 
224
        clear_button.clicked.connect (() => {
 
225
            icon_mode.selected = -1;
 
226
            text_mode.selected = -1;
 
227
        });
223
228
        grid.attach (expandable_grid_start, 0, 0, 1, 1);
224
 
        grid.attach (expandable_grid_end, 2, 3, 1, 1);
 
229
        grid.attach (expandable_grid_end, 2, 4, 1, 1);
225
230
        grid.attach (icon_mode, 1, 1, 1, 1);
226
231
        grid.attach (text_mode, 1, 2, 1, 1);
 
232
        grid.attach (clear_button, 1, 3, 1 ,1);
227
233
        main_stack.add_named (grid, "modebutton");
228
234
    }
229
235