better looking directory chooser for tk?

R

Roger Pack

Currently in windows with Tk
if I run
Tk.chooseDirectory

it gives me the cruddy "teeny windows" version that forces you to start
at my computer to navigate through, and the window can't be expanded,
even.

Anybody know how I can get a better looking directory chooser? I know
it's possible, since other programs have the normal ones.
Thanks!
-r
 
H

Hidetoshi NAGAI

From: Roger Pack <[email protected]>
Subject: better looking directory chooser for tk?
Date: Fri, 9 Oct 2009 22:20:58 +0900
Message-ID: said:
Currently in windows with Tk
if I run
Tk.chooseDirectory

it gives me the cruddy "teeny windows" version that forces you to start
at my computer to navigate through, and the window can't be expanded,
even.

Please see the section "Standard Dialogs" on
http://www.tkdocs.com/tutorial/windows.html (at TkDocs site).
The dialog is a standard one on a Windows version of Tk.

To give an initial directory, please use 'initialdir' option
(e.g. Tk.chooseDirectory:)initaildir=>'c:\ruby').
Its full option is:
:)initialdir=>'dir-when-pops-up',
:parent=>logical-parent-widget,
:title=>"title-string-of-dialogbox",
:mustexist=>boolean-value)
Please read the Tcl/Tk's man page of "tk_chooseDirectory" about
the option values.
Anybody know how I can get a better looking directory chooser? I know
it's possible, since other programs have the normal ones.

If you hate the standard dialogs, you must create your own dialogs.
However, if the "other programs" which you said are written in Tcl/Tk
(Tcl/Tk script only, or with some Tcl/Tk extensions which work on your
environment), you can load and use them on Ruby/Tk.

For example, the standard "tk_chooseDirectory" dialog on Unix (Linux)
is written in pure Tcl/Tk (see <tklib-dir>/choosedir.tcl).
So, you can use it on Windows.
The following replaces Tk.chooseDirectory method to the Unix version.
 
R

Roger Pack

For example, the standard "tk_chooseDirectory" dialog on Unix (Linux)
is written in pure Tcl/Tk (see <tklib-dir>/choosedir.tcl).
So, you can use it on Windows.

Excellent. I will look into the pure tk one.
Thanks!
-r
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top