# ------------------------------------------------------------ # Copyright (c) 2003-2019 # Q.W.Page Associates Inc. # www.qwpage.com # All rights reserved. # ------------------------------------------------------------ ::package provide app-qw 2.0; ::package require qw 2.0; ::set ::main_rwb1_debug 0; ::if {[::catch { /* { 2.36.1 - replaced try/catch with tcl ::catch Reason is that try/catch now automatically re-throws bugs and this would not allow us to process a bug here. */ } ::if {$::tcl_platform(platform) eq "windows"} { ::set ::main_rwb1_debug 0; } ::if {$::tcl_platform(platform) eq "unix"} { ::set ::main_rwb1_debug 0; } ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.0";} ::qw::main; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.1";} ::switch -- $::tcl_platform(platform) { "windows" { ::update; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.2";} ::after idle [::list [::qw::system] cpp_enter_event_loop]; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.3";} } "unix" { ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.3.0";} /* { This is the last thing that comes out when we do a return. Also we schedule the call to enter the event loop. What happens if we call the event loop? */ } # [::qw::system] cpp_enter_event_loop; ::update; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.3.1";} ::after idle [::list [::qw::system] cpp_enter_event_loop]; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.3.2";} } } } Exception]} { ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.4,::qw::control(tk_is_enabled) exists==[::info exists ::qw::control(tk_is_enabled)]";} /* { rwb_debug,tk_is_enabled problem,1000.0,exception== The system cannot find the file specified. rwb_debug,tk_is_enabled problem,1000.1,exception==The system cannot find the file specified. */ } ::if {![::info exists ::qw::control(tk_is_enabled)]||!$::qw::control(tk_is_enabled)} { /* { Any script that start with tk not enabled should never fail on startup. */ } ::puts "Could not start [::string tolower [::file normalize [::info nameofexecutable]]]."; ::sargs::var::set Bug .bug_id "314120240427140613"; ::sargs::var::set Bug .text "Startup failure,[::info nameofexecutable],exception==\n$Exception"; ::sargs::var::set Bug .exception $Exception; ::qw::bug_process $Bug; ::puts "314120050217103703,Exception==$Exception"; ::qw::shutdown; ::return; } #2.34.0 ::wm withdraw .; ::set Exception [::qw::exception::nest \ .sub $Exception \ .super [::sargs \ .text "Could not start [::string tolower [::file normalize [::info nameofexecutable]]]." \ .help_id 314120050217103703 \ ] \ ]; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.5";} ::if {![::sargs::find_field_value .structure $Exception .field .priority .value ignore]} { ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.6,Exception==\n$Exception";} # ::qw::dialog85::error .structure $Exception; # 2.36.0 dialog::error now redirected to dialog85::error ::qw::dialog::error $Exception; # 2.36.0 now redirected to dialog85::error ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.7";} } ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.8";} ::qw::shutdown; ::if {$::main_rwb1_debug} {::puts "rwb1_debug,app-qw/qw.tcl,main,1000.99";} }