The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Tk::AppWindow::OverView - Getting started with Tk::AppWindow

DESCRIPTION

This document gives a brief overview of techniques used.

CALLBACKS

Besides regular Tk callbacks Tk::AppWindowheavily relies on callbacks from the module Tk::AppWindow::BaseClasses::Callback. This type of callback is used in commands and configvariables.

It allows the addition and removal of hooks. A hook is a routine linked to the callback that is executed before of after the execution of the actual callback. This is used mainly in plugins.

COMMANDS

The method cmdConfig in Tk::AppWindow allows you to issue commands that later can be executed through the method cmdExecute. Plugins can hook onto these commands. You can give parameters to a command.

CONFIGVARIABLES

Tk::AppWindow extends on Perl/Tk's option system with -configvariables. You may modify all configvariables with configPut and retrieve the values with configGet. You can add configvariables to the AppWindow object the following ways:

    These ways use the classical Tk::ConfigSpecs method and should always be added before AppWindow's ConfigSpecs call. That means that beside -preconfig this can only be done during initialization of extensions. It also means that only the PASSIVE and CALLBACK types make any sense. You specify them as:

     -option1 => ['PASSIVE', 'optionName', 'OptionClass', $defaultvalue'],
     -option2 => ['CALLBACK', undef, undef, ['Method', $obj]],
    The -preconfig option

    Specify this option at create time.

    AddPreConfig method

    This method is called during initialization of extensions when needed.

    The second way is through the ConfigInit method. It is sort of a replacement of the classical METHOD. They are immediately available upon creation. And you can apply hooks to them.

     $app->configInit('-option1' => ['Method', $obj]);
     $app->configInit('-option2' => sub { $var = shift; return $var});

EXTENSIONS

Extensions are modules that add functionality to Tk::AppWindow. By default they live in Tk::AppWindow::Ext. You may define an extra name space using the -namespace option.

Extensions can add config variables and commands to Tk::Appindow. They can add entries into toolbars and menus. Some extensions depend on others. They will be loaded automatically.

Without extensions loaded, Tk::AppWindow is no more than a sophisticated mainwindow.

The following extenstion are available within Tk::AppWindow:

Art

Everything about images and icons

Balloon

Central balloon widget for your application

ConfigFolder

Store settings and temp files in a configfolder

Help

Help center

Keyboard

All about keyboard bindings

MDI

Multiple Document Interface

Menus and stuff

Navigate your documents in a multiple document interface.

Panel used by Nnavigator

Panels

Arrange your panels, like Toolbar, StatusBar, NavigatorPanel, ToolPanel and Work area.

Plugins

Manage your plugins

SDI

Single document interface

Settings

Init and edit your application settings.

StatusBar

Log messages and special events.

ToolBar

What to say?

ToolPanel

Panel like NavigatorPanel. By default on the right hand side.

WebBrowser

Interface to your webbrowser.

HOOKS

Hooks are a feature of the Tk::AppWindow::BaseClasses::Callback object. All commands and config variables of the configInittype can have hooks applied to them. Used mainly to facilitate loading and unloading of plugins.

PLUGINS

Plugins are modules that add functionality to Tk::AppWindow. Unlike extensions they can be loaded and unloaded by the end user at request. By default they live in Tk::AppWindow::Plugins. You may define an extra name space using the -namespace option. Plugins are handled by the Plugins extension.

Plugins can add commands, menu entries, panel entries and toolbar entries. Plugins can not add config variables.

AUTHOR

Hans Jeuken (hanje at cpan dot org)

SEE ALSO

Tk::AppWindow
Tk::AppWindow::BaseClasses::Extension