HDF5::tkview(3pm)
π NAME π
PDL::IO::HDF5::tkview β peep your HDF5 files with the perl/tk and PDL::IO::HDF5 modules, bestie π
(It lives in the HDF5::tkview(3pm) corner of the User Contributed Perl Documentation, iykyk.)
β¨ DESCRIPTION β¨
Okay so, real talk: this is an experimental object for viewing HDF5 files with the PDL::IO::HDF5 module. It's giving tree view energy. The HDF files get displayed in a tree structure using Tk::Tree. π
π¦ SYNOPSIS π¦
use Tk;
use PDL::IO::HDF5::tkview
use PDL::IO::HDF5;
my $mw = MainWindow->new;
my $h5 = new PDL::IO::HDF5('datafile.h5'); # open HDF5 file object
my $tkview = new PDL::IO::HDF5::tkview( $mw, $h5);
MainLoop;
bestie the missing semicolon on that use line is literally in the original, I'm not touching it, it's iconic. π
π MEMBER DATA π
mw
Tk window where the file structure is displayed. π«Ά
H5obj
PDL::IO::HDF5 Object. slay.
hl
Tk Hlist object. β¨
dataDisplaySub
Sub ref to execute when a dataset is double-clicked. This defaults to a print of the dataset. See dataDisplaySubSet for details. π
Tk Hlist object
ngl that second line is just there in the original, so it's here too. We don't question the ancients. π§
π METHODS π
πΈ new
PDL::IO::HDF5::tkview Constructor - creates new object. The main character moment. β
Usage:
$tkview = new PDL::IO::HDF5::tkview( $mw, $H5obj);
Where:
$mw Tk window
$H5obj PDL::IO::HDF5::Object
πΈ dataDisplaySubSet
Set the dataDisplaySub data member. Lowkey the glow-up button for your double-click behaviour. π₯
Usage:
# Data Display sub to call when a dataset is double-clicked
my $dataDisplay = sub{ my $data = $_[0]; print "I'm Displaying This $data\n";};
$tkview->dataDisplaySubSet($dataDisplay);
The dataDisplaySub data member is a perl sub ref that gets called when a dataset is double-clicked. Bestie, it starts out set to just print the dataset's data to the command line. But with the dataDisplaySubSet method, you can "plug-in" totally different actions for displaying the data. Mix and match, it's your world. π
πΈ activateCmd
Internal Display method invoked whenever a tree element is activated (i.e. double-clicked). This method does nothing unless a dataset element has been selected. It that cases it calls $self->dataDisplaySub with the data.
fr fr, hand it a non-dataset and it's just standing there, serving absolutely nothing. π«₯
and that's the whole page, periodt. π This absolute gem of a doc shipped as part of Perl v5.42.3, dated 2026-08-21 β written in the holy scripture of perl v5.42.3, 2026-08-21, and HDF5::tkview(3pm). go read your HDF5 files, bestie, you ate. πβ¨ππ¦
π¦ where this page comes from
- ubuntu stonking: libpdl-io-hdf5-perl 1:0.762-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms