Prima(3)

πŸ“¦
version 1.74000 Β· 5 versions
, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so welcome to Prima(3) β€” User Contributed Perl Documentation, bestie β€” and the name says it all: Prima is a Perl graphic toolkit. πŸŽ€βœ¨


✨ SYNOPSIS ✨

here's the little hello-world moment, literally iconic:

        use Prima qw(Application Buttons);

        Prima::MainWindow->new(
                text     => 'Hello world!',
                size     => [ 200, 200],
        )-> insert( Button =>
                centered => 1,
                text     => 'Hello world!',
                onClick  => sub { $::application-> close },
        );

        run Prima;

see more screenshots at http://prima.eu.org/big-picture πŸ¦‹


🌸 DESCRIPTION 🌸

so Prima is a classic 2D GUI toolkit that works under Windows and X11 environments. it features a rich widget library, extensive 2D graphic support, PDF generation, modern Unicode text input and output, and supports a wide set of image formats. plus β€” not me being dramatic β€” the RAD-style Visual Builder and POD viewer are included. the toolkit can interoperate with other popular event loop libraries. πŸ’…


πŸ‘‘ CLASS HIERARCHY πŸ‘‘

the toolkit is built with a combination of two basic sets of classes β€” core and external. the core classes are coded in C and form a baseline for every Prima object written in Perl. the usage of C is possible together with the toolkit; however, its full power is revealed in the Perl domain. the external classes present an easily expandable set of widgets, written entirely in Perl and communicating with the system using Prima library calls. 🧚

the core classes form a hierarchy, which is displayed below:

        Prima::Object
                Prima::Component
                        Prima::AbstractMenu
                                Prima::AccelTable
                                Prima::Menu
                                Prima::Popup
                        Prima::Clipboard
                        Prima::Drawable
                                Prima::DeviceBitmap
                                Prima::Printer
                                Prima::Image
                                        Prima::Icon
                        Prima::File
                        Prima::Region
                        Prima::Timer
                        Prima::Widget
                                Prima::Application
                                Prima::Window

the external classes are derived from these; the list of widget classes can be found below in SEE ALSO. 🌈


πŸŽ€ BASIC PROGRAM πŸŽ€

the very basic code shown in SYNOPSIS is explained here. the code creates a window with a 'Hello, world' title and a button with the same text. the program terminates after the button is pressed. periodt. πŸ’–

a basic construct for a program written with Prima requires

        use Prima;

code; however, effective programming requires the usage of the other modules, for example, "Prima::Buttons", which contains various button widgets. the "Prima.pm" module can be invoked together with a list of such modules, which makes the construction

        use Prima;
        use Prima::Application;
        use Prima::Buttons;

shorter by using the following scheme:

        use Prima qw(Application Buttons);

another basic issue is the event loop, which is called by

        run Prima;

code and requires a Prima::Application object to be created beforehand. invoking the Prima::Application standard module is one of the possible ways to create an application object. the program usually terminates after the event loop is finished. πŸ¦‹

the main window is created by invoking

        Prima::MainWindow->new();

or

        Prima::MainWindow->create()

code with additional parameters. all Prima objects are created by the same scheme; the class name is passed as the first parameter, and a custom set of parameters is passed afterward:

        $new_object = Class->new(
                parameter => value,
                parameter => value,
                ...
        );

here, parameters are the class property names, and they differ from class to class. classes often have common properties, primarily due to object inheritance. πŸ‘‘

in the example, the following properties are used:

        Window::text
        Window::size
        Button::text
        Button::centered
        Button::onClick

property values can be of any scalar type. for example, the ::text property accepts a string, ::size β€” an anonymous array of two integers, and onClick β€” a sub. πŸ’…

onXxxx are special properties that describe events that can be used together with the new/create syntax, and are additive when the regular properties are substitutive (read more in Prima::Object). events are called in the object context when a specific condition occurs. the onClick event here, for example, is called when the user presses (or otherwise activates) the button. ✨


🫢 API 🫢

this section describes miscellaneous methods, registered in the Prima:: namespace.

  • message TEXT β€” displays a system message box with TEXT. πŸ’¬
  • open_file, save_file β€” when the Prima::Dialog::FileDialog module is loaded, these shortcut methods are registered in the Prima:: namespace as an alternative to the same methods in the module's namespace. the methods execute standard file open and save dialogs, correspondingly. see Prima::Dialog::FileDialog for more. πŸ“
  • run β€” enters the program event loop. the loop is ended when Prima::Application's destroy or close method is called. πŸ”₯
  • parse_argv @ARGS β€” parses Prima options from @ARGS, returns unparsed arguments. πŸŽ€

