From: <va...@us...> - 2010-06-24 19:42:23
|
Revision: 11548 http://openmsx.svn.sourceforge.net/openmsx/?rev=11548&view=rev Author: vampier Date: 2010-06-24 19:42:17 +0000 (Thu, 24 Jun 2010) Log Message: ----------- a few optimizations Modified Paths: -------------- openmsx/trunk/share/scripts/osd_menu.tcl Modified: openmsx/trunk/share/scripts/osd_menu.tcl =================================================================== --- openmsx/trunk/share/scripts/osd_menu.tcl 2010-06-23 21:58:39 UTC (rev 11547) +++ openmsx/trunk/share/scripts/osd_menu.tcl 2010-06-24 19:42:17 UTC (rev 11548) @@ -743,25 +743,27 @@ variable default_bg_color + if {$message==""} {return "nothing to display"} set message_list [split $message "\n"] - set lines [expr ([llength $message_list]*1)] - if {$lines==0} {set lines 1} + set lines [llength $message_list] if {$lines>10} {return "Text box can hold Max of 10 lines"} + #If widget doesn't exist create it if {[catch {osd info display_osd_text}]} { osd_widgets::box "display_osd_text" \ - -x 3 -y 12 -z 5 -w 314 -h [expr 4+(9*$lines)] \ + -x 3 -y 12 -z 5 -w 314 \ -scaled true -rgba 0x000000ff -border 0.5 \ -clip true -fill $default_bg_color -scaled true - #create lines + #create 10 lines for { set i 0 } { $i <= 10 } { incr i } { osd create text display_osd_text.$i -y 999 -x 2 -size 6 -rgb 0xffffff } - } else { osd configure "display_osd_text" -h [expr 4+(9*$lines)] } - + } + osd configure "display_osd_text" -h [expr 4+(9*$lines)] + + #use the lines which are needed set line 0 - #use the lines which are needed foreach message $message_list { osd configure display_osd_text.$line -text "$message" -y [expr 2+($line*9)] incr line This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |