Skip to content

Commit

Permalink
CVCenter:*removeAll - don't remove widgets
Browse files Browse the repository at this point in the history
'snapshot', 'select snapshot'
  • Loading branch information
nuss committed Oct 3, 2016
1 parent 54098c7 commit 12317a3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CVCenter/CVCenter.sc
Expand Up @@ -1510,8 +1510,10 @@ CVCenter {
}

*removeAll { |...keys|
var toBeRemoved = all.keys.reject({ |k| k === \snapshot or:{ k === 'select snapshot' }});

if (keys.size < 1, {
all.keys.do(this.removeAt(_));
toBeRemoved.do(this.removeAt(_));
}, {
keys.do(this.removeAt(_));
});
Expand Down Expand Up @@ -2040,10 +2042,7 @@ CVCenter {

{
all !? {
if (addToExisting === false, {
toBeRemoved = all.reject({ |v, k| k === \snapshot or:{ k === 'select snapshot' }});
toBeRemoved.keysDo({ |key| this.removeAt(key) });
})
if (addToExisting === false, { this.removeAll });
};
lib[\all].pairsDo({ |key, v|
if (key !== \shortcuts, {
Expand Down

0 comments on commit 12317a3

Please sign in to comment.