PHPsu
MANUAL ZH  |  EN
     


Current Position :| index>FAQ> Frequently Asked Questions

Frequently Asked Questions

FROM: AUTHOR: TIME:2008-04-20 HITS:
What is PHP-GTK?

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. phpsu提供的php教程

Why is it not working with the browser/web server?

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.). welcome to phpsu.com

How do I install PHP-GTK on Win32?

Download the latest binaries from gtk.php.net. 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:

phpsu.com

For Windows 98/NT/2000/XP: phpsu.com

In your PHP directory (e.g., c:\php4): phpsu is a phpschool

  • php.exe
  • php_win.exe
  • php-cgi.exe
  • php.ini
  • php.ini-gtk
  • all .dll files

In a test directory (e.g., c:\php4\test):

phpsu.com is a free phpscool

  • all .php files
  • testgtkrc
  • testgtkrc2
  • window.xpm

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.

phpsu提供的php教程

For Windows 95: www.phpsu.com

PHP-GTK has not been tested on Windows 95 ... sorry.

welcome to phpsu.com

Testing the installation www.phpsu.com

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

www.phpsu.com

To avoid the DOS box, you can use the php_win executable, provided in the install file: welcome to phpsu.com

c:\php4\php_win c:\php4\test\hello.php
www.phpsu.com

or

www.phpsu.com

start c:\php4\php_win c:\php4\test\hello.php

phpsu is a phpschool

or do you kown phpsu.com?

c:\php4\php_win -c \php4\php.ini -f c:\php4\test\hello.php

do you kown phpsu.com?

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 'Using PHP from the command line' on the main PHP site.

welcome to phpsu.com

Troubleshooting phpsu.com

If you can't produce the hello window, try the following: phpsu is a phpschool

  • Verify the hello.php location, i.e., [drive:]\php4\test
  • Open hello.php in Notepad, and make sure there is no obvious corruption in the code.
  • Modify your php.ini file, to log any errors, as detailed below.
  • Review the postings at the PHP-GTK discussion list archive for possible solutions.
  • If you still have a problem, subscribe to the PHP-GTK general discussion list and post your question there.

Tips/Tricks: http://www.phpsu.com

  • To debug your scripts, modify the php.ini file as follows:
    • Find the line for 'log_errors'. Set it to 'On'.
    • Find the line for 'error_log'. Remove the beginning semicolon (uncomment) and replace 'filename' with an actual file location
      Example: error_log=c:\php4\error_log.txt.
    • If the error file does not exist, php will create it on the next run. Open the file and review.
  • 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.
  • You can set your scripts to use Win32 themes, courtesy of Christian Weiske. Check out the info page at:
    http://www.cweiske.de/phpgtk_themes.htm
  • Install the php-gtk launcher. It handles many of the Windows directory issues and provides a series of PHP-GTK icons. Also from Christian.
  • Consider using Glade/XML for setting up your screens and reducing maintenance time. phpsu提供的php教程
    Start with the info page at: http://gtk.php.net/manual1/en/glade.gladexml.php.
How do I use the buttons in GtkFileSelection?
// 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);
phpsu.com is a free phpscool

It is not currently possible to do it this way: welcome to phpsu.com

// 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);
phpsu
How do I know which GTK Classes are supported?

The following code will show the defined classes. All the PHP-GTK classes will be listed along with one or two others. phpsu

$array = get_declared_classes();
while(list(,$classname) = each($array)) {
echo $classname."\n";
}
phpsu is a phpschool

See the Class/Object functionsin the PHP Manual for other useful functions. phpsu.com

Can I use Themes under Win32?

No, The Win32 GTK port does not currently support this. phpsu提供的php教程

Where do I go from here?

Check out the Resources page. do you kown phpsu.com?


TITLE:Frequently Asked Questions
Copyright 2008 The PHPsu All rights reserved. This mirror generously provided by: .Hp Inc.
Last updated: Fri Jun 6 22:56:39 GMT-8 2008