-
Notifications
You must be signed in to change notification settings - Fork 1
/
ANNOUNCE
101 lines (73 loc) · 3.4 KB
/
ANNOUNCE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
The third beta release of the X11::Motif module has been added
to CPAN. It is available as:
file: $CPAN/authors/id/KENFOX/X11-Motif-1.1b3.tar.gz
size:
md5:
The X11::Motif distribution includes X11::Lib, X11::Toolkit,
X11::Xpm, X11::Xbae and X11::XRT. An X11::Athena (including
the 3d, Win95 and NeXTSTEP variants) is in the works. I'll
probably have to split the distribution at that point because
it is just getting too large.
Taken together, these modules provide a nearly complete
interface to the standard X libraries. The modules have both
object oriented and function call style interfaces. The object
interface is similar to the Tk module. The function call
interface is strongly modeled after the standard X library
documentation and will be familiar to someone with X Toolkit or
Motif experience.
The modules work well in both stand-alone scripts and when embedded
in a larger C (or C++) Motif application. Embedded Perl combined
with this module is an ideal way to add scripting capability to an
existing Motif application.
This release is very stable and works well. Production programs
are being built on top of it. (The only reason that this version
is not labeled production is because it is missing complete
documentation.)
I've included two versions of the classic "hello world" example
at the end of this announcement. Even if you don't grab the module,
I'd appreciate feedback on whether the examples are understandable.
To build the modules, you will need:
* Perl version 5.004 or higher (5.005 hasn't been tested yet)
* X11R5 or higher (X11R4 should work but hasn't been tested)
* Motif 1.2.4 or higher (CDE Motif works. Motif 2.0 is reported
to work. LessTif is also reported to work, but with reduced
functionality.)
* An ANSI C compiler
I would appreciate being notified of any changes necessary to
support other environments and/or widget sets.
Any questions or comments? Please send them to <[email protected]>.
- Ken
# ----------------------------------------------------------------------
# -- Example #1: The object style
use X11::Motif;
my $toplevel = X::Toolkit::initialize("Example");
my $form = give $toplevel -Form;
my $hello = give $form -Label, -text => 'Hello, world!';
my $ok = give $form -Button, -text => 'OK', -command => sub { exit };
arrange $form -fill => 'xy', -bottom => [ $ok, $hello ];
handle $toplevel;
# ----------------------------------------------------------------------
# -- Example #2: The function call style (i.e. "traditional" Motif)
use X11::Motif qw(:Xt :Xm);
my $toplevel = X::Toolkit::initialize("Example");
my $form = XtCreateManagedWidget("form", xmFormWidgetClass, $toplevel);
my $hello = XtCreateManagedWidget("hello", xmLabelWidgetClass, $form,
XmNlabelString, "Hello, world!",
XmNlabelType, XmSTRING);
my $ok = XtCreateManagedWidget("ok", xmPushButtonWidgetClass, $form,
XmNlabelString, "OK",
XmNlabelType, XmSTRING);
XtAddCallback($ok, XmNactivateCallback, sub { exit }, 0);
XtSetValues($hello,
XmNrightAttachment, XmATTACH_FORM,
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_WIDGET,
XmNbottomWidget, $ok);
XtSetValues($ok,
XmNrightAttachment, XmATTACH_FORM,
XmNleftAttachment, XmATTACH_FORM,
XmNtopAttachment, XmATTACH_NONE,
XmNbottomAttachment, XmATTACH_FORM);
XtRealizeWidget($toplevel);
XtAppMainLoop(XtWidgetToApplicationContext($toplevel));