[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] File chooser?
You could use one or a couple SCListViews from which
you could drag filenames.
Opening a folder into the SCListView, create two
arrays so that the file names fit into the SCListView
and there is still a pathname array to reference:
(
var refArray, listViewArray, listView;
w = SCWindow.new
.front;
listView = SCListView(w, Rect(10, 10, 200, 200));
File.openDialog("", { arg p;
t = PathName(p);
refArray = (t.pathOnly++"*").pathMatch;
listViewArray = Array.new;
refArray.size.do({ arg i;
listViewArray =
listViewArray.add(PathName(refArray.at(i)).fileName);
});
listView.items = listViewArray;
});
)
you could either use a button to:
b.action_({
whatever.doWhatever(refArray.at(listArray.value))
});
if you want to drag from the SCListView, you will drag
the integer value of the highlighted item in the
SCListView.
at least that's what I do.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com