GTK(3)

πŸ“¦
version 0.03 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’–

Data::TreeDumper::Renderer::GTK β€” a Gtk3::TreeView renderer for Data::TreeDumper πŸŽ€


okay so this is the GTK(3) page, and bestie, it's giving "your perl data structure but make it ✨visual✨". Let's get into it πŸ¦‹

🌸 SYNOPSIS 🌸

  my $treedumper = Data::TreeDumper::Renderer::GTK->new
                        (
                        data => \%data,
                        title => 'Test Data',
                        dumper_setup => {DISPLAY_PERL_SIZE => 1}
                        );

  $treedumper->modify_font(Gtk3::Pango::FontDescription->from_string ('monospace'));
  $treedumper->expand_all;

  # some boilerplate to get the widget onto the screen...
  my $window = Gtk3::Window->new;

  my $scroller = Gtk3::ScrolledWindow->new;
  $scroller->add ($treedumper);

  $window->add ($scroller);
  $window->show_all;

✨ DESCRIPTION ✨

So, Data::TreeDumper has a GTK-perl renderer now, and that's literally what this is. πŸ’…

This widget is the gui equivalent of Data::TreeDumper. It will display a perl data structure in a TreeView, which means you can fold and unfold child data structures like a little gremlin exploring a treasure chest, and get a quick feel for what's where. 🫢

And right-clicking anywhere in the view brings up a context menu, from which the user can choose to expand or collapse all items. Iconic behavior, no notes. 😌


🧚 EXAMPLE 🧚

gtk_test.pl β€” go look at it, it's right there πŸ“


πŸ‘‘ METHODS πŸ‘‘

🌟 widget = Data::TreeDumper::Renderer::GTK::TreeDumper->new (...)

Create a new TreeDumper. The optional arguments are expect to be key/val pairs. πŸŽ€

  • dumper_setup => hash reference β€” All data is passed to Data::TreeDumper. All of it. Every crumb. πŸͺ
  • data => scalar β€” Equivalent to calling "$treedumper->set_data ($scalar)". πŸ’«
  • title => string or undef β€” Equivalent to calling "$treedumper->set_title ($string)". πŸ’œ

🌟 $treedumper->set_data ($newdata)

  • $newdata (scalar) πŸ“¦

Fill the tree with $newdata, which may be any scalar. And listen: the tree does not reference $newdata β€” necessary data is copied. So don't be out here thinking you're passing a live reference, bestie. πŸ™ˆ

🌟 $treedumper->set_title ($title=undef)

  • $title (string or undef) a new title 🏷️

Set the string displayed as the column title. The view is created with one column, and the header is visible only if there is a title set. No title, no header. That's the vibe check. βœ…


πŸ’€ EXPORT πŸ’€

None

Like... nothing. Zero. Nada. It's not giving exports today. 😭


🫢 AUTHORS 🫢

Khemir Nadim ibn Hamouda. <nadim@khemir.net> Muppet <scott at asofyet dot org>

  Copyright (c) 2005 Nadim Ibn Hamouda el Khemir and
  Muppet. All rights reserved.

  This program is free software; you can redistribute
  it and/or modify it under the same terms as Perlitself.

If you find any value in this module, mail me! All hints, tips, flames and wishes are welcome at <nadim@khemir.net>. πŸ’Œ

fr fr they said flames are welcome. go off, respectfully. πŸ”₯

🌈 SEE ALSO 🌈

  • Data::TreeDumper for advanced usage of the dumper engine. iykyk πŸ‘€

okay that's the whole page bestie, you ate that reading, periodt πŸ’…βœ¨ This little drop of knowledge came to you from perl v5.42.0, dated 2025-07-25, straight off the GTK(3) page. mwah πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from