#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"
# XDMexit -- Copyright Uiewera Ruirarchzatrea 2000
# Bug reports, praise, and so on to millueradfa@yahoo.com
# Web: http://www.geocities.com/millueradfa

# This is a program to provide a quick means of shutting down the
# system while we are in XDM, this it does OK, but there is always
# room for improvement. We have lots of additions we eventually will 
# make one day, making this into a full featured login-logout window. 
# Please see our web page if you would like the details (address above).
# Feel free to improve and e-mail the new improvements back 
# to me, please!

set size 24
set aspect "-0-100-100"
set CurFont "fixed"
set SizedFont "fixed"
set Editor tkedit
set CurFileName ""

proc Aboutx {} {
        tk_dialog .aboutx "About X..." "The X Window System, version R6, 3.3. Xfree86, version 3.3.x." "" 0 Ok
} 

proc About {} {
        tk_dialog .about "About..." "Written by Uiewera Ruirarchzatrea, 2000" "" 0 Ok
} 

proc Fortunecmd {} {
	set fortunesrc [exec fortune]
        tk_dialog .fortune "Fortune..." "$fortunesrc" "" 0 Ok
} 

proc Shutdownsys {} {
	exec halt
} 

frame .toprow

# Oh well, it seems as though for some reason the below "commented
# out" drop down menus dont work with xdm, we get many error messages.
# for now, we must resort to a simple button for the about "feature".

# menubutton .toprow.about -text About -underline 0 -menu .toprow.about.m -relief raised  -padx 3 -pady 1
# menu .toprow.about.m -bd 1 -tearoff 0 -activeborderwidth 1 
# .toprow.about.m add command -label "About XDMexit" -underline 0 -command About
# .toprow.about.m add command -label "About X" -underline 5 -command Aboutx

button .toprow.about -text "About" -command About -pady 1
button .toprow.lab -text "Shutdown System" -command Shutdownsys -pady 1
button .toprow.fortune -text "Dialy Fortune" -command Fortunecmd -pady 1
frame .f1
pack .toprow -side top -fill x
pack .toprow.about -in .toprow -side left
pack .toprow.fortune -in .toprow -side left
pack .toprow.lab -in .toprow -side left -fill x -expand 1
wm title . XDMexit

    Source: geocities.com/millueradfa/uiewera

               ( geocities.com/millueradfa)