This is a tiny tool that allows you to launch the built in PHP 5.4 HTTP test server with a few clicks. It allows you to select which PHP binary you want to use (in case you have multiple on your system) and the document root of the test server.
100883 items (271 unread) in 22 feeds
MSNBC
(15 unread)
PHP
(62 unread)
Deals
(157 unread)
Web Development
(35 unread)
Frugal Blogs
(2 unread)
There are some very good tutorials for doing some basic or a bit more advanced things in php gtk cairo. However it is logical that they do not cover everything.
But luckily one can go further in using cairo by him self, I provide a single and very simple example script that allows you to discover all by your self things like:
This script gets a descedant (child) widget by name using recursion. A name should be defined for the child previously, if not as a name is considered the class name.
The name is passed as a variable by reference, when the target is found it is stored in this variable.
This will change the variable type from string to object, this very information is used as a condition to stop further recursion.
This is about simple random walk (as defined in theory). Uses the cairo library. A ball walks randomly on the screen and leaves a trace behind.
This is about simple random walk (as defined in theory). Uses the cairo library. A ball walks randomly on the screen and leaves a trace behind.
" />
Defined probability for the next step to walk is 0.5. Probabilities for left step and other parameters are pre-defined however someone can change them from inside the constructor at will. Accepted probabilities are from 0 to 1, also -1 is accepted, this indicates that the program choses on its own the probability for the next step to walk. The purpose of this is to show the the usage of cairo library!
<?PHP
//Definition of widgets
$scrolled_win = new GtkScrolledWindow();
$textview = new GtkTextview();
$buffer = new GtkTextBuffer();
$win = new GtkWindow();
//Modify widgets
$scrolled_win->set_policy(1,1);
$textview->modify_font(new PangoFontDescription('Courier New 14'));
$win->maximize();
$win->connect_simple('destroy', array('Gtk', 'main_quit'));
//Pack widgets
$scrolled_win->add($textview);
$textview->set_buffer($buffer);
$win->add($scrolled_win);
/*** Get tags table ***/
$tag_table = $buffer->get_tag_table();
/*** Create and add tag ***/
//underline
<?php
// Definition of widgets
$scrolled_win = new GtkScrolledWindow();
$textview = new GtkTextview();
$buffer = new GtkTextBuffer();
$win = new GtkWindow();
// Modify widgets
$scrolled_win->set_policy(1,1);
$textview->modify_font(new PangoFontDescription('Courier New 14'));
$win->maximize();
$win->connect_simple('destroy', array('Gtk', 'main_quit'));
// Pack widgets
$scrolled_win->add($textview);
$textview->set_buffer($buffer);
$win->add($scrolled_win);
/*** Get tags table ***/
$tag_table = $buffer->get_tag_table();
/*** Create and add tag ***/
// underline
This script displays a 2D array inside a textview. All elements on the same row and coloumn are underlined and colored blue.