-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
114 lines (76 loc) · 4.01 KB
/
readme.txt
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
102
103
104
105
106
107
108
109
110
111
112
113
114
------------------------------------------------------------------------
RATIONALE:
Starting with gtkada or any new GUI toolkit can be daunting.
Some fairly trivial tutorial examples can be found in "examples" but
they are often incomplete, e.g. they don't all make the calls required
to shut themselves down properly.
There is one large demo program, testgtk, found in "testgtk", which gives
a good example of how many of the tools available in GTKAda (such as
scrollbars, Cairo drawing) etc work. Build it and see what each tool does.
Having found a useful example tool in Testgtk, this harness makes it easier
to extract that tool into a simple but reasonably complete stand-alone
program, which can serve as the starting point for your widget or application.
Folders "examples" and "testgtk" are in the GTKAda source directory.
If you installed GTKAda from Debian packages, they are installed to
/usr/share/doc/libgtkada-doc/examples/ but currently this only seems to contain
testgtk.gz.
------------------------------------------------------------------------
Prerequisites
The following has been built and tested on Debian Stretch, with Gnat 6.3 and
GTKAda 3.8.3 installed from the Debian packages
libgtkada-bin libgtkada-doc libgtkada3.8.3 libgtkada3.8.3-dev
GTKAda is also available via Adacore's github page
https://github.com/AdaCore/gtkada
or via downloads from libre.adacore.com
------------------------------------------------------------------------
Main program and project are harness.adb and harness.gpr.
To use, first "git clone" this repo into a new directory.
Copy the create_xxx package (.ads,.adb files) you want to test (e.g.
create_calendar.ads, create_calendar.adb) into this folder,
and edit its name into the "with/use" clauses in harness.adb.
Some packages may also need the Common package (common.ads,adb) and
specific resource files (testgtk.rc, bitmaps etc). See NOTEs below for
exceptions.
Build instructions :
mkdir obj
(only needed before the first build)
gnatmake -P harness.gpr
or
gprbuild harness.gpr
If build fails because of further missing resources, get them from the
TestGTK package.
The structure of the "help_dialog" package arises because each Create_xxx
package exports a string containing its help message.
------------------------------------------------------------------------
CHANGES: 30 May 2018
Updated from GTKAda-2.4.14 to GTKAda-3.8.3
Brought under git version control
------------------------------------------------------------------------
NOTE regarding the create_cairo example.
The Cairo example package requires the Testcairo_Drawing package, files
testcairo_drawing.ads and testcairo_drawing.adb.
This provides a number of test procedures, named in create_cairo.ads.
Before building this example, you need to select one of these tests.
Replace the line
Run(Win.Frame);
in harness.adb with the desired test, e.g.
Run_Rectangles(Win.Frame);
A dialog to select between these tests would be a nice addition.
------------------------------------------------------------------------
NOTE regarding the create_builder example.
create_builder originally used the gtkbuilder_example.xml example.
However this includes one button "on_print_to_console" whose handlers
are somewhere else in the TestGTK code. To overcome this, edit
create_builder.adb as below to use the supplied "harness_example.xml"
file without this button.
-- Default_Filename : constant String := "gtkbuilder_example.xml";
Default_Filename : constant String := "harness_example.xml";
------------------------------------------------------------------------
NOTE regarding .gitignore
By default, it ignores the create_xxx package files as they are not part
of the harness. If you use this project as the starting point for your own,
just edit .gitignore to track them.
------------------------------------------------------------------------
License : this example harness is supplied under the same license as the
TestGTK example. Enjoy.
-----------------------------------------------------------------------