how to...

Portable Presenter is a package designed to give presentations. A presentation is based on slides, which are shown on viewports.

PPresenter is able to show a slide on more than one viewport at the same time, maybe in different styles, on different devices, in different fonts and fontsizes. So: for each viewport, a slide has a slide-view, which is written in a specific style.

The information about a slide which is not related to one viewport, but to the general functioning of the slide within the show, is stored in the options described below.

Slide options: Per viewport
a slide-view
which defines a style
with options for

How to create a slide

A slide is a collection of options, combining the content and behaviour information. The options have different sources: the depend mainly on which style you have selected.

When you have only one viewport (window) to show the slide, the creation of a slide is easy:

   $show->addSlide( general options
                  , style selectors
                  , style-elem options);
The order of the options is not important.

When you have a presentation with multiple viewports involved, then you should read the page on how to specify slide-views.

General slide options

-title => string
-aliases => [ string, ... ]
The only obligatory option of each slide is a unique title. If you think the title is too long to refer to (for instance in the -nextSlide option), or the title is not unique, you can add a list of aliases.

-reqtime => timespan
The estimation for the time required to present this slide. The default is 60 seconds, which is rather short. If you specify even shorter timespans, than surely you will have problems keeping to it during your actual presentation.

There are various ways you can specify a timespan. Examples say it all:
"1h30m"= 4800 sec;  "1h30"= 3630! sec; "30m"= 1800 sec
"1:30"= 90 sec;  "1:30:0"= 4800 sec; "3:"= 180 sec
"2m30s"= 150 sec;  2000= 2000 sec; 30= 30 sec

Defines when to proceed to the next slide. The values are:
  • STOP: default. Proceed on user's command only;
  • TIME: wait until the required time is over (-reqtime), and then proceed automatically to the next slide. The user can force to proceed before the time has expired.
  • NOW: continue immediately. Only useful when using multiple screens in one presentation.
  • PHASE number: continue when the phase is reached. This is useful when the show runs on multiple viewports, and you like the next slide to be loaded on a different viewport than this one.

-nextSlide => string
The slide to be shown after this one. This may be a name (the -title of the slide), an alias name of a slide, a sequence number in the list of slides, or 'FIRST' or 'LAST'.

-active => boolean
Include the slide in the presentation yes (true, 1 --the default) or no (false, 0). You can also (de-)activate slides with tags and via the control-popup or control window.

-tag => string
-tags => [ string, ... ]
Tags, used to select (activate) or unselect (deactive) groups of slides. See the show's new() function how to use the tags.

-callback => code
-callback => [ dynamic, callback ]
-callback => [ [ dynamic, callback ], ... ]
-callbacks equivalent to -callback
A callback is a hook into the program of the slide-display. You can specify your own perl-code to executed when a certain phase of the slide is reached.

The dynamic is a string as accepted by the selected dynamic style-element, although not all possible strings make sense.

The callback is a Tk::Callback as described in the Tk::callbacks manpage. Examples of possible combinations:

-callback => sub {print "hi\n"}
-callback => [ 'after 10', sub {print "@_\n"}, 'I' ]
10 seconds after appearance of the slide, the text `I' is printed on stdout.
-callback => [ 'phase 1', 'setRunning', $show->find('main'), 1 ]
The result of find is an object (say $main). The callback will result in $main->setRunning(1).


Examples of simple slide-specifications: one viewport, or multiple viewports all showing the same. For more complicated examples, visit the slide-view page.

Example 1

    $show->addSlide( -title    => 'demo'
                   , -template => 'tm'
                   , -bgcolor  => 'red'
                   , -backdrop => 0
                   , -main     => 'text'
                   , -reqtime  => 5*60);
The -title flag is the only obligatory argument, although... if you forget to mention it, the name will be "Slide number". With the -reqtime of 5 minutes, these are the real slide options.

The -template option selects the template style-element tm ("title-main": a screen which show a titlebar and the rest of the screen is used as one large piece of text). The -main option describes the text to be shown there. The "text" will be handled by the selected formatter, when time comes that it has to be displayed.

The other style-elements are not specified, so their respectively selected elements are used. It is not often required to specify another style-element then the template: in most cases you use the same for each slide.

The -bgcolor is consumed by the selected decoration style-element, as is the -backdrop flag.

As you see: it is very important to know which style-elements are selected, and which options they take. Give yourself some time to learn!

Example 2

    my $slide = $show->addSlide( qw/-title demo2
       -template m -reqtime 400 -proceed TIME -main/,
       "the text shown on the screen" );
    print $slide->tree;
Just a different way to denote a slide. In this case, maintenance is harder, and it soes not give you any speed benevit. You also see that the slide-structure is returned, and can be used to print the options after being processed.
Portable Presenter is written and maintained by Mark Overmeer. Copyright (C) 2000-2002, Free Software Foundation FSF.