Last Review: Sep-15-2008

Home  ---   Description  ---   Create  ---   Install  ---   Download for Perl/Tk Version 804.028 on Linux



Description of the enhanced FBox.pm module

This change affects the getOpenFile and getSaveFile methods of the Perl/Tk toolkit on Linux, which are used to pop up a dialog box to select a file to open or save, respectively the underlying FBox.pm module.



Property showhidden

FBox.pm's default behaviour is to include hidden files and directories into it's listings. This can cause a lot of scrolling work, especially when running under Linux, since the Linux home directory contains a whole bunch of such items. These items appear in front of the list, so one always has to 'wipe' them aside, if the desired items are not hidden ones.

The enhanced FBox.pm module provides a new property named showhidden that enables or disables the listing of hidden items by setting it's value to 'on' or 'off':
 

$File = $w->getOpenFile(-title => "Sample Window", -showhidden => 'off');


If the showhidden property is omitted, the FBox.pm works in the usual way, which means, that you can still use all your programs as they are, after you installed the enhanced FBox.pm module.



Perl/Tk FBox.pm on Linux with hidden items

Perl/Tk FBox.pm filled with hidden items (some 50 items in front of the other ones)


Perl/Tk FBox.pm on Linux without hidden items

Perl/Tk FBox.pm without hidden items


Property msgfont

It always disturbed me, that the methods Feedback Dialog Boxes did'nt show up with nice fonts, moreover they delivered (on my system) kind of ugly, behemot letters:

Perl/Tk FBox.pm with legacy feedback dialog

Perl/Tk FBox.pm with legacy feedback dialog

The enhanced FBox.pm module provides a new property named msgfont that you can use to set the font for feedbacks, just like this:
 

$File = $w->getSaveFile(-title => "Sample Window", -msgfont => '{My FontName} 10 bold');


If the msgfont property is omitted, feedback works with no font specified (i.e. the message shows up with 'some' font), which means, that you can still use all your programs as they are, after you installed the enhanced FBox.pm module.



Now lets have a look at some sample output of the enhanced FBox.pm module:

Perl/Tk FBox.pm with enhanced feedback dialog, 1st sample

Perl/Tk FBox.pm with enhanced feedback dialog, 1st sample

Perl/Tk FBox.pm with enhanced feedback dialog, 2nd sample

Perl/Tk FBox.pm with enhanced feedback dialog, 2nd sample

Perl/Tk FBox.pm with enhanced feedback dialog, 3rd sample

Perl/Tk FBox.pm with enhanced feedback dialog, 3rd sample


Create the enhanced FBox.pm module

You could change other versions of this module (i.e. ones from Tk < 8.04) by your own edit folling this guide:



Install the enhanced FBox.pm module

The enhanced FBox.pm module was written and tested on a Linux Box with Perl/Tk Version 804.028. On this system FBox.pm resides here:

/usr/local/lib/perl/5.8.8/Tk/

Change your working directory to the above one and then first make a backup of your old FBox.pm module. Now replace it with the enhanced FBox.pm module. Take care of proper naming and permissions for the file (You do these operations as root).

You can test this installation by opening a file in your (Linux) home directory resp. trying to overwrite an existing filename with the accordingly parameterized getOpenFile resp. getSaveFile methods in one of your programs.

WARNING:
While this file replacement may work in a similar way on other platforms too, you could encounter trouble with the implementation. While the code for the msgfont property will run as is, the one for the showhidden property is os-dependent (For Windows the use of an additional module is needed). Moreover on Windows 2000 and ActiveState Perl v5.8.8, Perl/Tk version 804.027 for example, you can run a program with a changed FBox.pm module as long, as you use legacy calls with getOpenFile resp. getSaveFile. If you incorporate the new properties in the method call you'll end up with a 'bad option' error. There seems to be a controlling mechanism concerning the options which I didn't yet understand, maybe the option database is the right suspect... Unfortunately this is a rather tricky thing, and since I am barely using Windows this will take it's time...



Home  ---   Description  ---   Create  ---   Install  ---   Download for Perl/Tk Version 804.028 on Linux



Copyright © by Andreas-Josef v. Gencsy 2008

AjvG is programmer of
vGShop - Copyright (c) 1999-2008 by A.-J. v. Gencsy
vGShop the managed Online Shop System