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

X11::Tops

SYNOPSIS

  use X11::Tops;
  $xtops = X11::Tops->new;

  use X11::Tops;
  $X = X11::Protocol->new;
  $xtops = X11::Tops->new($X);
  @xtops = X11::Tops->new($X)->sort;

  print $xtops->[0]->class, "\n";
  print $xtops->[0]->instance, "\n";
  print $xtops->[0]->icon, "\n";
  print $xtops->[0]->title, "\n";

  for my $xtop (@$xtops) { print $xtop->instance, "\n" }

  $xtop = $xtops->match('instance', qr/gecko/i);
  $xtop = $xtops->instance(qr/gecko/i);
  $xtop = $xtops->icon(qr/gecko/i);

  $xtop->char('q');
  $xtop->char;

  ($xtops, @deleted) = $xtops->update;

  $xtop->monitor_property_change
  X11::Top::monitor_property_change($X->root);

DESCRIPTION

An X11::Tops object is an array of X11::Top objects.

Both classes have class, instance, title & icon methods. For X11::Tops there is a regex argument & the method returns an X11::Top object whose corresponding property matches the regex. For X11::Top there is no argument (other than the object) & the corresponding property is returned. Class & instance are handled separately even though they come from the same property (WM_CLASS). Values of class & instance are assumed not to change (so are cached).

The X11::Top method char gets or sets a (non-standard) property _XCHAR_CHAR. Normally the character name of a toplevel is derived from the instance name.

RCS

 $Source: /home/keck/lib/perl/X11/RCS/Tops.pm,v $
 $Revision: 3.19 $
 $Date: 2007/07/01 14:48:29 $