SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
PHP in a Whole New World
Desktop Applications Built in PHP-GTK




                              Ben Ramsey
What Is PHP-GTK?
•   PHP extension
•   Language bindings for GTK+
•   OO Interface to GTK+ classes
•   Way to create cross-platform, portable
    GUI applications in PHP




                                        Ben Ramsey
What Is GTK+?
• Stands for “GIMP Tool Kit”
 (originally developed for the GNU Image Manipulation Program, or GIMP)

• C library used to create graphical user
  interfaces
• Central part of Gnome desktop on
  Linux, but libraries ported to Windows




                                                                  Ben Ramsey
Why PHP-GTK?
• Originally a proof-of-concept (inspired
  by PyGTK) to show that it could be
  done
• Because PHP isn’t just for the Web
  anymore
• If you need a GUI application, why not
  use your favorite language?



                                       Ben Ramsey
What this talk is not...
• Discussion on the GTK+ bindings that
  are the core of PHP-GTK
• Instructions on how to install PHP-GTK
• Introduction to PHP-GTK 2
 (that was yesterday and you missed it)




                                          Ben Ramsey
Overview
• Tutorial: pedit
• Applications:
  •   PHP-GTK Manual Browser
  •   Tulip
  •   Agata Report
  •   Deep Dungeons RPG




                               Ben Ramsey
A Brief Tutorial: pedit
• pedit is a simple text editor
• It can open text files, modify, and save
  them
• It can copy, paste, and cut
• That’s it--I said it’s simple




                                        Ben Ramsey
A Look At pedit




                  Ben Ramsey
The Code Behind pedit
<?php
if (!extension_loaded('gtk')) {
    dl('php_gtk.' . PHP_SHLIB_SUFFIX);
}
...
$w =& new GtkWindow();
$w->set_title('Untitled');
$w->set_usize(800, 600);
$w->connect_object('destroy', array('Gtk', 'main_quit'));
$w->connect('delete-event', create_function('', 'return false;'));
...
$w->show_all();

Gtk::main();
?>




                                                               Ben Ramsey
pedit’s Menu Code
<?php
/* Application menu bar */
$menu =& new GtkMenuBar();
$box->pack_start($menu, false, false);

/* File menu */
$file =& new GtkMenuItem('File');
$menu->append($file);

$file_menu =& new GtkMenu();

...

$save =& new GtkMenuItem('Save');
$save->connect('activate', 'save_file');
$file_menu->append($save);
?>



                                           Ben Ramsey
pedit’s Text Editor Code
<?php
$text_area =& new GtkHBox();
$box->pack_start($text_area);
...
/* Editable text field */
$textpad =& new GtkText();
$textpad->set_editable(true);
$textpad->set_style($textpad_style);
$textpad->set_line_wrap(false);
$textpad->set_word_wrap(false);
$textpad->connect('changed', 'text_changed');
$text_area->pack_start($textpad);

/* Vertical scrollbar */
$textpad_vadj = $textpad->vadj;
$textpad_vscrollbar =& new GtkVScrollbar($textpad_vadj);
$text_area->pack_end($textpad_vscrollbar, false);
?>


                                                           Ben Ramsey
pedit’s Actions
<?php
function save_file()
{
    global $text_changed, $loaded_file, $textpad, $w;
    if (!is_null($loaded_file)) {
         $bytes = file_put_contents($loaded_file, $textpad->get_chars(0, -1));
         if ($bytes === false) {
             save_error_dialog();
         } else {
             $text_changed = false;
             $w->set_title($loaded_file);
         }
    }
    else
    {
         file_save_dialog();
    }
    return true;
}
?>




                                                                           Ben Ramsey
PHP-GTK Manual Browser
• PHP-GTK application
• Allows you to easily browse the PHP-
  GTK manual
• Reads PHP-GTK manual HTML files
  and displays them, so it acts somewhat
  like a Web browser




                                     Ben Ramsey
PHP-GTK Manual Browser




                     Ben Ramsey
Tulip
• PHP-GTK based IDE for writing PHP
  applications
• Allows you to set up projects
• CVS controls (create, modify, and
  remove files from a remote server
  seamlessly)
• File-locking feature for added security
  when working in a networked
  environment
                                       Ben Ramsey
Tulip
• Auto-completion of PHP code
• Syntax highlighting and syntax hints
• Standard editing features (copy, cut,
  paste, search, go to, etc.)
