use lib 'd:/tkProg/tkprog/Perl/Launcher';
use lib 'c:/tkProg/tkprog/Perl/Launcher';
use lib 'c:/tkProg/tklib/Perl/lib';
use lib 'd:/tkProg/tklib/Perl/lib';
use lib '/home/share/tkProg/tklib/Perl';

BEGIN {
my $BaseDir = $ENV{'TkPerlDir'};
@INC = ("$BaseDir/lib", "$BaseDir/Launcher", "d:/Programs/Perl/lib", "c:/Programs/Perl/lib", @INC);
}

use strict;
#use warnings;

use LauncherApp;
use LauncherWindow;

use Tk::Menu;
use Tk::Photo;
use utf8;
use File::Glob;
use Jcode;

#use utf8;
#use encoding 'ja_JP.SJIS';
#use encoding 'utf8';
#binmode(STDERR,'encoding(ja_JP.SJIS)');

#===============================================
# Applicationクラス作製
#===============================================
my $App = new LauncherApp();
exit if($App->Initialize() < 0);

#===============================================
# 環境に合わせて変える必要がある
#===============================================
# Windows環境の場合の、ルートディレクトリィ
	my $BaseDir   = "C:\\Programs";
	my @dl = qw(C D E F G H I J K L M N O P Q R S T U V W X Y Z);
	for(my $i = 0 ; $i < @dl ; $i++) {
		last if(-e "$BaseDir\\Launcher.ini");
		$BaseDir   = "$dl[$i]:\\Programs";
	}
# Linux環境の場合の、ルートディレクトリィ
	my $home = $ENV{'HOME'};
	$BaseDir = "$home/bin" if($App->OS() eq 'linux');

# 実行プログラム名（デフォルトでは$0から取得）
	my $Program = $App->Program();
# バージョン
	$App->SetVersion("Ver 0.1");
# ウィンドウに表示するタイトル
	$App->SetTitle("Launcher 2005/pl");
# StartApp.exeのパス
	$ENV{'StartApp'} = "$BaseDir\\bin\\StartApp.exe";

#===============================================
# 環境設定
#===============================================
my $ProgramPath = $App->SpeculateProgramPath($0, $BaseDir);
#print "P: $ProgramPath\n";

my $IniFile = $App->OpenIniFile($ProgramPath);

if($App->OS() eq 'MSWin32' and !$App->Debug()) {
#	$App->FreeWin32Console();
}

#==========================================
# メインダイアログ作成
#==========================================

# コマンドラインオプション読み込み
#	$App->AddArgument("--ReadPrev", "--ReadPrev: Read previous Working Direcotry", 1);
#	$App->AddArgument("--vertical", "--vertial : Align panes vertically", 0);
#	$App->AddArgument("--help",     "--help    : Show this help");
#	exit 1 if($App->ReadArgs() != 1);
# Iniファイル読み込み
#	&ConfigureIniFileVariables();
# Document,Windowの設定
#	$App->ConnectDocument(VASPPlotDoc->new());
	$App->CreateWindow(LauncherWindow->new());

#==========================================
# メインループ
#==========================================

$App->MainLoop();

exit;

#===============================================
# スクリプト終了
#===============================================

#==========================================
# サブルーチン
#==========================================

sub ConfigureIniFileVariables
{
	$App->AddIniFileVariable("\\Preferences\\WorkDir", "WorkDir");
	$App->ReadSetting();
}


=head1 NAME

widget - Demonstration of Perl/Tk widgets

=head1 SYNOPSYS

  widget [ directory ]

=head1 DESCRIPTION

This script demonstrates the various widgets provided by Tk, along with
many of the features of the Tk toolkit.  This file only contains code to
generate the main window for the application, which invokes individual
demonstrations.  The code for the actual demonstrations is contained in
separate ".pl" files in the "widget_lib" directory, which are autoloaded
by this script as needed.

widget looks in the directory specified on the command line to load user
contributed demonstrations.  If no directory name is specified when widget is
invoked and the environment variable WIDTRIB is defined then demonstrations
are loaded from the WIDTRIB directory. If WIDTRIB is undefined then widget
defaults to the released user contributed directory, "widtrib".

=head2 History

 #
 # Stephen O. Lidie, LUCC, 96/03/11.  lusol@Lehigh.EDU
 # Stephen O. Lidie, LUCC, 97/01/01.  lusol@Lehigh.EDU
 # Stephen O. Lidie, LUCC, 97/02/11.  lusol@Lehigh.EDU
 # Stephen O. Lidie, LUCC, 97/06/07.  lusol@Lehigh.EDU
 #     Update for Tk402.00x.  Total revamp:  WidgetDemo, Scrolled, released
 #     composites, -menuitems, qw//, etcetera.  Perl 5.004 required.
 # Stephen O. Lidie, LUCC, 98/03/10.  lusol@Lehigh.EDU
 #     Update for Tk8.
 # Stephen O. Lidie, LUCC, 98/06/26.  Stephen.O.Lidie@Lehigh.EDU
 #     Add Common Dialogs for Tk800.007.
 # Stephen.O.Lidie@Lehigh.EDU, 1999/11/29, Lehigh University.
 #     Demo some "dash patch" changes.
 # Stephen.O.Lidie@Lehigh.EDU, 2000/01/11, Lehigh University.
 #     Update menubar to Tk 8, fix color palette Menubutton demo.
 # Stephen.O.Lidie@Lehigh.EDU, 2000/07/06, Lehigh University.
 #     Remove inswt() from widget and styles.pl to show the proper Perl/Tk
 #     idiom for inserting Text tags.  Various and sundry cleanups.
 # sol0@lehigh.edu, 2003/07/29, Lehigh University Computing Center.
 #     Update for Tk 8.4.4.

=head1 AUTHOR

Steve Lidie <sol0@Lehigh.EDU>

=cut

__END__

:EndOfPerl
