Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

File Dialog Box

1 view
Skip to first unread message

Christopher Howard

unread,
Jan 7, 2011, 2:13:59 PM1/7/11
to
I'm writing some scripts that do most everything from the command-line.
Only thing GUI that would really help is a File Dialog box for selecting
file locations. What module would give me the fastest access to one?
(I.e., shortest learning time.)

Two things that can be taken for granted:

* Script will be run on Linux system
* Script will be run under Gnome desktop environment

--
Posted via http://www.ruby-forum.com/.

Anurag Priyam

unread,
Jan 7, 2011, 10:58:06 PM1/7/11
to

Zenity should do the job for you. In IRB try:

file = `zenity --file-selection` #=> '/home/yeban/foo'

Also, see man zenity for more widgets.

--
Anurag Priyam
http://about.me/yeban/

Michael Fellinger

unread,
Jan 8, 2011, 1:48:43 PM1/8/11
to

In case you don't have zenity but tk:
`wish <(echo 'puts [tk_getOpenFile]; exit')`

Also see http://tmml.sourceforge.net/doc/tk/getOpenFile.html

--
Michael Fellinger
CTO, The Rubyists, LLC

0 new messages