Config...l::TkUI(3pm)

πŸ’– NAME πŸ’–

okay so bestie, you opened Config::Model::TkUI(3pm) and lemme tell you, this one's a whole vibe: Config::Model::TkUI is the Tk GUI you use to edit config data through Config::Model. That's it, that's the name, slay.


✨ SYNOPSIS ✨

 use Config::Model::TkUI;

 # init trace
 Log::Log4perl->easy_init($WARN);

 # create configuration instance
 my $model = Config::Model -> new ;
 my $inst = $model->instance (root_class_name => 'a_config_class',
                              instance_name   => 'test');

 # Tk part
 my $mw = MainWindow-> new ;
 $mw->withdraw ;
 $mw->ConfigModelUI (-instance => $inst) ;

 MainLoop ;

no cap, that's the entire recipe. copy it, run it, main character energy unlocked. πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

So this class hands you a GUI for Config::Model. Periodt.

Pair this class with Config::Model plus an actual configuration model (think Config::Model::Xorg), and what you get is a whole tool for editing configuration files, e.g. /etc/X11/xorg.conf. it's giving "graphical frontend that actually knows what it's doing." πŸ’…


πŸŽ€ USAGE πŸŽ€

🌸 Left side tree 🌸

  • Click on the + and - boxes to open or close content. open, close, open, close, it's a fidget toy fr.
  • Left-click on an item to open a viewer widget.
  • Double-click, or hit return, on any item to open an editor widget.
  • Use Ctrl-C to copy configuration data into an internal buffer.
  • Use Ctrl-V to copy configuration data from that internal buffer into the configuration tree. > ⚠️ beware bestie: there is no "undo" operation. none. zero. don't test it. 😭
  • Before saving your modifications, you can review the change list with the menu entry File -> show unsaved changes. That list gets cleared after you do a File -> save.
  • Pasting the cut buffer into…
    • a leaf element will store the content of the buffer into the element.
    • a list element will split the content of the buffer with /\n/ or /,/ and push the resulting array at the end of the list element.
    • a hash element will use the content of the cut buffer to create a new key in the hash element.

🌈 Font size and big screens 🌈

Font type and size can be adjusted using the menu: Options -> Font menu. This setup is saved in the file ~/.cme/config/tkui.yml. your eyes, your rules. πŸ‘‘

Hit Ctrl-F or use the menu Edit -> Search to open a search widget at the bottom of the window.

Enter a keyword in the entry widget and click on the Next button.

The keyword will be searched in the configuration tree, in element name, in element value and in documentation. three places at once, she's thorough like that. ✨

🫢 Editor widget 🫢

The right side of the widget is either a viewer or an editor. When you click on store in the editor, the new data is stored in the tree represented on the left side of TkUI. The new data will be stored in the configuration file only when the File -> save menu is invoked. so like, it's saved in the tree, but not in the file until you actually say so. iykyk. πŸ’œ

🧚 Wizard 🧚

A wizard can be launched either with the File -> Wizard menu entry or with the Run Wizard button.

The wizard will scan the configuration tree and stop on all items flagged as important in the model. It will also stop on all erroneous items (mostly missing mandatory values). it's basically the friend who checks your homework before you turn it in. 🌟


πŸ’… Methods πŸ’…

⭐ save(callback) ⭐

Save modified data in the configuration file. The callback function is called only if the save was done without error. The callback is called with $@ in case of a failed save. so like, callback means it worked, $@ means it did not. rude but honest. πŸ™ˆ


πŸ’€ TODO πŸ’€

  • add tabular view ?
  • expand the whole tree at once
  • add plug-in mechanism so that dedicated widget can be used for some config Class (Could be handy for Xorg::ServerLayout)

(the future is bright and also extremely backlogged, ngl)


🌸 More information 🌸


πŸ’– FEEDBACK and HELP wanted πŸ’–

This project needs feedback from its users. Please send your feedbacks, comments and ideas to the author. (yes, this is your sign to actually send that email, bestie 🫢)

  • Look and feel of Perl/Tk interface can be improved
  • A nicer logo (maybe a penguin with a wrench...) would be welcomed
  • Config::Model could use a web interface
  • May be also an interface based on Gtk or Wx for better integration in Desktop

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, babes β€” it shipped with perl v5.40.1 and it's dated 2026-03-03. go edit some config files, drink water, and remember: save your work before you paste anything. mwah πŸ’‹

πŸ“¦ where this page comes from