Your SlideShare is downloading. ×
Lone Star PHP - PHP-GTK - Bob Majdak Jr
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Lone Star PHP - PHP-GTK - Bob Majdak Jr

1,142
views

Published on

The slides from the presentation I gave at Lone Star PHP in Dallas on June 11th 2011.

The slides from the presentation I gave at Lone Star PHP in Dallas on June 11th 2011.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,142
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. PHP, GTK, PHP-GTK
    look ma, no webserver.
    http://joind.in/2980
  • 2. What is php?
    For the sake of completeness
  • 3. What is GTK?
    Boxes, buttons, and sliders, oh my!
  • 4. GTK was... GTK is...
    Original UI toolkit for GIMP.
    GIMP Tool Kit
    Now the basis of GNOME and lots of software.
    GNOME Tool Kit. (sarcastic groan)
    C Library. Bindings in almost any language ever
    C++, D, ...
    Java, Python, Perl, ...
    Oh, and PHP
  • 5. GTK Applications
    GIMP
    GNOME anything.
    Transmission
    Banshee
    Pidgin
    Apps roll custom UI kits for GTK or QT purists
    Firefox, The suite formerly known as OpenOffice.
  • 6. so why not php and gtk
    ^_^
  • 7. PHP-GTK is...
    A client side application library.
    Will not run in a webserver. In fact your webserver will catch fire.
    I have seen it happen twice.
    NOT for building webpages. Remember: fire.
  • 8. PHP-GTK Pros
    PHP is easy fun.
    PHP Object Orientation fits well with a widget toolkit mindset.
    Linux systems probably already have PHP CLI accessible.
    Multiplatform.
    Download unzip and go on Windows.
    Package manager + some compiling on Linux.
    MacOS is not fun to setup. But it can happen.
  • 9. PHP-GTK Cons
    PHP is “slow”
    PHP is kind of single thread mostly.
    Windows users are like “lolwut?”
    The concept of an exe binary does not exist.
    Actually it does, but it is the official position of the devs to not even attempt to support blendering.
    Perfectly reasonable way around this
    MacOS is a pain to setup.
    4:39:15 PM Greg: So let me see, you used Linux software to run the Windows binaries of Linux libraries through a web programming language on Mac... so that you could use a text editor?
    4:39:34 PM Bob: yeah :D
  • 10. Quick peek at some PHP-GTKs
    <?php
    //. FAR from a proper app,
    //. but will “work”.
    $window = new GtkWindow;
    $window->add(new GtkLabel(
    ‘Hello World’
    ));
    $window->set_title(‘Hurr Durr’);
    $window->show_all();
    Gtk::main();
    ?>
  • 11. What can we do with php-gtk?
    The right answer is almost anything.
  • 12. PGID3, An MP3 Tag Editor
  • 13. Ambst, Ambient Star Trek >_>
  • 14. Prana, Removable Media Launcher
  • 15. how about some heavy lifting
    Nice tiny apps but...
  • 16. LiveCD Installer?
  • 17. Package Management?
  • 18. Repository Management?
  • 19. Network Configuration?
  • 20. quick pre-demo pointers
    lets see some code already.
  • 21. Desktop App Requirements
    Applications must know how to initialize themselves.
    Loading, caching, building UI, handling input.
    Applications must know how to terminate themselves cleanly.
    SEGFAULT is not a valid choice, though humorous.
    Clean up files, swaps, connections, last second saves, etc.
  • 22. How it works...
    Execute PHP application
    PHP app loads whatever config, init whatever UI, and exposes itself to you
    PHP app hits the main loop
    Gtk::main();
    This keeps your script alive in the GTK loop so that it can answer to things like mouse clicks.
    PHP app breaks the loop when done.
    Gtk::main_quit();
  • 23. bob GO show them some code
    SRSLY, CODE... NAO
  • 24. Some Widgets
    Windows. GtkWindow, GtkDialog
    Buttons. GtkButton
    Text Labels. GtkLabel
    Text Entry. GtkEntry, GtkTextView
    Dropdown Menus: GtkComboBox
    Radio Buttons: GtkRadioButton
    Progress Bars: GtkProgressBar
  • 25. The power comes from EXTENDS
    GtkWindow is boring.
    bobWindow extends GtkWindow
    Sets default title, icon, builds internal UI.
    This is how apps are made.
  • 26. Resources
    PHP-GTK Manual, http://gtk.php.net
    Bob’s PHP-GTK Archive
    http://oops.opsat.net
    http://squirrelshaterobots.com
    PHP-GTK Community Site
    apps, tips, sort-of-not-active-forum
    http://php-gtk.eu
  • 27. Contact and More Info
    Bob Majdak Jr
    twitter: @bobmajdakjr
    irc: #php-gtk, #dallasphp on Freenode
    dev blog: http://squirrelshaterobots.com
    this talk: http://joind.in/2980

×