PDA

View Full Version : How to build front-end, GUI



satimis
2nd December 2004, 05:28 AM
Hi folks,

What will be the program language/solution used to build the front-end, e.g. (a simple shell command)

$ wget -r -L -nH -np --cut-dirs=3 /path/to/folder

-r -L -nH -np --cut-dirs=3 , etc. are options.

Any suggestion. TIA

B.R.
satimis

Franko
2nd December 2004, 10:50 PM
I cannot seem to understand your question. You want to build a GUI frontend to interface with the shell command? If so you can use (c/c++) and gtk or qt or wxwindows, or you could use java/swing or python and whatever graphics API you wish. Those where just a few broad ideas...

james_in_denver
2nd December 2004, 11:49 PM
If all you want is an icon on your screen that launches that as a script, just stick whatever you want into a file, do a chmod +x to make the file executable, and then just create an icon that launches the script....that's the quick and dirty way to do it, but it lacks any meaningful user interaction like you would get with a programming language....

You could also write it in perl, ruby (my preference, very clean O-O implementation), or even PHP with Gtk, or Mono, or Mozilla's XUL.....or perhaps embed it in a CGI script you can launch from a web-browser...

Jman
3rd December 2004, 01:49 AM
I would start with a bash script.



#/bin/sh

wget -r -L -nH -np --cut-dirs=3 $1

Save this script as wdown or something. Make it executable: [/code]chmod +x wdown[/code] It will download stuff to the current directory. To use: [code]wdown url

satimis
3rd December 2004, 03:04 AM
Hi folks,

Tks for your advice.

I just started learning programming, Shell script and now moving to Perl and expect to learn GUI as well.

The example is not for practical use. I wonder how to apply GUI on the example making wget option to be selected and added on a dropping list, giving the path to a directory created also on GUI to keep the file, etc.

I expect to follow Perl's route, if possible.

TIA

B.R.
satimis

satimis
3rd December 2004, 04:24 AM
Hi james_in_denver,

Tks for your advice.


You could also write it in perl, ruby (my preference, very clean O-O implementation)......I just started learning Perl and am interested to learn more about Ruby.

Google search on "ruby perl" brought me following URLs
1)
http://www.yoshidam.net/Ruby.html
http://www.yoshidam.net/perl_en.txt
2)
Ruby: Programmers' Best Friend
http://www.ruby-lang.org/en/
3)
The Ruby Language FAQ
http://dev.rubycentral.com/faq/rubyfaq.html#toc2
4)
Using the Inline::Ruby Module
http://search.cpan.org/~neilw/Inline-Ruby-0.02/lib/Inline/Ruby.pod

Which URL shall I follow? TIA

B.R.
satimis

mbokil
3rd December 2004, 05:59 AM
Take a look at Python. If you poke around FC3 you will notice that all the Redhat admin UI applications are written in python. Python can access GTK calls allowing you to make a UI in no time. If you can also get separation of presentation and business logic in your program by doing the UI in XML and Python GTK can make use of that file to pull everything together. If I had to make a small application for linux I would probably use Python and GTK. There is a reason Redhat used it to make all the nice little UI admin tools.

Jman
3rd December 2004, 10:37 PM
nmapfe (http://dag.wieers.com/packages/nmap/) is an example of a GTK+ frontend to a command line process, nmap.

james_in_denver
3rd December 2004, 11:04 PM
Well, ruby really is a VERY clean O-O implementation, and it has Gtk+ bindings as well.

Here's the starting point for ruby:
http://www.ruby-lang.org/en/

Here's are some quick reference lists of the internal operators.
http://www.rubycentral.com/ref/
http://www.ruby-doc.org/core/

Here's REXML, an excellent XML parser for Ruby.
http://www.germane-software.com/~ser/software/rexml/

Hmm, i've misplace the link I had for ruby Gtk bindings (that's the GUI programming portion of Ruby) if you can't find it googling, I can dig around a little more....let me know if I can be of any further assistance?......

Good luck with Ruby....

satimis
4th December 2004, 04:44 AM
Hi james_in_denver,

Tks for your URLs


