1Prima(3)              User Contributed Perl Documentation             Prima(3)
2
3
4

NAME

6       Prima - a perl graphic toolkit
7

SYNOPSIS

9               use Prima qw(Application Buttons);
10
11               Prima::MainWindow->new(
12                       text     => 'Hello world!',
13                       size     => [ 200, 200],
14               )-> insert( Button =>
15                       centered => 1,
16                       text     => 'Hello world!',
17                       onClick  => sub { $::application-> close },
18               );
19
20               run Prima;
21

DESCRIPTION

23       The toolkit is combined from two basic set of classes - core and
24       external. The core classes are coded in C and form a base line for
25       every Prima object written in perl. The usage of C is possible together
26       with the toolkit; however, its full power is revealed in the perl
27       domain. The external classes present easily expandable set of widgets,
28       written completely in perl and communicating with the system using
29       Prima library calls.
30
31       The core classes form an hierarchy, which is displayed below:
32
33               Prima::Object
34                       Prima::Component
35                               Prima::AbstractMenu
36                                       Prima::AccelTable
37                                       Prima::Menu
38                                       Prima::Popup
39                               Prima::Clipboard
40                               Prima::Drawable
41                                       Prima::DeviceBitmap
42                                       Prima::Printer
43                                       Prima::Image
44                                               Prima::Icon
45                               Prima::File
46                               Prima::Region
47                               Prima::Timer
48                               Prima::Widget
49                                       Prima::Application
50                                       Prima::Window
51
52       The external classes are derived from these; the list of widget classes
53       can be found below in "SEE ALSO".
54

BASIC PROGRAM

56       The very basic code shown in "SYNOPSIS" is explained here.  The code
57       creates a window with 'Hello, world' title and a centered button with
58       the same text. The program terminates after the button is pressed.
59
60       A basic construct for a program written with Prima obviously requires
61
62               use Prima;
63
64       code; however, the effective programming requires usage of the other
65       modules, for example, "Prima::Buttons", which contains set of button
66       widgets. "Prima.pm" module can be invoked with a list of such modules,
67       which makes the construction
68
69               use Prima;
70               use Prima::Application;
71               use Prima::Buttons;
72
73       shorter by using the following scheme:
74
75               use Prima qw(Application Buttons);
76
77       Another basic issue is the event loop, which is called by
78
79               run Prima;
80
81       sentence and requires a "Prima::Application" object to be created
82       beforehand.  Invoking "Prima::Application" standard module is one of
83       the possible ways to create an application object. The program usually
84       terminates after the event loop is finished.
85
86       The window is created by invoking
87
88               Prima::MainWindow->new();
89
90       or
91
92               Prima::MainWindow-> create()
93
94       code with the additional parameters. Actually, all Prima objects are
95       created by such a scheme. The class name is passed as the first
96       parameter, and a custom set of parameters is passed afterwards. These
97       parameters are usually represented in a hash syntax, although actually
98       passed as an array.  The hash syntax is preferred for the code
99       readability:
100
101               $new_object = Class->new(
102                       parameter => value,
103                       parameter => value,
104                       ...
105               );
106
107       Here, parameters are the class properties names, and differ from class
108       to class. Classes often have common properties, primarily due to the
109       object inheritance.
110
111       In the example, the following properties are set :
112
113               Window::text
114               Window::size
115               Button::text
116               Button::centered
117               Button::onClick
118
119       Property values can be of any type, given that they are scalar. As
120       depicted here, "::text" property accepts a string, "::size" - an
121       anonymous array of two integers and "onClick" - a sub.
122
123       onXxxx are special properties that form a class of events, which share
124       the "new"/"create" syntax, and are additive when the regular properties
125       are substitutive (read more in Prima::Object).  Events are called in
126       the object context when a specific condition occurs.  The "onClick"
127       event here, for example, is called when the user presses (or otherwise
128       activates) the button.
129

API

131       This section describes miscellaneous methods, registered in "Prima::"
132       namespace.
133
134       message TEXT
135           Displays a system message box with TEXT.
136
137       run Enters the program event loop. The loop is ended when
138           "Prima::Application"'s "destroy" or "close" method is called.
139
140       parse_argv @ARGS
141           Parses prima options from @ARGS, returns unparsed arguments.
142

OPTIONS

144       Prima applications do not have a portable set of arguments; it depends
145       on the particular platform. Run
146
147               perl -e '$ARGV[0]=q(--help); require Prima'
148
149       or any Prima program with "--help" argument to get the list of
150       supported arguments. Programmaticaly, setting and obtaining these
151       options can be done by using "Prima::options" routine.
152
153       In cases where Prima argument parsing conflicts with application
154       options, use Prima::noARGV to disable automatic parsing; also see
155       parse_argv.  Alternatively, the construct
156
157               BEGIN { local @ARGV; require Prima; }
158
159       will also do.
160

SEE ALSO

