Gtk2::Ex::VolumeButton - widget to control volume and similar values


Gtk2-Ex-VolumeButton documentation  | view source Contained in the Gtk2-Ex-VolumeButton distribution.

Index


NAME

Top

Gtk2::Ex::VolumeButton - widget to control volume and similar values

DESCRIPTION

Top

Gtk2::Ex::VolumeButton is a simple Gtk2 widget based on Gtk2::ToggleButton to control the volume and similar values. It consists of a Gtk2::ToggleButton widget displaying an image representing the current volume. When the button is clicked a popup window containing a Gtk2::VScale widget shows up and allows you to change the widgets volume value. It's also possible to change the volume using the scroll wheel over the toggle button even if the popup window isn't shown.

This widget is modeled after the widgets use in gnome-panel, muine and rhythmbox. Much code is stolen from the muine volume-button widget.

OBJECT HIERARCHY

Top

  Glib::Object
  +----Gtk2::Object
        +----Gtk2::Widget
              +----Gtk2::Container
                    +-----Gtk2::Bin
                           +----Gtk2::Button
                                 +----Gtk2::ToggleButton
                                       +----Gtk2::Ex::VolumeButton

SYNOPSIS

Top

  use Gtk2::Ex::VolumeButton;

  ...

  my $vb = Gtk2::Ex::VolumeButton->new(
      volume       => 20,
      mute_image   => 'mute.png',
      zero_image   => 'zero.png',
      min_image    => 'min.png',
      medium_image => 'medium.png',
      max_image	   => 'max.png',
      icon_size    => 20,
      position     => 'top',
      muted        => 1
  );
  $vb->show();

  $vb->signal_connect( volume_changed =>
      sub { print 'volume changed: ', $vb->{volume}, "\n" } );

  $vb->signal_connect( mute_changed =>
      sub { print $_[1] ? 'muted : 'unmuted', "\n" } );

  ...

  Gtk2->main();

PROPERTIES

Top

'volume' (int : readable / writable)

Current volume

'mute_image' (string : readable / writable)

Image to lay over the current image when the volume is muted

'zero_image' (string : readable / writable)

Image to display when the volume is zero

'min_image' (string : readable / writable)

Image to display when the volume is minimal

'medium_image' (string : readable / writable)

Image to display when the volume is medium

'max_image' (string : readable / writable)

Image to display when the volume is maximal

'position' (string : readable / writable)

Position of the popup window relativ to the button

'top' and 'buttom' are supported

'muted' (boolean : readable / writable)

Is the volume muted?

SIGNALS

Top

'volume_changed'

Emitted when the volume property is changed

'mute_changed'

Emitted when the mute status is changed

SEE ALSO

Top

Gtk2, Glib::Object, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::Button, Gtk2::ToggleButton

AUTHOR

Top

Florian Ragwitz <flora@cpan.org>

COPYRIGHT AND LICENSE

Top


Gtk2-Ex-VolumeButton documentation  | view source Contained in the Gtk2-Ex-VolumeButton distribution.