• Embedded database navigator to
  access MySQL or PostgreSQL, make
  queries and edit or delete records


                                      Ben Ramsey
Tulip




        Ben Ramsey
Tulip




        Ben Ramsey
Tulip




        Ben Ramsey
Tulip




        Ben Ramsey
Agata Report
• Cross-platform database reporting tool
• Graph generation
• Query tool
• Support for multiple databases
  (PostgreSQL, MySQL, MSSQL, Oracle,
  etc.)
• Multiple export formats (text, HTML,
  XML, PDF, CSV, etc.)

                                     Ben Ramsey
Agata Report
• Define levels, subtotals, and a grand
  total for the report
• Merge data into a document
• Generate address labels
• Generate a relationship diagram of the
  database
• Not a database management tool; just
  a tool for reporting

                                      Ben Ramsey
Agata Report




               Ben Ramsey
Agata Report




               Ben Ramsey
Agata Report




               Ben Ramsey
Agata Report




               Ben Ramsey
Deep Dungeons RPG
• Classic RPG (role-playing game)
  written in PHP with the PHP-GTK
  extension
• Not very complex, but includes NPCs
  (non-player characters) you can interact
  with
• Includes monsters to fight
• Keeps track of your stats and hit points

                                      Ben Ramsey
Deep Dungeons RPG




                    Ben Ramsey
PHP-GTK Pitfalls
• Portable in theory, not in practice
• PHP speed good enough for the
  “Web problem;” not fast enough for
  desktop (Parrot?)
• Compiler for single executable/binary?
  (Roadsend, PriadoBlender?)




                                      Ben Ramsey
What’s Next?
• PHP-GTK 2 with PHP 5
  (binds GTK+ 2 libraries with PHP 5)
• PHP 6 on Parrot? (BIG “maybe”)




                                        Ben Ramsey
For more information...
•   PHP-GTK: http://gtk.php.net
•   GTK+: http://gtk.org
•   pedit: http://pedit.sourceforge.net
•   Tulip: http://tulip.solis.coop.br
•   Agata Report: http://www.agata.org.br
•   Deep Dungeons: http://deepdungeons.sf.net
•   Roadsend Compiler: http://roadsend.com
•   PriadoBlender: http://priadoblender.com

Questions?

                                                Ben Ramsey

Contenu connexe

Tendances

Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPPFast & Scalable Front/Back-ends using Ruby, Rails & XMPP
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPPPradeep Elankumaran
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsSATOSHI TAGOMORI
 
Synapse india reviews on php website development
Synapse india reviews on php website developmentSynapse india reviews on php website development
Synapse india reviews on php website developmentsaritasingh19866
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Yearssneeu
 
20090629 Using phpDocumentor
20090629 Using phpDocumentor20090629 Using phpDocumentor
20090629 Using phpDocumentorRimpei Ogawa
 
Build Your Own Tools
Build Your Own ToolsBuild Your Own Tools
Build Your Own ToolsShugo Maeda
 
PHP client - Mongo db User Group Pune
PHP client - Mongo db User Group PunePHP client - Mongo db User Group Pune
PHP client - Mongo db User Group PuneNishant Shrivastava
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with GruntLadies Who Code
 
Current status of PSR - Phpblt1
Current status of PSR - Phpblt1Current status of PSR - Phpblt1
Current status of PSR - Phpblt1Yui Sakamoto
 
Sanjip Shah: Internationalizing and Localizing WordPress Themes
Sanjip Shah: Internationalizing and Localizing  WordPress ThemesSanjip Shah: Internationalizing and Localizing  WordPress Themes
Sanjip Shah: Internationalizing and Localizing WordPress Themeswpnepal
 
Introduction to protocol buffer
Introduction to protocol bufferIntroduction to protocol buffer
Introduction to protocol bufferTim (文昌)
 
Introduction to programming - class 8
Introduction to programming - class 8Introduction to programming - class 8
Introduction to programming - class 8Paul Brebner
 
Vinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress siteVinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress sitewpnepal
 
Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273hussulinux
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScriptOleg Podsechin
 

Tendances (16)

Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPPFast & Scalable Front/Back-ends using Ruby, Rails & XMPP
Fast & Scalable Front/Back-ends using Ruby, Rails & XMPP
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API Details
 