162       The toolkit documentation is divided by several subjects, and the
163       information can be found in the following files:
164
165       Tutorials
166           Prima::tutorial - introductory tutorial
167
168       Core toolkit classes
169           Prima::Object - basic object concepts, properties, events
170
171           Prima::Classes - binder module for the core classes
172
173           Prima::Drawable - 2-D graphic interface
174
175           Prima::Region - generic shape for clipping and hit testing
176
177           Prima::Image  - bitmap routines
178
179           Prima::image-load - image subsystem and file operations
180
181           Prima::Widget - window management
182
183           · Prima::Widget::pack - Tk::pack geometry manager
184
185           · Prima::Widget::place - Tk::place geometry manager
186
187           Prima::Window - top-level window management
188
189           Prima::Clipboard - GUI interprocess data exchange
190
191           Prima::Menu - pull-down and pop-up menu objects
192
193           Prima::Timer - programmable periodical events
194
195           Prima::Application - root of widget objects hierarchy
196
197           Prima::Printer - system printing services
198
199           Prima::File - asynchronous stream I/O
200
201       Widget library
202           Prima::Buttons - buttons and button grouping widgets
203
204           Prima::Calendar - calendar widget
205
206           Prima::ComboBox - combo box widget
207
208           Prima::DetailedList - multi-column list viewer with controlling
209           header widget
210
211           Prima::DetailedOutline - a multi-column outline viewer with
212           controlling header widget
213
214           Prima::DockManager - advanced dockable widgets
215
216           Prima::Docks - dockable widgets
217
218           Prima::Edit - text editor widget
219
220           Prima::ExtLists - listbox with checkboxes
221
222           Prima::FrameSet - frameset widget class
223
224           Prima::Grids - grid widgets
225
226           Prima::Header - a multi-tabbed header widget
227
228           Prima::HelpViewer - the built-in POD file browser
229
230           Prima::Image::TransparencyControl - standard dialog for transparent
231           color index selection
232
233           Prima::ImageViewer - bitmap viewer
234
235           Prima::InputLine - input line widget
236
237           Prima::KeySelector - key combination widget and routines
238
239           Prima::Menus - menu widgets
240
241           Prima::Label - static text widget
242
243           Prima::Lists - user-selectable item list widgets
244
245           Prima::MDI - top-level windows emulation classes
246
247           Prima::Notebooks - multipage widgets
248
249           Prima::Outlines - tree view widgets
250
251           Prima::PodView - POD browser widget
252
253           Prima::ScrollBar - scroll bars
254
255           Prima::ScrollWidget - scrollable generic document widget
256
257           Prima::Sliders - sliding bars, spin buttons and input lines, dial
258           widget etc.
259
260           Prima::Spinner - spinner animation
261
262           Prima::StartupWindow - a simplistic startup banner window
263
264           Prima::TextView - rich text browser widget
265
266           Prima::Themes - widget themes manager
267
268       Standard dialogs
269           Prima::Dialog::ColorDialog - color selection facilities
270
271           Prima::Dialog::FindDialog - find and replace dialogs
272
273           Prima::Dialog::FileDialog - file system related widgets and dialogs
274
275           Prima::Dialog::FontDialog - font dialog
276
277           Prima::Dialog::ImageDialog - image file open and save dialogs
278
279           Prima::Image::TransparencyControl - transparent color index
280           selection
281
282           Prima::MsgBox - message and input dialog boxes
283
284           Prima::Dialog::PrintDialog - standard printer setup dialog
285
286       Drawing helpers
287           Prima::Drawable::CurvedText - fit text to path
288
289           Prima::Drawable::Glyphs - bi-directional text input and complex
290           scripts output
291
292           Prima::Drawable::Gradient - gradient fills for primitives
293
294           Prima::Drawable::Markup - Allow markup in widgets
295
296           Prima::Drawable::Path - stroke and fill complex paths
297
298           Prima::Drawable::Subcanvas - paint a hierarchy of widgets to any
299           drawable
300
301           Prima::Drawable::TextBlock - rich text representation
302
303       Visual Builder
304           VB - Visual Builder for the Prima toolkit
305
306           Prima::VB::VBLoader - Visual Builder file loader
307
308           prima-cfgmaint - configuration tool for Visual Builder
309
310           Prima::VB::CfgMaint - maintains visual builder widget palette
311           configuration
312
313       PostScript printer interface
314           Prima::PS::Drawable - PostScript interface to "Prima::Drawable"
315
316           Prima::PS::Printer - PostScript interface to "Prima::Printer"
317
318       C interface to the toolkit
319           Prima::internals - Internal architecture
320
321           Prima::codecs    - Step-by-step image codec creation
322
323           prima-gencls     - "prima-gencls", a class compiler tool.
324
325       Miscellaneous
326           Prima::faq - frequently asked questions
327
328           Prima::Const - predefined toolkit constants
329
330           Prima::EventHook - event filtering
331
332           Prima::Image::Animate - animate gif and webp files
333
334           Prima::IniFile - support of Windows-like initialization files
335
336           Prima::IntUtils - internal functions
337
338           Prima::StdBitmap - shared access to the standard toolkit bitmaps
339
340           Prima::Stress - stress test module
341
342           Prima::Tie - tie widget properties to scalars or arrays
343
344           Prima::Utils - miscellaneous routines
345
346           Prima::Widgets - miscellaneous widget classes
347
348       System-specific modules and documentation
349           Prima::gp-problems - Graphic subsystem portability issues
350
351           Prima::X11 - usage guide for X11 environment
352
353           Prima::sys::gtk::FileDialog - GTK file system dialogs
354
355           Prima::sys::win32::FileDialog - Windows file system dialogs
356
357           Prima::sys::XQuartz - MacOSX/XQuartz facilities
358
359       Class information
360           The Prima manual pages often provide information for more than one
361           Prima class.  To quickly find out the manual page of a desired
362           class, as well as display the inheritance information, use
363           "prima-class" command. The command can produce output in text and
364           pod formats; the latter feature is used by the standard Prima
365           documentation viewer "podview" ( see File/Run/prima-class ).
366
368       Copyright 1997-2003 The Protein Laboratory, University of Copenhagen.
369       All rights reserved.
370
371       Copyright 2004-2020 Dmitry Karasik. All rights reserved.
372
373       This program is distributed under the BSD License.
374

AUTHORS

376       Dmitry Karasik <dmitry@karasik.eu.org>, Anton Berezin
377       <tobez@tobez.org>, Vadim Belman <voland@lflat.org>,
378
379
380
381perl v5.32.0                      2020-07-28                          Prima(3)
Impressum