Mercurial > octave
view build-aux/inplace_edit.pl @ 30999:fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Replace "label" property with "text". Replace "callback" property with
"menuselectedfcn". Both old properties are hidden, but continue to
exist and work as before to support old code.
* NEWS.8.md: Announce deprecation.
* graphics.in.h (uimenu::BEGIN_PROPERTIES): Mark "callback" property with "hgs"
for hidden, get, set routines. Mark "label" property with "hgs".
* graphics.in.h (uimenu::get_callback, uimenu::set_callback): New functions
which simply relay calls to "get_menuselectedfcn" and "set_menuselectedfcn".
* Menu.cc (Menu::actionTriggered, Menu::actionHovered): Replace "callback" with
"menuselectedfcn" in gh_callback_event calls.
* __init_fltk__.cc (script_cb): Rename "execute_callback" to
"execute_menuselectedfcn".
* __init_fltk__.cc (update_menuselectedfcn): Rename function from
"update_callback". Rename "get_callback" to "get_menuselectedfcn".
* __init_fltk__.cc (add_to_uimenu): Rename "update_callback" to
"update_menuselectedfcn".
* __init_fltk__.cc (uimenu_update): Rename "ID_CALLBACK" to
"ID_MENUSELECTEDFCN".
* uimenu.m: Update documentation to use "menuselectedfcn" and "text".
Update demos and BIST tests to use new property names.
* __add_default_menu__.m: Update code to use "menuselectedfcn" and "text".
author | Rik <rik@octave.org> |
---|---|
date | Sat, 14 May 2022 19:06:56 -0700 |
parents | 8b548f2f8086 |
children |
line wrap: on
line source
#!/usr/bin/perl -w ################################################################################ ## File: inplace_edit.pl ## Usage: perl inplace_edit.pl 'PERL_CODE' file1 [file2] [...] ## Purpose: Run snippet of PERL_CODE on each line in a file and replace ## existing line with the results of running the code. ## This replaces perl -i -pe 'PERL_CODE' file1 [file2] ... ## due to a problem in Perl 5.28 which restricts the number of files ################################################################################ ## Create Perl code from first argument (-e CODE) eval "sub per_line_code { $ARGV[0]; }"; shift @ARGV; ## Loop over each file foreach $fname (@ARGV) { rename ($fname, "$fname.$$") or die "Rename failed:$fname:$!"; open (my $FHI, "<", "$fname.$$") or die "Open failed:$fname.$$:$!"; open (my $FHO, ">", "$fname") or die "Open failed:$fname:$!"; ## Loop over each line while (<$FHI>) { per_line_code (); print $FHO $_; } close ($FHI); close ($FHO); unlink "$fname.$$" or die "Delete failed:$fname.$$:$!"; }