πŸ’œ OPTIONS πŸ’œ

Prima applications do not have a portable set of arguments; it depends on the particular platform. run

        perl -e '$ARGV[0]=q(--help); require Prima'

or any Prima program with a --help argument to get the list of supported arguments. programmatically, setting and obtaining these options can be done by using the Prima::options routine. 🌸

in cases where the Prima argument parsing conflicts with the application options, use Prima::noARGV to disable the automatic parsing; also see parse_argv. alternatively, the construct

        BEGIN { local @ARGV; require Prima; }

will also do. πŸ¦‹

πŸ‘€ SEE ALSO πŸ‘€

okay so the toolkit docs are split into a bunch of sections, and the individual manuals live in these files β€” bestie, this is your map πŸ—ΊοΈβœ¨

πŸŽ€ Tutorials πŸŽ€

  • Prima::tutorial β€” introductory tutorial

πŸ’… Core toolkit classes πŸ’…

  • Prima::Object β€” basic object concepts, properties, events
  • Prima::Classes β€” binder module for the core classes
  • Prima::Drawable β€” 2-D graphic interface
  • Prima::Region β€” generic shape for clipping and hit testing
  • Prima::Image β€” bitmap routines
  • Prima::image-load β€” image subsystem and file operations
  • Prima::Widget β€” window management
    • Prima::Widget::pack β€” Tk::pack geometry manager
    • Prima::Widget::place β€” Tk::place geometry manager
  • Prima::Window β€” top-level window management
  • Prima::Clipboard β€” GUI interprocess data exchange
  • Prima::Menu β€” pull-down and pop-up menu objects
  • Prima::Timer β€” programmable periodical events
  • Prima::Application β€” the root of widget objects hierarchy
  • Prima::Printer β€” system printing services
  • Prima::File β€” asynchronous stream I/O

πŸ¦‹ Widget library πŸ¦‹

  • Prima::Buttons β€” buttons, checkboxes, radios
  • Prima::Calendar β€” calendar widget
  • Prima::ComboBox β€” combo box widget
  • Prima::DetailedList β€” multi-column list viewer with controlling header widget
  • Prima::DetailedOutline β€” multi-column outline viewer with controlling header widget
  • Prima::DockManager β€” advanced dockable widgets
  • Prima::Docks β€” dockable widgets
  • Prima::Edit β€” text editor
  • Prima::ExtLists β€” listbox with checkboxes
  • Prima::FrameSet β€” frameset widget
  • Prima::Grids β€” grid widgets
  • Prima::HelpViewer β€” the built-in POD browser
  • Prima::ImageViewer β€” image viewer
  • Prima::InputLine β€” input line widget
  • Prima::KeySelector β€” key combination widget and routines
  • Prima::Menus β€” menu widgets
  • Prima::Label β€” static text widget
  • Prima::Lists β€” list widgets
  • Prima::MDI β€” top-level window emulation
  • Prima::Notebooks β€” multipage widgets
  • Prima::Outlines β€” tree view widgets
  • Prima::PodView β€” POD browser widget
  • Prima::ScrollBar β€” scroll bars
  • Prima::Sliders β€” sliding bars, spin buttons, dial widgets, etc.
  • Prima::Spinner β€” spinner animation widget
  • Prima::TextView β€” rich text browser widget
  • Prima::Widget::Date β€” date picker widget
  • Prima::Widget::Time β€” time input widget

🌸 Standard dialogs 🌸

  • Prima::Dialog::ColorDialog β€” color selection facilities
  • Prima::Dialog::FindDialog β€” find and replace dialogs
  • Prima::Dialog::FileDialog β€” file system-related widgets and dialogs
  • Prima::Dialog::FontDialog β€” font dialog
  • Prima::Dialog::ImageDialog β€” image file open and save dialogs
  • Prima::Image::TransparencyControl β€” transparent color index selection
  • Prima::MsgBox β€” message and input dialog boxes
  • Prima::Dialog::PrintDialog β€” standard printer setup dialog

🧚 Drawing helpers 🧚

  • Prima::Drawable::Antialias β€” alternative API for antialiased shapes
  • Prima::Drawable::CurvedText β€” fit text to path
  • Prima::Drawable::Glyphs β€” bi-directional text input and complex scripts output
  • Prima::Drawable::Gradient β€” gradient fills for primitives
  • Prima::Drawable::Markup β€” allow markup in widgets
  • Prima::Drawable::Metafile β€” graphics recorder
  • Prima::Drawable::Path β€” stroke and fill complex paths
  • Prima::Drawable::Pod β€” POD parser and renderer
  • Prima::Drawable::Subcanvas β€” paint a hierarchy of widgets to any drawable
  • Prima::Drawable::TextBlock β€” rich text representation

