LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-13-2004, 07:41 AM   #1
(tm)
Member
 
Registered: Mar 2004
Location: Wrocław, Poland
Distribution: Fedora 2
Posts: 31

Rep: Reputation: 15
A Simple Messagebox


Hi guys!

What do i have to do to pop a message box with a message and OK button? Is there a console command to do it? If not what libraries do I need?

Any help appreciated!

Cheers!
 
Old 04-13-2004, 11:39 AM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
The simplest way I know of is the 'xmessage' command-line program. Try:

xmessage Hello World

Read the man page for other options like which buttons to display, etc.
 
Old 04-13-2004, 03:06 PM   #3
Andy@DP
Member
 
Registered: Aug 2003
Posts: 208

Rep: Reputation: 30
Hi wapcaplet,
is there a similar way to do a KDE/Gnome popup?

Thanks,
Andy.
 
Old 04-13-2004, 04:48 PM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
There is "Xdialog" (note case), a GTK thing. In debian the package is called "xdialog".
 
Old 04-13-2004, 06:02 PM   #5
Andy@DP
Member
 
Registered: Aug 2003
Posts: 208

Rep: Reputation: 30
How do you use the Xdialog? I know you said GTK so can that be called from a bash script?

Thanks again.
 
Old 04-14-2004, 10:59 AM   #6
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally posted by Andy@DP
How do you use the Xdialog? I know you said GTK so can that be called from a bash script?
Yes. It's made for that. Try:
Code:
#!/bin/bash

if Xdialog --yesno "Yes or No"  10 30 ; then
	echo "huh huh...you said \"yes\""
else
	echo "so \"no\" it is..."
fi
And here's an example for a progress bar in Xdialog from a bash script:
Code:
#!/bin/bash

PIPE="/tmp/pipe_$$"
set -m

mkfifo "$PIPE"
Xdialog --ignore-eof --gauge Aloha 10 30 <"$PIPE" &
for i in `seq 0 20 100` ; do
    echo $i >"$PIPE"
    echo "$i%"
    sleep 1
done

jobs -x kill %%
rm "$PIPE"
For other options see its man page: man xdialog

Last edited by Hko; 04-14-2004 at 11:23 AM.
 
Old 04-14-2004, 12:40 PM   #7
Andy@DP
Member
 
Registered: Aug 2003
Posts: 208

Rep: Reputation: 30
Hey guys,
Just for the record my RedHat 9 distro did NOT come with Xdialog but I got it from
http://xdialog.dyns.net
and thought I would share the link with everyone else!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Fluxbox simple question, simple answer? generallimptoes Linux - Software 3 09-26-2005 02:03 PM
Simple Questions...Hopfully Simple Answers. caps_phisto Linux - General 3 12-21-2004 12:40 PM
problems creating a simple bootable cd to perform a simple task czarherr Linux - Software 1 11-11-2004 05:22 AM
Installing Programs - A simple question from my simple mind jmp875 Linux - Newbie 6 02-18-2004 09:03 PM
simple question seeking simple answer enzo250gto Linux - Newbie 1 10-27-2001 04:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration