Skip to content

Commit 46fe0ad

Browse files
Better display and search
1 parent 6d985b4 commit 46fe0ad

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

kratos.gid/apps/Fluid/examples/examples.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>This example applies an inlet condition to the air surrounding a 2D building.
55
The default mesh is made of 4.000 trianglular elements, and the calculation generates results for 800 timesteps.
66
- Size of model: 0.4 MB
7-
- Time: Avg calulation time: < 2 minutes
7+
- Time: Avg calulation time: 2 minutes
88
- Size with results: 250 MB
99
</Description>
1010
</Example>

kratos.gid/scripts/Controllers/ExamplesWindow.tcl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,21 @@ proc Examples::PrintGroups { } {
123123
foreach example_id [dict keys [dict get $group examples]] {
124124
set example [dict get $group examples $example_id]
125125
if {[IsAproved $example $group_name $filter]} {
126+
set inner_id "$group_id*$example_id"
126127
set example_name [subst -nocommands -novariables [dict get $example name]]
127128
set example_logo [dict get $example logo]
128129
set example_dim [dict get $example dim]
129130
set example_app [dict get $example app]
130131
set example_cmd [dict get $example cmd]
131132
set img [Examples::getImgFrom $example_app $example_logo]
132-
ttk::button $buttons_frame.img$example_id -image $img -command [list Examples::LaunchExample $example_app $example_dim $example_cmd ]
133+
ttk::button $buttons_frame.img~$inner_id -image $img -command [list Examples::LaunchExample $example_app $example_dim $example_cmd ]
133134
ttk::label $buttons_frame.title$example_id -text $example_app -font {bold}
134135
ttk::label $buttons_frame.text$example_id -text $example_name
135-
grid $buttons_frame.img$example_id -column $col -row $row
136+
grid $buttons_frame.img~$inner_id -column $col -row $row
136137
grid $buttons_frame.title$example_id -column $col -row [expr $row +1]
137138
grid $buttons_frame.text$example_id -column $col -row [expr $row +2]
138139

139-
bind $buttons_frame.img$example_id <Enter> {::Examples::PlaceInformationWindowByPath %W}
140+
bind $buttons_frame.img~$inner_id <Enter> {::Examples::PlaceInformationWindowByPath %W}
140141

141142
incr col
142143
if {$col >= 4} {set col 0; incr row; incr row; incr row}
@@ -158,9 +159,13 @@ proc Examples::PrintGroups { } {
158159
}
159160

160161
proc Examples::PlaceInformationWindowByPath {win_path} {
161-
set example_id [string trimleft $win_path .gid.examples_window.center.c.fcenter.title_textFluid.buttonframe.img]
162-
set example [::Examples::getExampleById $example_id]
162+
variable examples_window
163+
variable groups_of_examples
164+
set inner_id [lindex [split $win_path "~"] end]
165+
lassign [split $inner_id "*"] example_group example_id
166+
set example [dict get $groups_of_examples $example_group examples $example_id]
163167
if {$example ne ""} {
168+
$examples_window.info configure -text "Information: [dict get $example name]"
164169
set description [dict get $example description]
165170
set ::Examples::info_main_window_text $description
166171
}

0 commit comments

Comments
 (0)