
#   "info_panel.tcl" - part of "RAGMAAN, een anagrammengenerator" 
#
#            Copyright (C) 1999 Raymond Zandbergen
#
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    The maintainer of this program is Raymond Zandbergen (ray@wirehub.nl)
#
#
proc cmd_display_info { more_info splash } {

	global env
	global version

	if { [ winfo exists .info ] } {
		raise .info
		return
	}
	toplevel .info
	wm title .info [list Ragmaan $version info]
	wm iconbitmap .info info
	wm resizable .info 0 0

	label .info.l -text [list Ragmaan $version - Anagrammengenerator]
	text .info.t -width 72 -height 10
	frame .info.f
	label .info.f.l2 -text {bugs / suggesties: ray@wirehub.nl} 
	button .info.f.bw -text warranty -command view_warranty
	button .info.f.bc -text conditions -command view_conditions
	pack .info.l .info.t -padx 10 -pady 10

	if { $splash == "" } {
		button .info.f.ok -text OK -command cmd_destroy_info
		pack .info.f.l2 .info.f.bw .info.f.bc .info.f.ok \
			-padx 10 -pady 10 -side left -expand  1
	} else {
		pack .info.f.bw .info.f.l2 .info.f.bc \
			-padx 10 -pady 10 -side left -expand  1
	}

	pack .info.f -padx 10 -pady 10 -fill x

	set id [open [file join $env(RM_LIB_PATH) notice.txt]]
	set c_notice [read $id]
	close $id

	.info.t insert end ${more_info}\n
	.info.t insert end $c_notice

	.info.t configure -state disabled

	return .info
}

proc	cmd_destroy_info { } {

	if { [ winfo exists .gpl ] } { destroy .gpl }
	destroy .info
}
