@@ -5,7 +5,7 @@ namespace eval ::spdAux {
55 set application_window_id .gid.win_app_selection
66}
77
8- proc spdAux::CreateWindow {} {
8+ proc spdAux::CreateInitialApplicationsWindow {} {
99 variable initwind
1010 variable must_open_init_window
1111 variable application_window_id
@@ -117,6 +117,65 @@ proc spdAux::CreateWindow {} {
117117 grid $w .info -columnspan 5 -sticky we
118118}
119119
120+ proc spdAux::CreateLauncherWindow { current_launcher available_apps {window_text " Applications" } {action_text " Select an application" } } {
121+ set initwind $::spdAux::initwind
122+
123+ set root [customlib::GetBaseRoot]
124+ set nd [ [$root selectNodes " value\[ @n='nDim'\] " ] getAttribute v]
125+ if { $nd ne " undefined" } {
126+
127+ } {
128+ [$root selectNodes " value\[ @n='nDim'\] " ] setAttribute v wait
129+
130+ set initwind $::spdAux::application_window_id
131+ spdAux::DestroyWindows
132+ spdAux::RegisterWindow $initwind
133+ set w $initwind
134+
135+ InitWindow $w $window_text Kratos " " " " 1
136+ set initwind $w
137+ ttk::frame $w .top
138+ ttk::label $w .top.title_text -text $action_text
139+ ttk::frame $w .applications -relief ridge
140+ set i 0
141+ set column 0
142+ set row 0
143+ foreach app $available_apps {
144+ # check if app exists
145+ if {![::apps::appExists $app ]} {continue }
146+ set img [::apps::getImgFrom $app ]
147+ set app_publicname [[::apps::getAppById $app ] getPublicName]
148+ set but [ttk::button $w .applications.img$app -image $img -command [list ::spdAux::ChangeAppTo $current_launcher $app ] ]
149+ bind $w .applications.img$app <Enter> {::spdAux::PlaceInformationWindowByPath %W applications}
150+ ttk::label $w .applications.text$app -text $app_publicname
151+ grid $w .applications.img$app -column $column -row $row
152+ grid $w .applications.text$app -column $column -row [expr $row +1]
153+ incr i
154+ incr column
155+ if {$column >= 5} {set column 0; incr row; incr row}
156+ }
157+ grid $w .top
158+ grid $w .top.title_text
159+
160+ grid $w .applications
161+
162+ # Information panel
163+ set spdAux::info_main_window_text " "
164+ ttk::labelframe $w .info -text " Information " -relief ridge
165+ ttk::label $w .info.text -textvariable spdAux::info_main_window_text
166+ grid $w .info.text
167+ grid $w .info -sticky we
168+ }
169+
170+ }
171+
172+ proc spdAux::ChangeAppTo {current_launcher appid} {
173+ spdAux::deactiveApp $current_launcher
174+ spdAux::SetSpatialDimmension undefined
175+ apps::setActiveApp $appid
176+ }
177+
178+
120179proc spdAux::PlaceInformationWindowByPath {win_path what} {
121180 variable application_window_id
122181 set app_id [string trimleft $win_path $application_window_id .$what .img]
0 commit comments