Jump to content

Php-gtk


shadowayex

Recommended Posts

I've been looking at working with PHP-GTK in making applications. "Why?" you may ask. Because it exists and I want to try it =D.Anyway, I was wondering how that worked. If I wrote an application using it, would the users have to have GTK and/or PHP installed on their computer? How does that work?

Link to comment
Share on other sites

Well dang it :). Ah well, I'm still going to play with it in my spare time. I'm having a hard time learning other programming languages. Every time I want to do something I find out I need to know something else. For example, I wanted to learn threading. The tutorials I found assumed I knew how to use Win32. I can't even find a tutorial for Win32 in C++. Found some good ones in C, but the compiler I was using wouldn't allow me to compile C++ in a C project =/. I'm heading to college soon, but I still want to make some kind of decent program. I figured PHP-GTK would be close enough the PHP that I'd be able to use it effectively. Anyway, thanks for the info.

Link to comment
Share on other sites

Learn Java! It incorporates all the features of a modern object-oriented programming language (e.g. threads) without all the hassles of vendor-specific libraries, memory management, and all the other things you get with low-level compiled languages like C.For usage on the Windows API, did you try the MSDN?Note that in production, if an application was written in PHP and used the GTK, then the installer would just install those libraries for the end user if they didn't have them already (e.g., try installing Pidgin).

Link to comment
Share on other sites

C is hardly low-level really, the fact it's portable is the main distinction between low and high level (at least for me) compared to Assembly which is machine specific.C++/Win32 not working in a C project is hardly surprising, because it likely uses a C compiler, and that was never going to work. I certainly wouldn't recommend learning things like thread handling from online tutorials by the way, and if you do make sure they come with a recommendation.If you are interested in using C++, then personally I would recommend looking into the Qt toolkit (rather than win32 or gtkmm), it's a very robust toolkit which is incredibly cross-platform, including things like GUI libraries (and it's much nicer in that respect to work with than AWT/Swing), threading, networking, etc. C++ would probably be best learned from books, like Accelerated C++.Java is an option, I don't like it much myself, I don't like the design principles behind it. It does work though. Qt is in most ways superior to the parallels Java provides (even in the case of the number of supported platforms once you're written the code), the main difference is of course that C++/Qt does not have a Garbage Collection system (though C++'s RAII can make memory management fairly straight forward, and when you're handling it correctly it's more efficient than GC).

Link to comment
Share on other sites

With Java, they would have to have the runtime environment, and correct me if I'm wrong, but there's no Linux version of that. It's worth looking into for Windows and Mac apps though.I was told learning Win32 API would be more useful for my purposes than MSDN. I honestly didn't bother to ask the difference, so if there is one, kindly let me know.I looked into QT at one point, but I couldn't even understand how to get the libraries or whatever. My experience with linker == null. I don't know how to do a lot of that and I've found no where that has been able to explain it to me. I use Geany as my compiler (as well as everything else I do with any kind of programming, web or computer). So if you can teach me that, I'd gladly try to hack through some more tutorials.The key for me is tutorials. I cannot afford books. I barely afford what I do have and there's not much extra to pass around. I know online references aren't the best route, but they're my only route and I feel I've learned quite a bit in the last couple years just from online things. That being said, you should now easily be able to understand my frustration.For me to be able to learn anything, I need two things, a tutorial, and a forum to ask 1,000,000 questions in.

Link to comment
Share on other sites

There is a Java runtime for Linux, and you can build apps which are mostly self-contained for each platform.It's Qt not "QT", largely to try to avoid ambiguity with QuickTime. Shame that you can't afford to buy books, but that's not necessarily a problem for C++/Qt because I happen to know of some free ebooks.C++: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.htmlQt: http://www.qtrac.eu/C++-GUI-Programming-with-Qt-4-1st-ed.zip (the second edition is out, so they made the first edition freely available)Also: http://qt.nokia.com/developer/getting-startedAs to getting the libraries, well, depends on the platform. There is an SDK download though these days which includes the development libraries and QtCreator which is Qt Software's specialised IDE for C++/Qt development. It can be configured to use multiple make systems / compilers, but you'd probably be using GCC or Microsoft's Visual C++ IDE's compiler. Both of which are suitably standards compliant these days.When you've built the app you can then compile with static linking if you want to distribute a binary that doesn't depend on the downstream user having Qt on their system.

