Illustrious Ones, I've a Loft Gui program written that searches for specific file extensions. The program works fine but I have a troublesome richedit line that won't display as I wish.
The code behind a button to begin a search is as follows: sub ::btnSearch_Click{defined(my $win = $Win32::GUI::Loft::window{"Sea +rch and Delete"} ) or return(1); # check path acceptable since user may have al +tered the default $path = $win-> tfSearchPrefix-> Text; if (!(-e "$path")) { $win-> reReport-> Text("Search path does n +ot exist ..."); return; } else { $win-> reReport-> Text("Searching for medi +a files ..."); }; # open link to text storage file for each exte +nsion checked sleep(4); foreach (@ext) { my $fh; # filehandle my $extension = getdcwd()."\\Extensions\\$_\ +.txt"; # holds matching file extensions open ($fh, ">$extension") or die "Cannot ope +n $_ for write :$!"; $handle{$_}= $fh; }; find({wanted => \&wanted, no_chdir=>1}, $path) +; # close link to storage file for each extensio +n foreach (@ext) { close $handle{$_}; }; $win-> reReport-> Text("Finished Searching"); } and the subroutine wanted is defined as follows: sub wanted {defined(my $win = $Win32::GUI::Loft::window{"Search and De +lete"} ) or return(1); if (!("$File::Find::dir"=~/}/)&&(/\.asf$|\.mp.{0,2}$|\.avi$|\.exe$ +|\.wav$|\.zip$|\.mov$|\.rm.?$ |\.wm.?$|\.qt$|\.mid.?$|\.ra.?$|\ +.swf$|\.pst$|\.ogg$|\.gho$/i)) { my ($type) = /\.(\w\w)\w?$/; print {$handle{lc $type}} "$_\n"; } }
I can only get "Searching for media files ..." to appear if I comment out find({wanted => \&wanted, no_chdir=>1}, $path); and by necessity $win-> reReport-> Text("Finished Searching");. The latter needs commenting or the initial comment gets wiped before I see it appear. The sleep line I've varied but to no avail. The line "Finished Searching" appears fine. Can anyone offer me a suggestion as to how I can get "Searching for media files ..." to appear so the user can understand that something is happening? Any help appreciated. Your obedient servant

In reply to Loft Richedit issue - I think by briannz556

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.