The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Graphical interface programming in FreeBSD Sergiu-IT BSD 3 04-15-2005 06:40 PM
How change GRUB command line to graphical interface? lee_chongeu Linux 4 04-01-2004 02:09 AM
How to change the GRUB command line to graphical interface? lee_chongeu Shell Programming and Scripting 1 03-15-2004 08:51 AM
Graphical Interface OOnegative UNIX for Dummies Questions & Answers 11 07-04-2003 12:21 AM
graphical interface via remote login guanglei_li UNIX for Advanced & Expert Users 3 03-20-2002 01:51 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-02-2009
jack2 jack2 is offline
Banned
  
 

Join Date: Mar 2009
Posts: 47
How to build graphical interface using shell scripts and ncurses library ?

Hi,

(please don't move this question, as it refers to graphical animation solution, using shell scripts and a number of known graphical objects
and using of foreground and background process switch control shell scripts to get objects with refresh/ animation effect).

I will provide you with more details, describing the problem.

I am trying to learn and build graphical user interface for a Unix system,
accessed from MS Vista OS via putty opened terminal session, using shell scripts and box widgets from dialog.

One good example I am just testing is Unix dialog widgets

I attach below help file of dialog, to let you know, what widgets or boxes are already available.

I have already contacted Thomas. The problem is dialog project is 15 years old and no more maintained.
Based on ncurses library.

The key idea is
"
Usage: dialog <options> { --and-widget <options> }
where options are "common" options, followed by "box" options
"
So with --and-widget syntax, in theory, I can use more than 1 widget box
on a screen, and move between boxes, using tab.
In theory.
In practice such objects should be run in background to be kept alive for all the time, or a shell script displaying boxes should loop box objects to get animation, data refresh effect.


As only one object is run in background
tailboxbg
there is an excellent example
how to write a shell script, opening 3 widgets (boxes ) on a screen
and using tab to swap between boxes.

Example :
dialog --keep-window --begin 2 2 --yesno "" 0 0 \
--and-widget --keep-window --begin 4 4 --yesno "" 0 0 \
--and-widget --keep-window --begin 6 6 --yesno "" 0 0

I get 3 yesno windows on a screen.
Unfortunately clicking on yes in first box opens 2nd box and clicking yes in 2nd box, forces 3rd box to open.

The above process is called chaining or otherwise.

And I cannot use tab to switch between boxes, as clicking on yes, closes
widget application and what is seen is --keep-window (graphics only, not a object).

So my idea is to put each object into seperate shell script
and find out a solution and procedure, to run some shell scripts in background and have --keep-window for and in each shell script on.

I don't know how to set shell script as a background process & ?
And switch between background and foreground to get refresh effect.

Exactly. I am looking shell script solution, as dialog widgets use examples come as shell scripts.

I can't expect to write new boxes on myself in due time, as c + ncurses code looks really complicated.

thanks

Jack
------
dialog help
[admin@oo root]$ dialog
cdialog (ComeOn Dialog!) version 1.1-20080819
Copyright 2000-2007,2008 Thomas E. Dickey
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

* Display dialog boxes from shell scripts *

Usage: dialog <options> { --and-widget <options> }
where options are "common" options, followed by "box" options

Special options:
[--create-rc "file"]
Common options:
[--ascii-lines] [--aspect <ratio>] [--backtitle <backtitle>]
[--begin <y> <x>] [--cancel-label <str>] [--clear] [--colors]
[--column-separator <str>] [--cr-wrap] [--default-item <str>]
[--defaultno] [--exit-label <str>] [--extra-button]
[--extra-label <str>] [--help-button] [--help-label <str>]
[--help-status] [--ignore] [--input-fd <fd>] [--insecure]
[--item-help] [--keep-tite] [--keep-window] [--max-input <n>]
[--no-cancel] [--no-collapse] [--no-kill] [--no-label <str>]
[--no-lines] [--no-ok] [--no-shadow] [--nook] [--ok-label <str>]
[--output-fd <fd>] [--output-separator <str>] [--print-maxsize]
[--print-size] [--print-version] [--quoted] [--separate-output]
[--separate-widget <str>] [--shadow] [--single-quoted] [--size-err]
[--sleep <secs>] [--stderr] [--stdout] [--tab-correct] [--tab-len <n>]
[--timeout <secs>] [--title <title>] [--trace <file>] [--trim]
[--version] [--visit-items] [--yes-label <str>]
Box options:
--calendar <text> <height> <width> <day> <month> <year>
--checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
--dselect <directory> <height> <width>
--editbox <file> <height> <width>
--form <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
--fselect <filepath> <height> <width>
--gauge <text> <height> <width> [<percent>]
--infobox <text> <height> <width>
--inputbox <text> <height> <width> [<init>]
--inputmenu <text> <height> <width> <menu height> <tag1> <item1>...
--menu <text> <height> <width> <menu height> <tag1> <item1>...
--mixedform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>...
--mixedgauge <text> <height> <width> <percent> <tag1> <item1>...
--msgbox <text> <height> <width>
--passwordbox <text> <height> <width> [<init>]
--passwordform <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
--pause <text> <height> <width> <seconds>
--progressbox <height> <width>
--radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
--tailbox <file> <height> <width>
--tailboxbg <file> <height> <width>
--textbox <file> <height> <width>
--timebox <text> <height> <width> <hour> <minute> <second>
--yesno <text> <height> <width>

Auto-size with height and width = 0. Maximize with height and width = -1.
Global-auto-size if also menu_height/list_height = 0.
---
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0