Link to comment
Share on other sites

I was told learning Win32 API would be more useful for my purposes than MSDN. I honestly didn't bother to ask the difference, so if there is one, kindly let me know.
MSDN, the Microsoft Developer Network, is a resource for information about developing for Microsoft platforms. The Windows API is the actual libraries you use to interact with Windows.
With Java, they would have to have the runtime environment, and correct me if I'm wrong, but there's no Linux version of that. It's worth looking into for Windows and Mac apps though.
Java has runtimes for virtually every operating system out there - being the sort of language it is, maximum portability is vital (after all, their tagline is "write once, run anywhere")...Also, look in your local library, they sometimes have good books (usually not the latest ones but for concepts they are still good).
Link to comment
Share on other sites

Alright so Java is an option. That's cool.I'll also look at those eBooks and see what they've got to offer. Thanks for the info guys.Also, I'm still going to try out some PHP-GTK stuff. I'm waiting for my college semester to start and it'll give me some stuff to do.

Link to comment
Share on other sites

It might be worth it to at least take a good look at C++ or Java, at least if you're going into computer science classes. If you're not, then it doesn't really matter.But, for what it's worth, in my entire 5.5 years in college (I didn't want to leave), we never even touched on PHP or any type of scripting language. Everything was mostly theory and data structures, with various languages used as examples for different things. A decent understanding of either C++ or Java will go a long way for you in computer science classes.Also, if you're still finding worth, don't worry about focusing on interfaces. The GTK libraries are nice and all, but the interface doesn't make one bit of difference if the application doesn't perform well (corollary: a well-performing application with a useless interface doesn't do anyone any good). But, my classes never focused on snazzy interfaces, everything was algorithms and data structures. That's the part that really makes the application useful.Also, if there is yet worth, I didn't have a good understanding of any programming language at all when I started my classes.

Link to comment
Share on other sites

I'm working more towards software engineering at this point, but there will be computer science.Anyway, I've looking into C++. I know the basics of data structures from that. I never got far as I was never able to get the hang of anything that I could use for GUIs. Painful set back.I'm working on Java now. A lot about OOP in it and I'm learning a lot. I hope to be able to code some kind of working application with a GUI (even if it's a very simple program that doesn't do a whole lot) by the time my college courses start in. A lot of my degree focuses on the base level of computers and programming them. Not a lot of Programming language learning in the core. Like you said, algorithms and data structures. I figured if I know a few languages, in my spare time I could practice with practical application of the principles I learn by writing small programs for this and that.

Link to comment
Share on other sites

There's definitely a lot of Computer Science in Software Engineering, since engineering is largely applying scientific techniques and rigour to the development and construction of projects. You need the CS foundation to build the SE on.A lot of universities will now do at least one module with Java so the experience won't go to waste, and there will be some learning of programming languages - it's a necessity to make sure that the entire class has sufficient knowledge with the module's chosen language so that you can demonstrate the concepts. And there should be practical work which incorporates the concepts you learn built into the course. You may also find that they use C or C++ (or actually, a fairly common language for degree-level courses introductory programming module is scheme, a lisp derivative in the functional paradigm) but that depends on where you're applying to. I would expect you could be writing GUI Java apps within a week or two, it's not that hard to pick up.You might consider looking into C++ again after you've got a bit more experience programming in something like Java, I'd certainly recommend learning C or C++, even if you decide you then want to stick with Java. But you can never be sure what language you'll be asked to work with in industry, so a solid understanding of memory management concepts will help you to fit into a wider array of jobs.

Link to comment
Share on other sites

That's some good advice. You're right, never know what I'll have to use. I really appreciate all the advice and suggestions. I start college in a couple months, but my heavy degree courses don't start until next fall. Hopefully by then, I can have enough experience in languages that I can focus mainly on concepts and algorithms.I really appreciate any and all advice given. I'm hoping to not stay a poor man my entire life =D.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...