Change Defaults


Adding Slides
Changing defaults

In the previous example, I used all the default style-elements. However, in practical situations, you sometimes need to be able to change or overrule the default style elements.

There are three ways to overrule defaults:

  • Overrule the default style-element for one slide,
  • Switch to a new default style-element, and
  • Change the default for an option.

Overrule the style-element for one slide

You can specify the name of style-elements when adding a slide. This is most commonly used for the template element, because every slide requires a screen template but not always the 'title main' version. The example should explain the most of it:
      ( -title     => 'other template'
      , -template  => 'tblr'
      , -left      => 'text on the left'
      , -right     => 'text on the right'
The default template 'tm' is overruled by the -template option. The selected template for this slide (only this slide) is 'tblr' (abbreviation of "title big-left right", see image).
The selected template has options -title, -left, and -right to be overruled with something useful.

Set a new Default for a Style-Element

If you like a different style-element to be used in all slides, it is not pleasant to have that repeated for each slide again. To change the selected default do:
    my $show = PPresenter->new;
    $show->select(fontset => 'scaling');
which will set the fontset to scaling X11-fonts (on UNIX). You can change the selection whenever you like and as often as you like: PPresenter keeps track of it.

In the above case, we select the right fontset for the selected style. This is equivalent to:

   $show->find(style => 'SELECTED')
        ->select(fontset => 'scaling');
        ->select(fontset => 'scaling');

Change the Default for an Option

There are a few ways to change the default value for one of the options of a style-element. Of course, you can be specific and repeat yourself at each slide to overrule the default:
   $show->addSlide(-fgcolor => 'red', ...);
   $show->addSlide(-fgcolor => 'red', ...);
But I can also say:
        ->change(-fgcolor => 'red');

Changes do not influence slides defined before the change is made.
$show->find('decoration') is equivalent to
$show->find(decoration => 'SELECTED').

An other alternative is:

       ( decoration => 'SELECTED'
       , -fgcolor   => 'red'

If you want to change all style-elements of kind:

       ( template        => 'ALL'
       , -areaSeparation => '2%'
The area's in all templates will now be a bit larger, because the space inbetween those areas is reduced from the default 3% (of the window's width or height) to only 2%.

Next: Timing.

Portable Presenter is written and maintained by Mark Overmeer. Copyright (C) 2000-2002, Free Software Foundation FSF.