forked from php/web-gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaq.php
256 lines (218 loc) · 7.03 KB
/
faq.php
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?php
commonHeader('Frequently Asked Questions');
?>
<h1>Frequently Asked Questions</h1>
<ul>
<li><a href="#1">What is PHP-GTK?</a></li>
<li><a href="#2">Why is it not working with the browser/web server?</a></li>
<li><a href="#3">How do I install PHP-GTK on Win32?</a></li>
<li><a href="#4">How do I use the buttons in GtkFileSelection?</a></li>
<li><a href="#5">How do I know which GTK Classes are supported?</a></li>
<li><a href="#6">Can I use Themes under Win32?</a></li>
<li><a href="#7">Where do I go from here?</a></li>
</ul>
<dl>
<dt>
<a name="1"><b>What is PHP-GTK?</b></a>
</dt>
<dd>
<p>
PHP-GTK is a PHP extension that implements language bindings for GTK+. It
provides an object-oriented interface to GTK+ classes and functions and greatly
simplifies writing client side cross-platform GUI applications.
</p>
</dd>
<dt>
<a name="2"><b>Why is it not working with the browser/web server?</b></a>
</dt>
<dd>
<p>
PHP-GTK is not meant to be used in the Web environment. It is intended for
creation of standalone applications (run via command-line, user's desktop, etc.).
</p>
</dd>
<dt>
<a name="3"><b>How do I install PHP-GTK on Win32?</b></a>
</dt>
<dd>
<p>
Download the latest binaries from <a href="http://gtk.php.net/download.php">gtk.php.net</a>.
The zip file contains all binaries needed to run core PHP-GTK, as well as extra features such as Glade/XML and Scintilla.
Extract the files to a temporary directory and then copy them into the following locations:
</p>
<p>
<b>For Windows 98/NT/2000/XP:</b>
</p>
<p>In your PHP directory (e.g., c:\php4):</p>
<ul>
<li>php.exe</li>
<li>php_win.exe</li>
<li>php-cgi.exe</li>
<li>php.ini</li>
<li>php.ini-gtk</li>
<li>all .dll files</li>
</ul>
<p>In a test directory (e.g., c:\php4\test):</p>
<ul>
<li>all .php files</li>
<li>testgtkrc</li>
<li>testgtkrc2</li>
<li>window.xpm</li>
</ul>
<p>
NOTE: You can install the php.ini into your Windows directory (i.e., c:\winnt
or c:\windows) as indicated by the zip file, but it is often not a good option,
depending on the installation. It is also no longer required; the php.exe (CLI
version as of PHP 4.3.0) will search the working directory, e.g., c:\php4, as
well as the Windows directory. Or you can specify your php.ini location in your
command line statement with '-c' option, as given in the php_win example below.
</p>
<p>
<b>For Windows 95:</b>
</p>
<p>
PHP-GTK has <b>not</b> been tested on Windows 95 ... sorry.
</p>
<p>
<b>Testing the installation</b>
</p>
<p>
When the PHP-GTK files are installed, you can verify your setup using a DOS
command line. A typical example would be: c:\php4\php c:\php4\test\hello.php
</p>
<p>
To avoid the DOS box, you can use the php_win executable, provided in the install file:
</p>
<pre>
c:\php4\php_win c:\php4\test\hello.php
</pre>
<p>
or
</p>
<pre>
start c:\php4\php_win c:\php4\test\hello.php
</pre>
<p>
or
</p>
<pre>
c:\php4\php_win -c \php4\php.ini -f c:\php4\test\hello.php
</pre>
<p>
If you have installed your php.ini file in your Windows directory, the -c option
can be dropped. For more information on command line options, see
<a href="http://www.php.net/manual/en/features.commandline.php">'Using PHP from
the command line'</a> on the main PHP site.
</p>
<p>
<b>Troubleshooting</b>
</p>
<p>If you can't produce the hello window, try the following:</p>
<ul>
<li>Verify the hello.php location, i.e., [drive:]\php4\test</li>
<li>Open hello.php in Notepad, and make sure there is no obvious corruption in the code.</li>
<li>Modify your php.ini file, to log any errors, as detailed below.</li>
<li>Review the postings at the <a href=
"http://marc.theaimsgroup.com/?l=php-gtk-general">PHP-GTK discussion list archive</a>
for possible solutions.</li>
<li>If you still have a problem, subscribe to the <a
href="mailto:[email protected]">PHP-GTK general discussion
list</a> and post your question there.</li>
</ul>
<p>
<b>Tips/Tricks:</b>
</p>
<ul>
<li>To debug your scripts, modify the php.ini file as follows:
<ul>
<li>Find the line for 'log_errors'. Set it to 'On'.</li>
<li>Find the line for 'error_log'. Remove the beginning semicolon (uncomment)
and replace 'filename' with an actual file location<br/>
Example: error_log=c:\php4\error_log.txt.</li>
<li>If the error file does not exist, php will create it on the next run. Open
the file and review.</li>
</ul>
</li>
<li>If you are planning to launch on an association, decide which extension you
want to use for your scripts. Be aware that other applications register .php, so
something like .php-gtk might be a better option.</li>
<!--
<li>Check out the Code Snippets and Code Hints on the
<a href="http://gtk.php.net/wiki/">PHP-GTK Wiki page</a>.</li>
-->
<li>You can set your scripts to use Win32 themes, courtesy of Christian Weiske.
Check out the info page at:<br/>
<a href="http://www.cweiske.de/phpgtk_themes.htm ">http://www.cweiske.de/phpgtk_themes.htm </a></li>
<li>Install the <a href="http://www.cweiske.de/phpgtk_apps.htm#phpgtklauncher">php-gtk launcher</a>.
It handles many of the Windows directory issues and provides a series of PHP-GTK
icons. Also from Christian.</li>
<li>Consider using Glade/XML for setting up your screens and reducing maintenance time.<br/>
Start with the info page at: <a
href="http://gtk.php.net/manual1/en/glade.gladexml.php">http://gtk.php.net/manual1/en/glade.gladexml.php</a>.
</li>
</ul>
</dd>
<dt>
<a name="4"><b>How do I use the buttons in GtkFileSelection?</b></a>
</dt>
<dd>
<pre class="code">
// Create the dialog window:
$fs = &new GtkFileSelection("Save file");
// Get a handle to the Ok button:
$ok_button = $fs->ok_button;
// Connect a function:
$ok_button->connect("clicked", "enddialog");
// Connect the destroy action on the dialog window:
$ok_button->connect_object("clicked", "destroy", $fs);
</pre>
<p>
It is <b>not</b> currently possible to do it this way:
</p>
<pre class="code">
// Create the dialog window
$fs = &new GtkFileSelection("Save file");
// Connect a function
$fs->ok_button->connect("clicked", "enddialog");
// Connect the destroy action on the dialog window
$fs->ok_button->connect_object("clicked", "destroy", $fs);
</pre>
</dd>
<dt>
<a name="5"><b>How do I know which GTK Classes are supported?</b></a>
</dt>
<dd>
<p>
The following code will show the defined classes. All the PHP-GTK
classes will be listed along with one or two others.
</p>
<pre class="code">
$array = get_declared_classes();
while(list(,$classname) = each($array)) {
echo $classname."\n";
}
</pre>
<p>
See the <?php print_link('http://www.php.net/manual/en/ref.classobj.php', 'Class/Object functions'); ?>
in the PHP Manual for other useful functions.
</p></dd>
<dt>
<a name="6"><b>Can I use Themes under Win32?</b></a>
</dt>
<dd>
<p>
No, The Win32 GTK port does not currently support this.
</p>
</dd>
<dt>
<a name="7"><b>Where do I go from here?</b></a>
</dt>
<dd>
<p>
Check out the <?php print_link('/resources.php', 'Resources page'); ?>.
</p>
</dd>
</dl>
<?php
commonFooter();
?>