App-InvestSim
    
    
  
  
  
view release on metacpan or search on metacpan
lib/App/InvestSim/GUI.pm view on Meta::CPAN
  if (Tkx::expr('$tcl_platform(platform)') eq 'windows') {
    $root->g_wm_iconbitmap(catfile($res_dir, 'icon.ico'));
  } else {
    # On Linux, we cant read .ico files directly.
    my $icon = Tkx::widget->new(Tkx::image_create_photo());
    $icon->read(catfile($res_dir, 'sources', 'icon_32.png'));
    # We could pass several images of different sizes here.
    $root->g_wm_iconphoto($icon);
  }
  
  # We're copying the font used by the TreeView style and adding an 'bold'
  # option to it, it will be used by the 'total' line.
  my $default_treeview_font = Tkx::ttk__style('lookup', 'TreeView', '-font');
  my $treeview_total_font = Tkx::font('create');
  Tkx::font('configure', $treeview_total_font, Tkx::SplitList(Tkx::font('configure', $default_treeview_font)));
  Tkx::font('configure', $treeview_total_font, -weight => 'bold');
  
  # Build the left bar with various parameters.
  {
    my $frame = $root->new_ttk__frame(-padding => 3);
    $frame->g_grid(-column => 0, -row => 0, -rowspan => 3, -sticky => "we");
    
    my $row = 0;
    for my $c (['invested', "Valeur du bien", \&format_euro, "Prix d'achat du bien, hors frais de notaire."],
               ['tax_rate', "Taux d'imposition marginal", \&format_percent],
               ['base_rent', "Loyer brut initial", \&format_euro],
( run in 1.816 second using v1.01-cache-2.11-cpan-c333fce770f )