Changeset e87e769 in tol for tolbase/lib/toltk/project.tcl


Ignore:
Timestamp:
Dec 10, 2015, 1:02:47 PM (11 years ago)
Author:
Pedro Gea <pgea@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
3ea8b10
Parents:
3634546
Message:

Se reubica la asignación del icono de tolbase al método initWM para que funcione adecuadamente en Linux.
Se usa wm iconphoto para poder poner un icono con colores.
Podría incorporarse la imagen del icono ya escalada a distintos tamaños 16x16, 32x32 y 64x64

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7097 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tolbase/lib/toltk/project.tcl

    r3634546 re87e769  
    110110#/////////////////////////////////////////////////////////////////////////////
    111111  global tcl_platform
    112   global toltk_images_path
    113112  variable data
    114113  variable widgets
    … …  
    128127 
    129128  # Gives a name for the application
    130   # tol platform selection
    131   array set tol_platform [lindex [toltcl::eval {PlatformInfo(?)} -named 1] 1]
    132   if {$tol_platform(CompilerID) eq "GNU"} {
    133     set prjtitle "TOLBase (GNU)"
    134   } elseif {$tol_platform(CompilerID) eq "MSVC"} {
    135     set prjtitle "TOLBase (MSVC)"
     129  if { [string equal $tcl_platform(platform) "unix"] } {
     130    set prjtitle "TOLBase" 
    136131  } else {
    137     set prjtitle "TOLBase"
     132    # tol platform selection
     133    array set tol_platform [lindex [toltcl::eval {PlatformInfo(?)} -named 1] 1]
     134    if {$tol_platform(CompilerID) eq "GNU"} {
     135      set prjtitle "TOLBase (GNU)"
     136    } elseif {$tol_platform(CompilerID) eq "MSVC"} {
     137      set prjtitle "TOLBase (MSVC)"
     138    } else {
     139      set prjtitle "TOLBase"
     140    }
    138141  }
    139142 
    … …  
    143146  wm title . $prjtitle
    144147
    145   #if { [TolConReq] }
    146     #Creamos frame de trabajo
    147     set widgets(mainmenu) [::project::CreateMdiMenu .main.mdi]
    148         set widgets(mainframe) [frame .main]
    149         set widgets(mainmdi) [mdi .main.mdi -mdimenu $widgets(mainmenu) \
    150                                -relief sunken -bd 1]
    151     pack $widgets(mainmenu) -fill x -side top
    152         pack $widgets(mainframe) -fill both -expand yes -side bottom
    153     pack $widgets(mainmdi) -fill both -expand yes -side bottom
    154         bind . <Control-Tab> "[list $widgets(mainmdi) cicle]; break"
    155 
    156     #(pgea) se adelanta para no ver el icono de TK intermedio
    157     if { [string equal $tcl_platform(platform) "unix"] } {
    158       wm iconbitmap . "@[file join $toltk_images_path tolbase-gnu-64.xbm]"
    159     } else {
    160       # tol platform selection
    161       if {$tol_platform(CompilerID) eq "GNU"} {
    162         wm iconbitmap . -default [file join $toltk_images_path tolbase-gnu.ico]
    163       } elseif {$tol_platform(CompilerID) eq "MSVC"} {
    164         wm iconbitmap . -default [file join $toltk_images_path tolbase-msvc.ico]
    165       } else {
    166         wm iconbitmap . -default [file join $toltk_images_path tolbase.ico]
    167       }
    168     }
    169 
    170         ::TolConsole::MainFrame $widgets(mainmdi) [TolConReq]
    171   #
     148  #Creamos frame de trabajo
     149  set widgets(mainmenu) [::project::CreateMdiMenu .main.mdi]
     150  set widgets(mainframe) [frame .main]
     151  set widgets(mainmdi) [mdi .main.mdi -mdimenu $widgets(mainmenu) \
     152                         -relief sunken -bd 1]
     153  pack $widgets(mainmenu) -fill x -side top
     154  pack $widgets(mainframe) -fill both -expand yes -side bottom
     155  pack $widgets(mainmdi) -fill both -expand yes -side bottom
     156  bind . <Control-Tab> "[list $widgets(mainmdi) cicle]; break"
     157
     158  ::TolConsole::MainFrame $widgets(mainmdi) [TolConReq]
    172159 
    173160  if { [TolConReq] } {
    … …  
    218205#
    219206#/////////////////////////////////////////////////////////////////////////////
    220   variable data
    221 
     207  global tcl_platform
     208  global toltk_images_path
     209  variable data
     210 
    222211  bind . <Map> "::project::mapMain %W"
    223212  bind . <Unmap> "::project::unmapMain %W"
    … …  
    226215  bind . <Destroy> "::project::OnDestroy %W"
    227216  set defgeom "[winfo vrootw .]x[winfo vrooth .]+0+0"
     217 
     218  #(pgea) se adelanta para no ver el icono de TK intermedio
     219  if { [string equal $tcl_platform(platform) "unix"] } {
     220    wm iconphoto . [image create photo .icon256 -format png -file [file join $toltk_images_path tolbase-256.png] ]
     221  } else {
     222    # tol platform selection
     223    array set tol_platform [lindex [toltcl::eval {PlatformInfo(?)} -named 1] 1]
     224    if {$tol_platform(CompilerID) eq "GNU"} {
     225      wm iconbitmap . -default [file join $toltk_images_path tolbase-gnu.ico]
     226    } elseif {$tol_platform(CompilerID) eq "MSVC"} {
     227      wm iconbitmap . -default [file join $toltk_images_path tolbase-msvc.ico]
     228    } else {
     229      wm iconbitmap . -default [file join $toltk_images_path tolbase.ico]
     230    }
     231  }
     232   
    228233  wm state . normal
    229234  wm geometry . [set geom [::iniFile::Read Project topgeom $defgeom]]
Note: See TracChangeset for help on using the changeset viewer.