NAME

Qtk::QuickTk::details - precise definition of usage details

SYNOPSIS

use Tk;
use Qtk::QuickTk

# need to set $filename, e.g.:  my $filename='miniapp.qtk';

my $app=Qtk::Quicktk->new($filename);
die "QuickTk constructor unable to read GUI spec: $filename\n"
  unless defined $app;

MainLoop;die "QuickTk fell through past MainLoop\n";

or, alternatively, make a QuickTk script directly executable, with the following first line (see full demo script in EXAMPLES, below:

exec /usr/bin/perl -M'Qtk::QuickTk=app' -e app $0;exit

DESCRIPTION

(Introduction not written yet.)

FUNCTION: new [ spec, [ codeout, [ genonly ] ] ]

The constructor (function "new") for module Qtk::QuickTk can be invoked with zero, one, two or three parameters. The first is a GUI specification, which can take several forms, as below, under "spec"; the second, a filename for logging generated code; and the third, a generate-only flag. If no parameters are specified, an object (a blessed reference to a hash) will be returned with only the prototype entries present. In this case one might create a GUI spec by other external means and put it into the hash.

Parameter: spec

If at least one parameter is specified, the first will be taken to be the specification for a GUI based application. This spec may be in one of three forms: (1) a filename, (2) a reference blessed into the Text::TreeFile class, or (3) a reference to a tree of text strings.

spec parameter: as filename

If the spec parameter is a scalar, but not a reference, it will be interpreted as a filename and passed to module Text::TreeFile to create a tree of strings. This tree will be used as the GUI specification for further processing.

spec parameter: as Text:TreeFile ref

If the spec parameter is a reference that has been blessed into the Text::TreeFile class, the resulting tree of strings will be used as the GUI specification for further processing.

spec parameter: as tree of strings

If the spec parameter is a reference to an array of the correct form to be a string tree node, it will be interpreted as the GUI specification for further processing.

Parameter: codeout

If at least two parameters are specified in the call to new(), the second will be interpreted as a filename for output logging of the generated perl-tk code. If the undef value is specified, then logging will not occur. If this parameter is not specified, the default is not to log generated code to a file at all.

Parameter: genonly

If three parameters are specified in the call to new(), the third will be interpreted as a flag indicating whether to execute the perl-tk code generated. If the undef value is specified or this parameter is not specified, the default is to execute the code generated. If a value is specified, then no generated perl-tk code will be executed.

FUNCTION: app [ [ genonly ] gfilename ]

app() will expect the first argument to contain the name of the QuickTk script to execute (often, the script that invoked it).

FUNCTION: createwidget args specname

createwidget() will expect the first argument to be a reference to an array containing values to which the QuickTk script widget spec refers by names $0, $1, ..., and the second argument to be a string which is the name of the widget specified in the script with the 'nocreate' packing option set. This would normally be called by a callback specified somewhere in the script.

FUNCTION: showglobals

(Not written yet.)

FUNCTION: logit

(Not written yet.)

FUNCTION: logg

(Not written yet.)

TEST SCRIPT: test.pl

(Not written yet.)

EXPORTS

Nothing is exported by default. Functions app(), createwidget(), showglobals(), logit(), and logg() may be imported on request. The module's new() function returns a blessed reference to a hash which contains a number of data items. (Refer to Qtk::QuickTk::internals for details, if you want them.) This hash acts as a global repository for variables accessible to the application. See Qtk::QuickTk::scripts for instruction and sample uses of this facility.

EXCEPTIONS

(Not written yet.)

BUGS

(Not written yet.)