GXMESSAGE(1) | GXMESSAGE(1) |
NAME¶
gxmessage - a GTK-based xmessage cloneSYNOPSIS¶
gxmessage [OPTIONS] message ...DESCRIPTION¶
gxmessage opens a window to display a message obtained from the command line, from a file, or from stdin. The window includes a row of buttons, each of which causes the program to exit with a different return code. The GNU Info entry for gxmessage contains detailed information and examples.OPTIONS¶
gxmessage should accept any option xmessage would, although some (such as -bw and -xrm) are silently ignored. Options supported by gxmessage are as follows:- -bg COLOR
-
- -borderless
-
- -buttons BUTTON_LIST
-
gxmessage -buttons "Foo:42,Bar:63" "Example" echo $? gxmessage -buttons "_Foo,_Bar" "Example" echo $? gxmessage "Example" echo $? gxmessage -buttons "GTK_STOCK_OK:0" "Example" echo $? gxmessage -buttons "Hello\, world" "Example"
- -center
-
- -default LABEL
-
- -display DISPLAY
-
- -encoding CHARSET
-
- -entry
-
- -entrytext TEXT
-
- -fg COLOR
-
- -file FILENAME
-
- -fn | -font FONT
-
- -geometry GEOMETRY
-
- -help
-
- -iconic
-
- -name NAME
-
- -nearmouse
-
- -noescape
-
- -nofocus
-
- -ontop
-
- -sticky
-
- -timeout SECONDS
-
- -title TITLE
-
- -version
-
- -wrap
-
GTK DEFAULTS¶
The program's default appearance can be adjusted using GTK resource files. The main text display widget is named gxmessage-textview. The text entry widget is named gxmessage-entry.
# Example: ~/.gtkrc-2.0 style "gxmsg" { text[NORMAL] = "#cc9900" base[NORMAL] = "#660000" text[SELECTED] = "#660000" base[SELECTED] = "#cc9900" font_name = "monospace" } widget "*.gxmessage-textview" style "gxmsg" widget "*.gxmessage-entry" style "gxmsg"
EXIT STATUS¶
If a button is pressed, the program returns the value assigned to that button. The default "okay" button returns 0. If a timeout event occurs, the program returns 0. If an error occurs, or if the window is closed without a button-press or timeout event, the program exits with code 1. Pressing the ESC key also causes the program to exit with code 1.COMPATIBILITY WITH XMESSAGE¶
Fall back to xmessage if gxmessage isn't available:
#! /bin/sh XMESSAGE=$(which gxmessage) || XMESSAGE=xmessage $XMESSAGE "hello, world"
If you specify fonts, check which program you're using:
font="monospace 14" [ "$XMESSAGE" = xmessage ] && font="fixed" $XMESSAGE ${font:+-fn "$font"} "hello, world"
Don't use double-dashed command line options:
$XMESSAGE "hello, world" -buttons good $XMESSAGE "hello, world" --buttons bad
Don't use the gxmessage-specific options:
-entry, -entrytext, -borderless, -wrap, -encoding, -nofocus, -noescape, -ontop, -sticky, -version, -h, -?
BUGS¶
The position component of -geometry values is ignored by gxmessage. For some reason, opening the gxmessage window with no button set to be the default causes GTK to emit a "beep" sound. If you discover other bugs in the most recent version of gxmessage, please get in touch.SEE ALSO¶
xmessage(1), zenity(1), dialog(1) The GNU Info entry for gxmessage contains detailed information and examples.AUTHORS¶
Timothy Musson <trmusson@gmail.com>COPYRIGHT NOTICE¶
Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Timothy Richard Musson Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved.February 25th, 2012 |