in reply to Setting size of Tk chooseDirectory

This is a bummer of a problem. I don't know of any way to re-size the chooseDirectory window. The DirSelect gizmo pays attention to -width, but not -height. However, it can be resized with the mouse. The disadvantage is that DirSelect is really ugly looking on Windows.

I remember this problem from a long time ago. I needed to know the directory where hundreds of data files were located. Instead of asking about the directory directly, I asked the user to select one of the data files using the Tk::getOpenFile widget. That widget looks really nice on Windows and presented an easy to understand task to do. I threw away the file name and used the directory path. This "show me one of the data files", didn't confuse the users and worked out ok for me.

Yes, this is a super kludge with a lot of limitations - like it won't work if you are asking for a directory to put results into (no files to select). I just mention this as a "hack" possibility - asking a more detailed question than you actually need.

Sorry that I don't have an obvious, easy, "great" answer for you. I am not sure that there is one.

Replies are listed 'Best First'.
Re^2: Setting size of Tk chooseDirectory
by Anonymous Monk on Aug 11, 2016 at 01:03 UTC

    :)

    The DirSelect gizmo pays attention to -width, but not -height. However, it can be resized with the mouse. The disadvantage is that DirSelect is really ugly looking on Windows.

    Its pure perl, WidgetDump shows you all the objects (children) and all their modifiable option, everything from icons to colors to fonts to heights

      It respects both width and height
      my $ds = $mw->DirSelect(qw/ -width 333333 -height 666666 -background red /);
        I tried your code. On my system, Active State 5.20.2, the -height has no effect whatsoever. However, width and background do as the documentation for version 1.03 says. Perhaps you have a more recent version? I just used what was in the ppm archive for my Perl version.

        Update: I looked on CPAN, latest is version 1.11 - that is probably the difference. But at the end of the day, we have something that is "ugly" on Windows. Don't know the OP's O/S, but that could be a consideration.