| |
 |
|
|
Linux Forum Index » Linux Miscellaneous Topics 2 » converting bash-scripts into GUI's...
Page 2 of 2 Goto page Previous 1, 2
|
| Author |
Message |
| Maxwell Lol... |
Posted: Tue Jul 08, 2008 12:23 pm |
|
|
|
Guest
|
Rahul <nospam at (no spam) nospam.invalid> writes:
Quote: Thanks again Robert for the detailed description. That is exactly the
situation I was facing. BTW, 10 lines of bash => 500+ C/C++ ballpark. What
about Tcl/tk, perl/tk or python/tk? Any estimates about their code
verbosities?
Depends on how much you want to put in the GUI.
Here's a sample from the perl/TK FAQ
#!/usr/local/bin/perl -w
use strict;
use Tk;
my $main = new MainWindow;
$main->Label(-text , 'Hello World!'
)->pack;
$main->Button(-text , 'Quit',
-command , sub{exit}
)->pack;
MainLoop;
And please learn to use a search engine. |
|
|
| Back to top |
|
| Maxwell Lol... |
Posted: Tue Jul 08, 2008 12:24 pm |
|
|
|
Guest
|
Rahul <nospam at (no spam) nospam.invalid> writes:
Quote: Just as Tk can be bound to perl/python/tcl/C/C++ is there a bash/tk
interface? THat would be the most straigntforward solution for me right? I
already have bash do the job. Now I need a window manager which I find in
tk. Why not just directly tie them together? Or does such a beast not
exist?
If it doesn't exist, you can always call a bash script from a perl script. |
|
|
| Back to top |
|
| Dan Espen... |
Posted: Tue Jul 08, 2008 1:14 pm |
|
|
|
Guest
|
Rahul <nospam at (no spam) nospam.invalid> writes:
Quote: Robert Heller <heller at (no spam) deepsoft.com> wrote in
news:IIqdnWFeR7ixDO_VnZ2dnUVZ_rDinZ2d at (no spam) posted.localnet:
This is all easy enough to do with Tcl/Tk (esp. with BWidget and SNIT)
and can be done with Perl/Tk or Python/Tk or one can re-write one's
10-line shell script with 500+ lines of C or C++ using Gtk or Qt...
Just as Tk can be bound to perl/python/tcl/C/C++ is there a bash/tk
interface? THat would be the most straigntforward solution for me right? I
already have bash do the job. Now I need a window manager which I find in
tk. Why not just directly tie them together? Or does such a beast not
exist?
TCL/TK.
TCL is the scripting language. |
|
|
| Back to top |
|
| Robert Heller... |
Posted: Tue Jul 08, 2008 7:07 pm |
|
|
|
Guest
|
At Tue, 8 Jul 2008 15:05:52 +0000 (UTC) Rahul <nospam at (no spam) nospam.invalid> wrote:
Quote:
Robert Heller <heller at (no spam) deepsoft.com> wrote in
news:IIqdnWFeR7ixDO_VnZ2dnUVZ_rDinZ2d at (no spam) posted.localnet:
This is all easy enough to do with Tcl/Tk (esp. with BWidget and SNIT)
and can be done with Perl/Tk or Python/Tk or one can re-write one's
10-line shell script with 500+ lines of C or C++ using Gtk or Qt...
Thanks again Robert for the detailed description. That is exactly the
situation I was facing. BTW, 10 lines of bash => 500+ C/C++ ballpark. What
about Tcl/tk, perl/tk or python/tk? Any estimates about their code
verbosities?
Nowhere near C/C++ or Java.
Tcl/tk and python/tk probably the least (Tcl/tk definitaty the least if
BWidget (and possibly SNIT) is used). 'Tk' is native to Tcl and fits
extremly well. perl/tk and python/tk actually use the 'Tk' originally
written for Tcl, but modified to be Perl-ish or Python-ish and the fit
is not as 'tight'.
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller at (no spam) deepsoft.com -- Contract Programming: C/C++, Tcl/Tk |
|
|
| Back to top |
|
| Robert Heller... |
Posted: Tue Jul 08, 2008 7:07 pm |
|
|
|
Guest
|
At Tue, 8 Jul 2008 15:09:31 +0000 (UTC) Rahul <nospam at (no spam) nospam.invalid> wrote:
Quote:
Robert Heller <heller at (no spam) deepsoft.com> wrote in
news:IIqdnWFeR7ixDO_VnZ2dnUVZ_rDinZ2d at (no spam) posted.localnet:
This is all easy enough to do with Tcl/Tk (esp. with BWidget and SNIT)
and can be done with Perl/Tk or Python/Tk or one can re-write one's
10-line shell script with 500+ lines of C or C++ using Gtk or Qt...
Just as Tk can be bound to perl/python/tcl/C/C++ is there a bash/tk
interface? THat would be the most straigntforward solution for me right? I
I am not aware of one and I would really doubt it. Although people do
what 'programs' in bash, bash is not realy thought of as a programming
language in the same sense as Tcl, Perl, or Python. I don't think bash
has any notion of 'extensibility' though the addition of a shared
library of C or C++ code for example (Tcl, Perl, and Python [as can
C/C++] can all be extended in this way).
Quote: already have bash do the job. Now I need a window manager which I find in
tk. Why not just directly tie them together? Or does such a beast not
exist?
You *could* just write a Tcl/Tk script that does nothing more than
fetch the parameters and options and print them to stdout. Run the
script using something like:
argv=`./getparameters.tcl`
then peel argv apart in place of $*...
I *suppose* it might make sense to write a generate getparameters and
options script that takes some sort of 'template' argument(s), creates a
window with all the right GUI elements and when the 'Run' button is
pressed, spits everything to stdout and exits. This script could be
used for all of your bash scripts -- each script would just need a
script-specific GUI template. This would be sort of like dialog, but
for X11 rather than an ANSI xterm. A sort of xmessage on steroids...
--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller at (no spam) deepsoft.com -- Contract Programming: C/C++, Tcl/Tk |
|
|
| Back to top |
|
| |
Page 2 of 2 Goto page Previous 1, 2
All times are GMT - 5 Hours
The time now is Fri Nov 21, 2008 1:55 pm
|
|