Synapse india reviews on php website development
Synapse india reviews on php website developmentSynapse india reviews on php website development
Synapse india reviews on php website development
 
Web Development: The Next Five Years
Web Development: The Next Five YearsWeb Development: The Next Five Years
Web Development: The Next Five Years
 
20090629 Using phpDocumentor
20090629 Using phpDocumentor20090629 Using phpDocumentor
20090629 Using phpDocumentor
 
Build Your Own Tools
Build Your Own ToolsBuild Your Own Tools
Build Your Own Tools
 
PHP client - Mongo db User Group Pune
PHP client - Mongo db User Group PunePHP client - Mongo db User Group Pune
PHP client - Mongo db User Group Pune
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
 
Current status of PSR - Phpblt1
Current status of PSR - Phpblt1Current status of PSR - Phpblt1
Current status of PSR - Phpblt1
 
Sanjip Shah: Internationalizing and Localizing WordPress Themes
Sanjip Shah: Internationalizing and Localizing  WordPress ThemesSanjip Shah: Internationalizing and Localizing  WordPress Themes
Sanjip Shah: Internationalizing and Localizing WordPress Themes
 
Introduction to protocol buffer
Introduction to protocol bufferIntroduction to protocol buffer
Introduction to protocol buffer
 
Introduction to programming - class 8
Introduction to programming - class 8Introduction to programming - class 8
Introduction to programming - class 8
 
Golang
GolangGolang
Golang
 
Vinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress siteVinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress site
 
Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273Linux Apache Php Mysql Lamp1273
Linux Apache Php Mysql Lamp1273
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 

En vedette

ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_pythontutorialsruby
 
AHA-IFD Equity of Care Slide Deck
AHA-IFD Equity of Care Slide DeckAHA-IFD Equity of Care Slide Deck
AHA-IFD Equity of Care Slide DeckTomas Leon
 
Staff Incluson and Equality Training 2015
Staff Incluson and Equality Training 2015Staff Incluson and Equality Training 2015
Staff Incluson and Equality Training 2015Dean Rogers
 
Gender differences in risk assessmen
Gender differences in risk assessmenGender differences in risk assessmen
Gender differences in risk assessmenJose Avila De Tomas
 
Giana La Piana Urban Latino Article
Giana La Piana Urban Latino ArticleGiana La Piana Urban Latino Article
Giana La Piana Urban Latino ArticleLulaine Compere
 
Jni攻略之九――操作异常
Jni攻略之九――操作异常Jni攻略之九――操作异常
Jni攻略之九――操作异常yiditushe
 
4. Academic Transcript
4. Academic Transcript4. Academic Transcript
4. Academic TranscriptAldo Fadhillah
 
Gita Study Nov 10 Dr. Shriniwas J. Kashalikar
Gita Study  Nov 10  Dr. Shriniwas J. KashalikarGita Study  Nov 10  Dr. Shriniwas J. Kashalikar
Gita Study Nov 10 Dr. Shriniwas J. Kashalikardrsolapurkar
 
The High Performance Entrepreneur - Subroto Bagchi
The High Performance Entrepreneur - Subroto BagchiThe High Performance Entrepreneur - Subroto Bagchi
The High Performance Entrepreneur - Subroto Bagchikingsly2009
 

En vedette (13)

ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 
AHA-IFD Equity of Care Slide Deck
AHA-IFD Equity of Care Slide DeckAHA-IFD Equity of Care Slide Deck
AHA-IFD Equity of Care Slide Deck
 
Staff Incluson and Equality Training 2015
Staff Incluson and Equality Training 2015Staff Incluson and Equality Training 2015
Staff Incluson and Equality Training 2015
 
Gender differences in risk assessmen
Gender differences in risk assessmenGender differences in risk assessmen
Gender differences in risk assessmen
 
Giana La Piana Urban Latino Article
Giana La Piana Urban Latino ArticleGiana La Piana Urban Latino Article
Giana La Piana Urban Latino Article
 
Question 6
Question 6Question 6
Question 6
 
Jni攻略之九――操作异常
Jni攻略之九――操作异常Jni攻略之九――操作异常
Jni攻略之九――操作异常
 
Horror Story
Horror StoryHorror Story
Horror Story
 
4. Academic Transcript
4. Academic Transcript4. Academic Transcript
4. Academic Transcript
 
