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


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

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. PHP, GTK, PHP-GTK
    look ma, no webserver.
  • 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
    GNOME anything.
    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.
    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
    //. FAR from a proper app,
    //. but will “work”.
    $window = new GtkWindow;
    $window->add(new GtkLabel(
    ‘Hello World’
    $window->set_title(‘Hurr Durr’);
  • 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
    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.
  • 23. bob GO show them some code
  • 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,
    Bob’s PHP-GTK Archive
    PHP-GTK Community Site
    apps, tips, sort-of-not-active-forum
  • 27. Contact and More Info
    Bob Majdak Jr
    twitter: @bobmajdakjr
    irc: #php-gtk, #dallasphp on Freenode
    dev blog:
    this talk: