Tk::Playlist - Tk::HList subclass providing playlist-like manipulation


Tk-Playlist documentation  | view source Contained in the Tk-Playlist distribution.

Index


NAME

Top

Tk::Playlist - Tk::HList subclass providing playlist-like manipulation

SYNOPSIS

Top

  use Tk::Playlist;

  my $playlist = $widget->Playlist(-readonly => 0);
  $playlist->add("foobar.mp3", -text => "The FooBar Song");
  $playlist->callback_change([ \&rewrite_m3u, "filename.m3u" ]);

DESCRIPTION

Top

The Tk::Playlist widget is derived from the standard Tk::HList widget. See it's documentation for more information.

In addition to the standard HList functionality, the Tk::Playlist widget adds the ability to modify the list directly. Isers may drag entries up and down the list and delete items from the list using the "Delete" key.

WIDGET-SPECIFIC OPTIONS

Top

Switch: -readonly
Method: readonly

Specifies that the list may not be modified.

Switch: -callback_change
Method: callback_change

Specifies a Tk callback to be executed whenever the list is changed by the user. The callback is called once for each item that has changed. the first parameter is either "move" (to indicate an item has been moved), "done_moving" (to indicate the user has released the mouse button and is done dragging entries around), or "delete" (to indicate an item has been deleted).

When the first parameter is "move" or "delete", the second parameter is the tag that was assigned to the item (see Tk::HList->add for more info).

When the first parameter is "move", the third parameter is the new position of the item on the list, with the top of the list being "1".

BUGS

Top

When a user attempts to drag an entry beyond the top of the list, the position (third) parameter passed to callback_change is "0". This could be considered a bug or a feature.

SEE ALSO

Top

Tk::HList, Tk::callbacks

AUTHOR

Top

Tyler MacDonald, <japh@crackerjack.net>

COPYRIGHT AND LICENSE

Top


Tk-Playlist documentation  | view source Contained in the Tk-Playlist distribution.