Gita Study Nov 10 Dr. Shriniwas J. Kashalikar
Gita Study  Nov 10  Dr. Shriniwas J. KashalikarGita Study  Nov 10  Dr. Shriniwas J. Kashalikar
Gita Study Nov 10 Dr. Shriniwas J. Kashalikar
 
11 18 Everlasting Flowers2
11 18 Everlasting Flowers211 18 Everlasting Flowers2
11 18 Everlasting Flowers2
 
The High Performance Entrepreneur - Subroto Bagchi
The High Performance Entrepreneur - Subroto BagchiThe High Performance Entrepreneur - Subroto Bagchi
The High Performance Entrepreneur - Subroto Bagchi
 
Sport in Kosova
Sport in KosovaSport in Kosova
Sport in Kosova
 

Similaire à PHP-GTK

Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick RethansBachkoutou Toutou
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and DesktopElizabeth Smith
 
Building a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelBuilding a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelDominic Lüchinger
 
6 3 tier architecture php
6 3 tier architecture php6 3 tier architecture php
6 3 tier architecture phpcefour
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppttruptitasol
 

Similaire à PHP-GTK (20)

Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Php on the Web and Desktop
Php on the Web and DesktopPhp on the Web and Desktop
Php on the Web and Desktop
 
Building a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelBuilding a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanel
 
6 3 tier architecture php
6 3 tier architecture php6 3 tier architecture php
6 3 tier architecture php
 
Php
PhpPhp
Php
 
test
testtest
test
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
ssfsd fsdf ds f
ssfsd fsdf ds fssfsd fsdf ds f
ssfsd fsdf ds f
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
ssfsd fsdf ds f
ssfsd fsdf ds fssfsd fsdf ds f
ssfsd fsdf ds f
 
ssfsd fsdf ds f
ssfsd fsdf ds fssfsd fsdf ds f
ssfsd fsdf ds f
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
ssfsd fsdf ds f
ssfsd fsdf ds fssfsd fsdf ds f
ssfsd fsdf ds f
 
ssfsd fsdf ds f
ssfsd fsdf ds fssfsd fsdf ds f
ssfsd fsdf ds f
 
IntroductiontoPHP.ppt
IntroductiontoPHP.pptIntroductiontoPHP.ppt
IntroductiontoPHP.ppt
 
hgfgf
hgfgfhgfgf
hgfgf
 

Plus de tutorialsruby

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 

Plus de tutorialsruby (20)

&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
TopStyle Help &amp; &lt;b>Tutorial&lt;/b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting &lt;b>...&lt;/b>
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Dernier

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 

