Changeset 1912 for trunk/mcgui.pl

Show
Ignore:
Timestamp:
03/19/07 11:17:36 (5 years ago)
Author:
pkwi
Message:

Small hacks to allow built-in editor to run alone.

(mcgui --edit my_instrumentfile.instr)

Added corresponding hook in the File menu

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/mcgui.pl

    r1911 r1912  
    194194    spawn_external($w,$cmd); 
    195195} 
     196 
     197sub menu_spawn_internal_editor { 
     198    my ($w) = @_; 
     199    my $cmd = "mcgui$suffix --edit $current_sim_def"; 
     200    if ($external_editor eq "no") { return 0; } 
     201    # Must be handled differently on Win32 vs. unix platforms... 
     202    spawn_external($w,$cmd); 
     203} 
     204 
    196205 
    197206sub menu_spawn_mcdaemon { 
     
    14301439                       -underline => 0, 
    14311440                       -command => \&menu_edit_current); 
     1441    $filemenu->command(-label => 'Edit current/New (detached)', 
     1442                       -underline => 0, 
     1443                       -command => sub { menu_spawn_internal_editor($w) } ); 
    14321444    if($external_editor) { 
    14331445        my $shortname = (split " ", $external_editor)[0]; 
     
    18571869            $open_editor = 1; 
    18581870#            menu_edit_current($win); 
    1859         } else { 
     1871        } elsif ($ARGV[$j] eq "--edit") { 
     1872            $open_editor = 1; 
     1873            $win->withdraw; 
     1874        } else { 
    18601875            $filenames = "$ARGV[$j]"; 
    18611876        }