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::ImageViewer - bitmap viewer
231
232           Prima::InputLine - input line widget
233
234           Prima::KeySelector - key combination widget and routines
235
236           Prima::Menus - menu widgets
237
238           Prima::Label - static text widget
239
240           Prima::Lists - user-selectable item list widgets
241
242           Prima::MDI - top-level windows emulation classes
243
244           Prima::Notebooks - multipage widgets
245
246           Prima::Outlines - tree view widgets
247
248           Prima::PodView - POD browser widget
249
250           Prima::ScrollBar - scroll bars
251
252           Prima::ScrollWidget - scrollable generic document widget
253
254           Prima::Sliders - sliding bars, spin buttons and input lines, dial
255           widget etc.
256
257           Prima::Spinner - spinner animation
258
259           Prima::TextView - rich text browser widget
260
261           Prima::Widgets - miscellaneous widget classes
262
263       Standard dialogs
264           Prima::Dialog::ColorDialog - color selection facilities
265
266           Prima::Dialog::FindDialog - find and replace dialogs
267
268           Prima::Dialog::FileDialog - file system related widgets and dialogs
269
270           Prima::Dialog::FontDialog - font dialog
271
272           Prima::Dialog::ImageDialog - image file open and save dialogs
273
274           Prima::Image::TransparencyControl - transparent color index
275           selection
276
277           Prima::MsgBox - message and input dialog boxes
278
279           Prima::Dialog::PrintDialog - standard printer setup dialog
280
281       Drawing helpers
282           Prima::Drawable::CurvedText - fit text to path
283
284           Prima::Drawable::Glyphs - bi-directional text input and complex
285           scripts output
286
287           Prima::Drawable::Gradient - gradient fills for primitives
288
289           Prima::Drawable::Markup - Allow markup in widgets
290
291           Prima::Drawable::Path - stroke and fill complex paths
292
293           Prima::Drawable::Subcanvas - paint a hierarchy of widgets to any
294           drawable
295
296           Prima::Drawable::TextBlock - rich text representation
297
298       Visual Builder
299           VB - Visual Builder for the Prima toolkit
300
301           Prima::VB::VBLoader - Visual Builder file loader
302
303           prima-cfgmaint - configuration tool for Visual Builder
304
305           Prima::VB::CfgMaint - maintains visual builder widget palette
306           configuration
307
308       PostScript printer interface
309           Prima::PS::PostScript - PostScript interface to "Prima::Drawable"
310
311           Prima::PS::PDF - PDF interface to "Prima::Drawable"
312
313           Prima::PS::Printer - PostScript and PDF interfaces to
314           "Prima::Printer"
315
316       C interface to the toolkit
317           Prima::internals - Internal architecture
318
319           Prima::codecs    - Step-by-step image codec creation
320
321           prima-gencls     - "prima-gencls", a class compiler tool.
322
323       Miscellaneous
324           Prima::faq - frequently asked questions
325
326           Prima::Const - predefined toolkit constants
327
328           Prima::EventHook - event filtering
329
330           Prima::Image::Animate - animate gif and webp files
331
332           Prima::IniFile - support of Windows-like initialization files
333
334           Prima::IntUtils - internal functions
335
336           Prima::StartupWindow - a simplistic startup banner window
337
338           Prima::StdBitmap - shared access to the standard toolkit bitmaps
339
340           Prima::Stress - stress test module
341
342           Prima::Themes - widget themes manager
343
344           Prima::Tie - tie widget properties to scalars or arrays
345
346           Prima::Utils - miscellaneous routines
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.1                      2021-01-27                          Prima(3)
Impressum