1#!/bin/sh 2# $Id: entry.sh,v 1.3 2005/12/27 15:53:06 tom Exp $ 3 4# 5# Description: 6# This demonstrates the CDK command line 7# interface to the entry widget. 8# 9 10# 11# Create some global variables. 12# 13CDK_ENTRY="${CDK_BINDIR=..}/cdkentry" 14CDK_LABEL="${CDK_BINDIR=..}/cdklabel" 15 16output="${TMPDIR=/tmp}/entry_output.$$" 17tmp="${TMPDIR=/tmp}/tmp.$$" 18 19# 20# Create the title. 21# 22title="<C> Type a simple string. " 23buttons=" OK 24 Cancel " 25 26# 27# Create the entry box. 28# 29${CDK_ENTRY} -f 20 -T "${title}" -B "${buttons}" -F "</5>_ " -O ${output} -S 30selected=$? 31test $selected = 255 && exit 1 32 33answer=`cat ${output}` 34 35# 36# Create the message for the label widget. 37# 38echo "<C>Here is the string you typed in" > ${tmp} 39echo " " >> ${tmp} 40echo "<C></R>${answer}" >> ${tmp} 41echo " " >> ${tmp} 42echo "<C>You chose button #${selected}" >> ${tmp} 43echo " " >> ${tmp} 44echo "<C>Hit </R>space<!R> to continue." >> ${tmp} 45 46# 47# Create the label widget to display the information. 48# 49${CDK_LABEL} -f ${tmp} -p " " 50 51# 52# Clean up. 53# 54rm -f ${tmp} ${output} 55