πŸ‘‘ Visual Builder πŸ‘‘

  • VB β€” Visual Builder for the Prima toolkit
  • Prima::VB::VBLoader β€” Visual Builder file loader
  • prima-cfgmaint β€” configuration tool for Visual Builder
  • Prima::VB::CfgMaint β€” configures the widget palette in the Visual Builder
  • prima-fmview β€” .fm file viewer

πŸ”₯ PostScript printer interface πŸ”₯

  • Prima::PS::PostScript β€” PostScript interface to Prima::Drawable
  • Prima::PS::PDF β€” PDF interface to Prima::Drawable
  • Prima::PS::Printer β€” PostScript and PDF interfaces to Prima::Printer

🫢 Widget helpers 🫢

  • Prima::Widget::BidiInput β€” heuristics for i18n input
  • Prima::Widget::Fader β€” fading- in/out functions
  • Prima::Widget::GroupScroller β€” optional automatic scroll bars
  • Prima::Widget::Header β€” multi-column header widget
  • Prima::Widget::IntIndents β€” indenting support
  • Prima::Widget::Link β€” links embedded in widgets
  • Prima::Widget::ListBoxUtils β€” common paint routine for listboxes
  • Prima::Widget::MouseScroller β€” auto-repeating mouse events
  • Prima::Widget::Panel β€” simple panel widget
  • Prima::Widget::RubberBand β€” dynamic rubberbands
  • Prima::Widget::ScrollWidget β€” scrollable generic document widget
  • Prima::Widget::StartupWindow β€” a simplistic startup banner window
  • Prima::Widget::UndoActions β€” undo and redo the content of editable widgets

πŸ’œ C interface to the toolkit πŸ’œ

  • Prima::internals β€” Internal architecture
  • Prima::codecs β€” Step-by-step image codec creation
  • prima-gencls β€” prima-gencls, a class compiler tool.
  • prima-tmlink β€” prima-tmlink, optimizer tool for files produced by prima-gencls.

🌈 Miscellaneous 🌈

  • Prima::faq β€” frequently asked questions
  • Prima::Const β€” predefined toolkit constants
  • Prima::EventHook β€” event filtering
  • Prima::Image::Animate β€” animate gif and webp files
  • Prima::Image::base64 β€” hardcoded image files
  • Prima::Image::Exif β€” manipulate Exif records
  • Prima::Image::Loader β€” progressive loading and saving for multiframe images
  • Prima::IniFile β€” support of Windows-like initialization files
  • podview β€” POD viewer
  • prima-pod2pdf β€” POD printer
  • Prima::StdBitmap β€” shared access to the standard bitmaps
  • Prima::Stress β€” stress test module
  • Prima::Themes β€” widget themes manager
  • Prima::Tie β€” tie widget properties to scalars and arrays
  • Prima::types β€” builtin types
  • Prima::Utils β€” miscellaneous routines

⭐ System-specific modules and documentation ⭐

  • Prima::gp-problems β€” Graphic subsystem portability issues
  • Prima::X11 β€” usage guide for X11 environment
  • Prima::sys::gtk::FileDialog β€” GTK file system dialogs
  • Prima::sys::win32::FileDialog β€” Windows file system dialogs
  • Prima::sys::XQuartz β€” MacOSX/XQuartz facilities
  • Prima::sys::FS β€” unicode-aware core file functions

🧚 Class information 🧚

The Prima manual pages often provide information for more than one Prima class. To quickly find out the manual page of a desired class, as well as display the inheritance information, use the prima-class command. The command can produce output in the text and pod formats; the latter feature is used by the standard Prima documentation viewer podview ( see File/Run/prima-class ).


  • Copyright 1997-2003 The Protein Laboratory, University of Copenhagen. All rights reserved.
  • Copyright 2004-2024 Dmitry Karasik. All rights reserved.
This program is distributed under the BSD License.

✨ AUTHORS ✨

  • Dmitry Karasik <dmitry@karasik.eu.org>
  • Anton Berezin <tobez@tobez.org>
  • Vadim Belman <voland@lflat.org>,

that's the whole vibe check, bestie πŸ’… this page is from perl v5.42.0, dated 2024-08-20, and it's literally Prima(3) β€” mwah πŸ’–πŸŽ€

πŸ“¦ where this page comes from