Dernier (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 

PHP-GTK

  • 1. PHP in a Whole New World Desktop Applications Built in PHP-GTK Ben Ramsey
  • 2. What Is PHP-GTK? • PHP extension • Language bindings for GTK+ • OO Interface to GTK+ classes • Way to create cross-platform, portable GUI applications in PHP Ben Ramsey
  • 3. What Is GTK+? • Stands for “GIMP Tool Kit” (originally developed for the GNU Image Manipulation Program, or GIMP) • C library used to create graphical user interfaces • Central part of Gnome desktop on Linux, but libraries ported to Windows Ben Ramsey
  • 4. Why PHP-GTK? • Originally a proof-of-concept (inspired by PyGTK) to show that it could be done • Because PHP isn’t just for the Web anymore • If you need a GUI application, why not use your favorite language? Ben Ramsey
  • 5. What this talk is not... • Discussion on the GTK+ bindings that are the core of PHP-GTK • Instructions on how to install PHP-GTK • Introduction to PHP-GTK 2 (that was yesterday and you missed it) Ben Ramsey
  • 6. Overview • Tutorial: pedit • Applications: • PHP-GTK Manual Browser • Tulip • Agata Report • Deep Dungeons RPG Ben Ramsey
  • 7. A Brief Tutorial: pedit • pedit is a simple text editor • It can open text files, modify, and save them • It can copy, paste, and cut • That’s it--I said it’s simple Ben Ramsey
  • 8. A Look At pedit Ben Ramsey
  • 9. The Code Behind pedit <?php if (!extension_loaded('gtk')) { dl('php_gtk.' . PHP_SHLIB_SUFFIX); } ... $w =& new GtkWindow(); $w->set_title('Untitled'); $w->set_usize(800, 600); $w->connect_object('destroy', array('Gtk', 'main_quit')); $w->connect('delete-event', create_function('', 'return false;')); ... $w->show_all(); Gtk::main(); ?> Ben Ramsey
  • 10. pedit’s Menu Code <?php /* Application menu bar */ $menu =& new GtkMenuBar(); $box->pack_start($menu, false, false); /* File menu */ $file =& new GtkMenuItem('File'); $menu->append($file); $file_menu =& new GtkMenu(); ... $save =& new GtkMenuItem('Save'); $save->connect('activate', 'save_file'); $file_menu->append($save); ?> Ben Ramsey
  • 11. pedit’s Text Editor Code <?php $text_area =& new GtkHBox(); $box->pack_start($text_area); ... /* Editable text field */ $textpad =& new GtkText(); $textpad->set_editable(true); $textpad->set_style($textpad_style); $textpad->set_line_wrap(false); $textpad->set_word_wrap(false); $textpad->connect('changed', 'text_changed'); $text_area->pack_start($textpad); /* Vertical scrollbar */ $textpad_vadj = $textpad->vadj; $textpad_vscrollbar =& new GtkVScrollbar($textpad_vadj); $text_area->pack_end($textpad_vscrollbar, false); ?> Ben Ramsey
  • 12. pedit’s Actions <?php function save_file() { global $text_changed, $loaded_file, $textpad, $w; if (!is_null($loaded_file)) { $bytes = file_put_contents($loaded_file, $textpad->get_chars(0, -1)); if ($bytes === false) { save_error_dialog(); } else { $text_changed = false; $w->set_title($loaded_file); } } else { file_save_dialog(); } return true; } ?> Ben Ramsey
  • 13. PHP-GTK Manual Browser • PHP-GTK application • Allows you to easily browse the PHP- GTK manual • Reads PHP-GTK manual HTML files and displays them, so it acts somewhat like a Web browser Ben Ramsey
  • 15. Tulip • PHP-GTK based IDE for writing PHP applications • Allows you to set up projects • CVS controls (create, modify, and remove files from a remote server seamlessly) • File-locking feature for added security when working in a networked environment Ben Ramsey
  • 16. Tulip • Auto-completion of PHP code • Syntax highlighting and syntax hints • Standard editing features (copy, cut, paste, search, go to, etc.) • Embedded database navigator to access MySQL or PostgreSQL, make queries and edit or delete records Ben Ramsey
  • 17. Tulip Ben Ramsey
  • 18. Tulip Ben Ramsey
  • 19. Tulip Ben Ramsey
  • 20. Tulip Ben Ramsey
  • 21. Agata Report • Cross-platform database reporting tool • Graph generation • Query tool • Support for multiple databases (PostgreSQL, MySQL, MSSQL, Oracle, etc.) • Multiple export formats (text, HTML, XML, PDF, CSV, etc.) Ben Ramsey
  • 22. Agata Report • Define levels, subtotals, and a grand total for the report • Merge data into a document • Generate address labels • Generate a relationship diagram of the database • Not a database management tool; just a tool for reporting Ben Ramsey
  • 23. Agata Report Ben Ramsey
  • 24. Agata Report Ben Ramsey
  • 25. Agata Report Ben Ramsey
  • 26. Agata Report Ben Ramsey
  • 27. Deep Dungeons RPG • Classic RPG (role-playing game) written in PHP with the PHP-GTK extension • Not very complex, but includes NPCs (non-player characters) you can interact with • Includes monsters to fight • Keeps track of your stats and hit points Ben Ramsey
  • 28. Deep Dungeons RPG Ben Ramsey
  • 29. PHP-GTK Pitfalls • Portable in theory, not in practice • PHP speed good enough for the “Web problem;” not fast enough for desktop (Parrot?) • Compiler for single executable/binary? (Roadsend, PriadoBlender?) Ben Ramsey
  • 30. What’s Next? • PHP-GTK 2 with PHP 5 (binds GTK+ 2 libraries with PHP 5) • PHP 6 on Parrot? (BIG “maybe”) Ben Ramsey
  • 31. For more information... • PHP-GTK: http://gtk.php.net • GTK+: http://gtk.org • pedit: http://pedit.sourceforge.net • Tulip: http://tulip.solis.coop.br • Agata Report: http://www.agata.org.br • Deep Dungeons: http://deepdungeons.sf.net • Roadsend Compiler: http://roadsend.com • PriadoBlender: http://priadoblender.com Questions? Ben Ramsey