Xforms4Perl
view release on metacpan or search on metacpan
X11/Xforms/Xforms.pm.skel view on Meta::CPAN
The I<FD_CMDLOG>, I<FD_FSELECTOR>, I<FL_EditKeymap>, I<FL_FORM>, I<FL_IOPT>
and I<FL_OBJECT> data structures have been defined as Perl objects
(within the B<X11::Xforms> package). Therefore, the values of most fields in each
structure can be directly read. In addition, all fields within the
I<FL_IOPT> structure, and many of the I<FL_FORM> and I<FL_OBJECT> structures,
can be updated too.
The syntax to read a field is:
C< $value = $struct_ref-E<gt>field_name;>
and to write a writable field is
C< $oldval = $struct_ref-E<gt>field_name(new_value);>
where '$struct_ref' is the 'blessed' Perl object returned by such
functions as B<fl_get_fselector_fdstruct>, B<fl_get_command_log_fdstruct>,
B<fl_[create/add]_[object_type]> and B<fl_bgn_form>. In fact the return
value of any function that, in Xforms itself, returns one of the above
structures, can be used as the '$struct_ref' part of a field access.
The available fields in each structure, together with an indication
of whether each field is read-only (ro) or read-write (rw), are
as follows:
=over 4
=item FD_CMDLOG
All fields are available read-only. However, since
the fields themselves contain FL_FORM or FL_OBJECT
structures, the fields within those structures can
be accessed as below.
=item FD_FSELECTOR
All fields are available read-only. However, since
the fields themselves contain FL_FORM or FL_OBJECT
structures, the fields within those structures can
be accessed as below.
=item FL_FORM
compress_mask rw
deactivated rw
evmask rw
fdui rw
first ro
focusobj ro
frozen rw
h rw
has_auto rw
hotx rw
hoty rw
icon_mask rw
icon_pixmap rw
label rw
last ro
prop rw
top rw
u_cdata rw
u_ldata rw
u_vdata rw
use_pixmap rw
visible rw
vmode rw
w rw
window ro
wm_border rw
x rw
y rw
Be warned that the u_cdata field is treated exactly as
defined - as a character string - and not as a void pointer. Therefore
when writing its value from Perl, be sure to provide a valid character
string.
=item FL_OBJECT
active rw
align rw
argument rw
automatic rw
belowmouse rw
boxtype rw
bw rw
child ro
click_timeout rw
clip rw
col1 rw
col2 rw
double_buffer rw
focus rw
form ro
h rw
input rw
label rw
lcol rw
lsize rw
lstyle rw
nc ro
next ro
nwgravity rw
objclass rw
parent ro
prev ro
pushed rw
radio rw
redraw rw
resize rw
segravity rw
type rw
u_cdata rw
u_ldata rw
u_vdata rw
use_pixmap rw
visible rw
w rw
wantkey rw
window ro
(virtual field equivalent to $obj->form->window)
x rw
y rw
Be warned that the u_cdata field is treated exactly as
defined - as a character string - and not as a void pointer. Therefore
when writing its value from Perl, be sure to provide a valid character
string.
=item FL_IOPT
All fields in this structure are available as read-
write fields. In addition, there is an extra method
provided that returns a reference to a blank FL_IOPT
object:
C< $iopt = X11::Xforms::FLOpt-E<gt>new;>
Alternatively, a populated FL_IOPT object can be
obtained using the B<fl_get_defaults> function.
=item FL_EditKeymap
This structure is used with the B<fl_set_input_editkeymap>
function. All fields in this structure are available
as read-write fields. In addition, there is an extra
'method' provided that returns a reference to a blank
FL_EditKeymap object:
C< $keymap = X11::Xforms::FLEditKeymap-E<gt>new;>
The idea here is to use the 'new' method to create
the object, use the I<$ref-E<gt>field> syntax to set the
edit key mapping requirements, and then pass the
object to the fl_set_input_editkeymap function.
See the XFgrep.pl and X4Pinit.pl DEMOs for examples of how
to use this (especially useful for making Linux Delete and
Backspace keys behave themselves!).
=back
Note that just because a field is read-write does not mean that
you SHOULD write to it. Refer to the Xforms documentation for details
of the use of each field, and if and when a field should be written
to.
=head1 VALUE ADDED FEATURES
B<X11::Xforms> provides two powerful extra features over and above those delivered with the
native Xforms library. They exist separately but are designed to be used together.
TRY THIS: Once you have installed B<X11::Xforms>, run the demos. Then copy the
B<X4Pinit.pl> demo script to your home directory, renaming it to B<.X4Pinit.pl>,
and re-run the demos: THAT is what these facilities are all about!!
=head2 The Class Initialization Callback
Xforms does not provide a very easy way to apply system
wide defaults to object attributes, such as color and font. If you don't want what
is provided as the library default you have to set every object manually.
The B<Class Initialization Callback> feature solves this problem for Perl
scripts.
( run in 0.601 second using v1.01-cache-2.11-cpan-39bf76dae61 )