[EMAIL PROTECTED] wrote:

Scintilla is a very powerfull source code editor,
I am trying to test the Perl wrapper by Laurent Rocher,
below is the starting code from the Win32::GUI::Scintilla docs,
The only problem now I am having is how to activate the Folding
and how to use it, can anyone please post code on how to display
the folding margine and symbols etc. I see in the module functions
for folding but can not figure out how.

use Win32::GUI;
use Win32::GUI::Scintilla;  # main Window
$|=1;
$Window = new Win32::GUI::Window (
            -name     => "Window",
            -title    => "Scintilla test",
            -pos      => [100, 100],
            -size     => [400, 400],
          ) or die "new Window";  # Create Scintilla Edit Window
# $Edit = new Win32::GUI::Scintilla (
 #               -parent  => $Window,
 # Or
$Edit = $Window->AddScintilla (
     -name    => "Edit",
     -pos     => [0, 0],
     -size    => [400, 400],
     -text    => "Test\n",
 ) or die "new Edit";  # Call Some method
$Edit->AddText ("add\n");
 $Edit->AppendText ("append\n");  # Event loop
$Window->Show();
 Win32::GUI::Dialog();  # Main window event handler
sub Window_Terminate {
 # Call Some method
 print "GetText = ", $Edit->GetText(), "\n";
 print "GetSelText = ", $Edit->GetSelText(), "\n";
 print "GetTextRange(2) = ", $Edit->GetTextRange(2), "\n";
 print "GetTextRange(2, 6) = ", $Edit->GetTextRange(2, 6), "\n";
 return -1;
}
# Main window resize
sub Window_Resize {
 if (defined $Window) {
  ($width, $height) = ($Window->GetClientRect)[2..3];
  $Edit->Move   (0, 0);
  $Edit->Resize ($width, $height);
 }
}
# Scintilla Event Notification
sub Edit_Notify {
my (%evt) = @_;
 print "Edit Notify = ", %evt, "\n";
}

I had been toying with this in the past, and you are right, it Is a very powerful editor.

I had never actually bothered to make use of the _Notify until you mentioned it, and realized that it is completely useless as it is *never* fired. I am having serious problems even locating where such an event is so much as setup. There are some definitions for COMMAND and NOTIFY constants possibly usable by Win32::GUI::Hook, but I tesetd them manually and got no result. I would suggest contacting Laurent Rocher (lrocher_cpan_org).

While I am not currently making use of it, I can point out an issue I have had in the past, in the event you have also run into such a "feature". : When saving a file, all lines have a single space inserted at the beginning.

Jason P.


Reply via email to