Criando Aplicações Gráficas com PHP-GTK2

Criando Aplicações Gráficas com PHP 2007 EditionPablo Dall'Oglio has just announced his 2004 book about PHP-GTK Criando Aplicações Gráficas com PHP has been updated to a second edition covering PHP-GTK2, available from his publisher Novatec.

For a limited time, a discount is available with the code "novogtk" from the publisher's site.

Quoting from Pablo's mail to the PHP-GTK lists:

Blogging about PHP-GTK

If you are logged in to the site (instead of passing by anonymously) you may have noticed the small, dark, lowercase "b" marks which started appearing today on the "Recent pages", "Community", and "Manual Updates" blocks in the right column of the site.

These are the most visible sign of a new feature on the site: registered members now have their own blog on the site, and blogging about a manual update, community story or recent page is just one click away.

Grabbing a screenshot with Gdk

From Widget to Pixbuf

Need to grab a screenshot in your program? Or maybe you just need to create an image from an existing GtkWidget. There's an easy way to accomplish both tasks using GdkPixbuf::get_from_drawable();

To use the method you'll need two things - an empty GdkPixbuf and the "drawable" (GdkDrawable) associated with your widget. Most widgets will have a GdkWindow located in $widget->window. You can get the entire screen, however, by using Gdk::get_default_root_window();. Now for the code examples...


GtkProgressBar example in fraction modeThis code shows how to use a GtkProgressBar in "fraction" mode, in which the progress bar advances from one side to the other.

It also demonstrates how Pango integration allows the text to be automatically ellipsized to fit within a given rectangle : try resizing the window to see what happens with the text.

Syndicate content