find()

PPresenter
Manual
function

find in:

Portable Presenter is a package designed to give presentations. Presentations are written in options to style-elements grouped into styles. Well, sometimes you like to find style-elements in the large number of list kept around.

The following searches are available:

A find is always of the form:
   my $o = $object->find('objtype', name);
   my $o = $object->find(objtype => name);
   my $o = $object->find('objtype');
   my $o = $object->find(objtype => 'SELECTED');
   my @o = $object->find(objtype => 'ALL');
Where the name is:
  • a name of an object of the required type,
  • one of the aliases of an object of the required type,
  • a sequence number in the list,
  • 'FIRST', 'LAST', or
  • 'SELECTED' (default!).
Without a name, you will get the SELECTED.

A strange case is with 'ALL', because that returns a whole list, instead of a single element.

Find on a Show

Handled by show itself:
   my $style    = $show->find(style    => 'default');
   my $viewport = $show->find(viewport => 'control');
   my $slide    = $show->find(slide    => 'FIRST');
All other finds on a show are passed to the selected style. The following two lines are equivalent:
   $show->find(formatter => 'plain');
   $show->find('style')->find(formatter => 'plain');

Finds on a Style

A style is a combination of lists of style-elements. You can search in those lists with find.

A few ways you can use this select function:

   $show->addStyle(...options...)
         ->find(formatter => 'plain');
   my $style = $show->find(style => 'slidenotes')
         ->find(formatter => 'simple');
   $style->find(formatter => 'markup');
   $style->find('decoration');

Selections on a Viewport

A viewport has a selected style, which determines how a slide for that viewport should be displayed. A find on a viewport will result in a find on the selected style.

  $show->find(viewport => 'control')
       ->find(style    => 'slidenotes');
  $show->addViewport(...options...)
       ->find(dynamic  => 'default');
  $show->find(viewport)
       ->find(template => 'tm');
 
Portable Presenter is written and maintained by Mark Overmeer. Copyright (C) 2000-2002, Free Software Foundation FSF.