Announcing PHP-GTK
whyDNA? sends us this news bit: "I found this on the PHP page: The first release of PHP-GTK is now available. PHP-GTK is a PHP extension that provides an object-oriented interface to GTK+ toolkit and enables you to write client-side cross-platform GUI applications. For more information, visit gtk.php.net."
It's called "room for growth". It's not a bad thing. Otherwise, all those people who learned PHP will discover that they wasted their time when they run into the limits of the language.
We try to push everything (languages, OS's, apps) to try to be everything to everyone. PHP is great for what it is. If you want to create a GUI, use something that was built for it the ground up for it.
Oh, piff! With the exception of Visual Basic and kindred proprietary RAD languages, there are no significant languages out there that were "designed from the ground up" for GUIs. (Java is arguable, but still...) I'm not even sure what it would mean for a language to be designed for GUIs, or how it would differ from any existing procedural or OO language. Make window a reserved word? Whatever.
The fact of the matter is that most GUI API's are grotesquely complex and present a steep learning curve for a beginner or someone who just wants to write a simple graphical frontend for a tool. Tcl/Tk has heretofore been the only exception worthy of note, but Tcl has its own host of problems including limited compatibility between versions and its DOS-batch-language-gone-wild syntax. Python is probably a better language (than PHP or Tcl), but PHP has the advantage of presenting a gentler learning curve for anyone who already knows C, minus all of the implicit syntax that makes Perl so difficult for newbies.
If you want to create an interactive database driven website (and you don't know perl) use PHP.
PHP is a lot easier to use than mod_perl or Mason for lightweight tasks. I use all of the above, and only use Perl when the situation is sufficiently complex to call for it. It's also a helluva lot easier to configure.
I hope this doesn't ever work itself into the main distribution of PHP... More bloat.
Consider learning to edit your makefiles if it ever does. A Gtk extension to PHP would only be appropriate to the standalone build, not the Apache module.
--
Proud member of the Weirdo-American community.
I'm pretty sure you're getting this totally wrong.
;-)
This is nothing to do with using PHP in web pages at all. In fact, it's nothing to do with web pages.
This about using PHP as a script interpreter, just like you use perl or python as a script interpreter.
So this certainly won't allow you to embed GTK applications in web pages: that would be neat, but would require a browser-plugin at the client end, and require the PHP code to be send to the client end. So the client would need the PHP interpreter.
It won't allow you to embed gtkhtml in IE, either
Jules
-- Any sufficiently advanced technology is indistinguishable from a perl script.
Looks like PHP is looking to become a "real" language. Good to see. Our library folks wrote a time-card entry system using swipe cards with PHP and didn't know squat about the language when the wrote it. It's a great language for beginners and experts alike
If you aren't part of the solution, there is good money to be made prolonging the problem
Don't get me wrong, I love PHP - I wrote "BlackNova Traders" using PHP and MySQL... and the language rocks for web programming... but that was its intended use.
I don't want to see PHP lose its focus and purpose - it isn't a general use language... if you want one, there are plenty (C/C++, perl, and even java for example). PHP is meant for dynamic kick-ass web-page creation.
BlackNova Traders
We try to push everything (languages, OS's, apps) to try to be everything to everyone. PHP is great for what it is. If you want to create a GUI, use something that was built for it the ground up for it. If you want to create an interactive database driven website (and you don't know perl) use PHP.
I hope this doesn't ever work itself into the main distribution of PHP... More bloat. My webserver doesn't like it already...
Gyp.
Would this fit the bill? Being that I can almost directly translate PHP to ASP and vice versa, and that ASP is the web language descendent of VB, does this mean we now have a VB for Linux? If so, cool!
No, Thursday's out. How about never - is never good for you?
I'm the author of PHPTriad and would like to point out that I've got a testing version of PHPTriad 2.0 available which I consider much more stable and complete than the version that download.com is pointing to. It's linked from a news story on www.phpgeek.com.
LetterJ
Head Geek
The Glass is Too Big: My Take on Things
Have you ever written a GUI in Java? Swing is still a horrible pile of crap.
The GTK toolkit for Windows is rather stable in my experience. I've used it with an IDE and for some MySQL tools on nt4 and 2000. It isn't yet used very often, but that doesn't mean that a) it doesn't exist or b) it isn't stable.
I think this is great news. I've been dealing with signed Java applets for years now, and they're a needlessly difficult thing.
Well since its php related, I setup a mirror incase of any slashdot like effect. This seems really useful. the mirror is locate here:http://dev.sig.mine.nu/~jbardin/php-gtk-0.0.1 .tar.gz. I hope this helps.
behold the power of SiG.
Jon Bardin
Yeah, seriously, I mean... this license ISN'T THE GPL. Somebody get a rope. [/sarcasm]
Why is OO the holy grail? Why does everything have to be done by the GPL? Why must everything that comes out fit into the little box that you find acceptable?
Apparently, PHP-GTK gets by with linking to version 4 because GTK is released under the LGPL.
I'm surprised Richard Stallman hasn't released a blistering condemnation of the project yet.
The Web is like Usenet, but
the elephants are untrained.
Sure.
:-(], which should be pretty explanatory.
www.php.net/manual. The manual is great. You can learn everything you need to know about specific things from there. Before that, you need a basic tutorial.
A PHP page looks like this:
<html>
<title>Hello</title>
<form action=<?php print $PHP_SELF; ?>
<input name=message>
<input type=submit>
</form>
<?php
print $message;
?>
Try that. Also, to get hold of PHP, use PHP Triad (on Linux, you can probably install it from your distribution CD), a win32 installer of PHP, Apache and MySQL.
Basically:
PHP is HTML with the code embedded between blocks starting
<?php
and ending
?>
within that you put your PHP code.
For example:
<?php
print "hello";
?>
would display hello - just like perl.
Similarly, as in Perl, variables are preceded by $.
So:
<?php
$message="chese";
print "I like $message";
?>
It's convenient - all form variables get put into variables of the same name:
<form action=apage.php>
<input name=thing>
<input type=submit name=action value=Submit>
</form>
would send apage.php two variables - $action='Submit'; and $thing= whatever you typed in there.
You should investigate PHP's object-orientation functions too. Here's an example class [class omitted due to slashdot's lameness filter
Anyway, start here; read here for more, as well as here. Also subscribe to the mailing list at php-general@lists.php.net for help from others.
--
Hi!