i've misplace the link I had for ruby Gtk bindings (that's the GUI programming portion of Ruby).....Is this link;
Programming Ruby/GTK
http://ruby-gnome.sourceforge.net/programming/

B.R.
satimis

satimis
4th December 2004, 05:02 AM
Hu Jman,

Tks for your advice and link. I just browsed that link which mentions;

nmap RPM packages for Red Hat/Fedora

Network exploration tool and security scanner.
Nmap is a utility for network exploration or security auditing. It supports ping scanning (determine which hosts are up), many port scanning techniques (determine what services the hosts are offering), and TCP/IP fingerprinting (remote host operating system identification). Nmap also offers flexible target and port specification, decoy scanning, determination of TCP sequence predictability characteristics, reverse-identd scanning, and more.......The package looks like for scanning.

B.R.
satimis

crackers
4th December 2004, 05:03 AM
An easy way to incorporate GUI elements into a shell script is to use kdialog or gdialog.

satimis
4th December 2004, 05:05 AM
Hi mbokil,

Tks for your advice.


Take a look at Python. If you poke around FC3 you will notice that all the Redhat admin UI applications are written in python....Python is another programming language I like to learn. It is already in my planning.

B.R.
satimis

satimis
4th December 2004, 11:32 AM
Hi crackers,


An easy way to incorporate GUI elements into a shell script is to use kdialog or gdialog.Noted with thanks

B.R.
satimis

PFMJ
23rd December 2004, 06:24 AM
you might want to use Anjuta... it will let you make a GUI specifically for a shell command...
http://anjuta.sourceforge.net/

satimis
23rd December 2004, 08:33 AM
you might want to use Anjuta... it will let you make a GUI specifically for a shell command...
http://anjuta.sourceforge.net/Hi Anjuta,

Tks for your advice.

Merry Xmas and Happy New Year

B.R.
satimis

piedamaro
23rd December 2004, 05:31 PM
Last but not the least, there is gtk-server: it allows to use gtk calls within a lot of scripting languages like bash, lisp, python etc. :)

fcassia
18th February 2009, 08:15 AM
No, I think all the above answers are WRONG. :-)

He needs to use Zenity, which comes blunded with Fedora 10...

It's IMHO the best tool to create simple GUIs from shell scripts.

'man zenity'

ZENITY(1) ZENITY(1)

NAME
zenity - display GTK+ dialogs

SYNOPSIS
zenity [options]

DESCRIPTION
zenity is a program that will display GTK+ dialogs, and return (either
in the return code, or on standard output) the users input. This allows
you to present information, and ask for information from the user, from
all manner of shell scripts.
(...)
AUTHOR
Zenity was written by Glynn Foster <glynn.foster@sun.com>.

Hope this helps.

See also:
http://www.freesoftwaremagazine.com/columns/more_fun_zenity_shell_script_gui_interactivity

Best
FC
PS: I DO realize that this thread is 4 years old, hence I'm posting this reply in the public interest of others who might come across this one...

pete_1967
18th February 2009, 09:35 AM
No, I think all the above answers are WRONG. :-)

He needs to use Zenity, which comes blunded with Fedora 10...

It's IMHO the best tool to create simple GUIs from shell scripts.

'man zenity'

ZENITY(1) ZENITY(1)

NAME
zenity - display GTK+ dialogs

SYNOPSIS
zenity [options]

DESCRIPTION
zenity is a program that will display GTK+ dialogs, and return (either
in the return code, or on standard output) the users input. This allows
you to present information, and ask for information from the user, from
all manner of shell scripts.
(...)
AUTHOR
Zenity was written by Glynn Foster <glynn.foster@sun.com>.

Hope this helps.

See also:
http://www.freesoftwaremagazine.com/columns/more_fun_zenity_shell_script_gui_interactivity

Best
FC
PS: I DO realize that this thread is 4 years old, hence I'm posting this reply in the public interest of others who might come across this one...

You are replying to a five year old thread mate. At that time Zenity had barely been added to Freshmeat as a project and FC3 was all the rage. Saying everyone was wrong in their advice is bit heavy.