Although you can run your tk apps locally, probably you'll want to do what I do, run the client app (remember X is backwards) on a server. The X server will essentially convert your workstations into graphics terminals (that's the way I think of it). This will work over the internet, my server is fifty feet away from the workstations but it could be 3000 miles.I saw someone mention that tk was the better route to go for a UI then a web interface. I have several office applications that I have written that I was going to write html interfaces for. I would love to avoid having to learn web development to :) Can anyone give me a break down on what tk is and how easy it is to pick up? I have several projects that are just about finished minus any real GUI. Also any web resources or book recommendations would be nice. Thanks
Paul
Hi Perl, I've got two Perl/TK apps in production, running on a database server (Red Hat Linux/MySQL) and Windows XP workstations. First of all, in my environment, yes, we do need to have an X server for Windows installed on the Windows workstation. Just in case you don't know, perl/tk is built on X, the Unix GUI, and X is backwards. What you typically think of as the server is the client, and vice-versa. I don't know for sure what's going to happen if you run a Windows server and Windows workstation.
The X server we use is called Hummingbird Exceed. It's a shrink-wrapped product, meaning $. But it works well. You may also want to try Cygwin, Red Hat's Linux-like emulation for windows. I couldn't get it to connect, but I really didn't know what I was doing at the time (like I know what I'm doing now... :-) ). Just to get started, whatever kind of workstations you have, Cygwin, Windows, Linux disable any firewall you have on it. On cygwin and linux you may wish to run "xhosts +". I can hear them screaming out there. I know, this is INSECURE, but just as a temp convenience to get started...Remember to turn security back on when you're done.
Superiorities of tk: You don't have deal with the "statelessness" of multi-page web apps, what with tracking who downloaded what page, and who posted what to what (I'm not a web developer, so I really don't know what's involved here). Users log into your server and and just become plain old processes running a plain old program, essentially identical to you running a program locally on the box.
You have more widgets. controls and so forth. The general appearance, font selection is reputed to be better. X is also reputed to be more secure than the Windows GUI, due to the fact that X messages are "advisory" rather than "compulsory" as per Windows. There are some advisories and raves about this out on the web.
perl/TK follows the Unix philosophy that presentation should be separated from back-end database manipulation. I think this is a good thing. I used to program in Visual Foxpro, which utilized controls bound to data sources, and believe me, that stuff really didn't like to work.
Perl/TK is all text-based, there is no "Form Designer" or any environment where you drag and drop controls. Unix people hate doing this stuff, anyway. What it does have is something (actually four things) called "geometry managers" which are roughly similar to the "align controls" functionality you would find in a form designer, but on steriods. Kinda in the same sense that perl is similar to search & replace in MS Word :-). Bottom line is, if you like clicking and dragging, you may not like tk. If you like to think abstractly, tk is probably for you.
However, like Visual Foxpro, and I presume VB, tk is event driven, and and it will respond to events and messages OTHER THAN the ones you think you are sending it. If you don't exactly understand that, just wait, you will :-). "Mastering perl/TK" advises staying away from entry field validation on the focusout event, and it's right. This is what I had the most trouble with.
The focusout event will fire when you change from your TK app to another program (like word or Excel). I but haven't figured a way around. However, I get the sense that perl/TK is not strictly "business oriented" like VFP or VB, meaning data entry forms, and that people use it for graphs, games, etc. So. IMHO, just don't try to validate every social security number and date instantaneously right up in your user's faces, you probaby won't get what you want.
It's got features I haven't investigated, like the IPC stuff, talking to sockets, etc. "Mastering Perl/TK" talks about implementing a web browser in perl/tk.
How easy is it? Not bad. If you've programmed another GUI you'll recognize the concepts. I did my two apps a hell of a lot faster that the first things I did in VFP.
"Have the appropriate amount of fun"
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]