DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 16th April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default shell script with zenity

Does zenity provides full functionality in GUI programming? I check the zenity page it only gives some limited window option like --info, --question.
Code:
#!/bin/ksh
zenity --info \
--text="Terminating Program."
The above code does not print the text "Terminating Program" but" The updates are finished"
Reply With Quote
  #2   (View Single Post)  
Old 16th April 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by bsdnewbie999 View Post
Does zenity provides full functionality in GUI programming?
It merely allows dialogs to be integrated into shell scripts. So no, it does not provide complete control. Since you aren't giving any detail about what problem you are trying to solve, any answer you will likely get is going to be equally vague.

If you want complete control, look at wxWidgets, wxPython, Tcl/Tk, or Java Swing, but if I recall correctly, you have asked this very same question more than once before.
Reply With Quote
  #3   (View Single Post)  
Old 16th April 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

It's also note worthy: unless you know programming fairly well, you should not be creating GUI based software with most tool kits (although Tk bindings might make it a different story)
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #4   (View Single Post)  
Old 16th April 2009
bsdnewbie999 bsdnewbie999 is offline
Package Pilot
 
Join Date: May 2008
Posts: 145
Default

I know what's the problem now. I have another question.
Code:
#!/bin/ksh
#
OPT1='zenity --entry --text="Please input the host IP:" --title "input IP address:'
The code above does not prompt the zenity window as I put the input ip address value to OPT1. How do I make it prompt the window while save the input value to OPT1 ?

Problem solved. I substitute OPT1=$()

Last edited by bsdnewbie999; 16th April 2009 at 06:31 AM. Reason: solved
Reply With Quote
  #5   (View Single Post)  
Old 16th April 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Code:
OPT1=`zenity --entry --text="Please input the host IP:" --title "input IP address:"`
or

Code:
OPT1=$(zenity --entry --text="Please input the host IP:" --title "input IP address:")
It's all about the quotes ;-)
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #6   (View Single Post)  
Old 24th April 2009
rifqi rifqi is offline
New User
 
Join Date: Jul 2008
Posts: 3
Default

simpe script with zenity
Code:
#!/usr/local/bin/bash
input=$(zenity --text "Siapa nama anda?" --entry)
case=$?
case $case in
0)
zenity --info --text "Nama yang anda maukan adalah : $input";;
1)
zenity --info --title "batal" --text "Proses dibatalkan.";
exit 0;
esac
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script-start another process bsdnewbie999 Programming 2 23rd April 2009 07:48 PM
shell script compare md5 sum bsdnewbie999 Programming 1 11th April 2009 02:20 PM
incrementing within a shell script? spiderpig Programming 5 29th September 2008 08:12 PM
Shell Script. bsdnewbie999 Programming 21 15th July 2008 07:54 AM
shell script with input c0mrade Programming 5 13th July 2008 04:33 AM


All times are GMT. The time now is 08:55 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick