Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#27 RichEdit

closed-fixed
nobody
None
8
2005-07-11
2004-11-11
Anonymous
No

My name is Lex Steigenga, (lex.steigenga@siemens.com)
Im using ActiveState Perl 5.8.3 build809 on Microsoft
Windows 2000 [Version 5.00.2195]

My script works fine with Win32-GUI.0.0.671.
After updating to Win32-GUI0.99_1 I'm getting troubles
when I create RichEdit objects my script crashes on exit.
I only need to create the objects to make my script to
crash on exit. So no action at all with these objects.
When I comment-out the constructors for these RichEdit
objects my script runs well, not crashing on exit.
It seems something is wrong with the Richedit object.

This is the code I use to create the Richedit objects:
(lines beginning with #!# are those I had to comment-out
to make my script working with 0.99_1)
************************************

######################################
# Help Window #####################
my $WIN_HLP = GUI::Window->new(
-name => "WIN_HLP",
-title => "Help",
-left => 210,
-top => 110,
-width => 600,
-height => 530,
-style => 1024,
-sizable => 0,
-parent => $mainwindow,
);
#!#my $WIN_HLP_RE = $WIN_HLP->AddRichEdit(
#!# -vscroll => 1,
#!# -readonly => 1,
#!# -name => "WIN_HLP_RE",
#!# -left => 5,
#!# -top => 5,
#!# -width => 590,
#!# -height => 440,
#!#);
#$WIN_HLP_RE->AutoURLDetect();
#$WIN_HLP_RE->Load("help.rtf");
my $WIN_HLP_BT_CLS = $WIN_HLP->AddButton(
-text => "Close",
-left => 5,
-top => 470,
-width => 100,
-name => "WIN_HLP_BT_CLS",
);

************************************

The included file contains a runable version of the perl
program (portinfo.exe), the source script (pi.pl)
Please run portinfo.exe to watch the error.
Look at pi.pl to for source code.

Any suggestions ?

Regards,

Lex Steigenga

Discussion

  • jw
    jw
    2004-11-12

    Logged In: YES
    user_id=994540

    I have noticed this problem too - it should be fixed - but as a
    work around, if you keep your richtext controls in global vars
    as well as your current way of referencing them, the crash
    will go away.

     
  • jw
    jw
    2004-11-12

    • priority: 5 --> 6
     
  • jw
    jw
    2004-12-21

    • priority: 6 --> 8
     
  • chris_siebert
    chris_siebert
    2005-02-11

    Logged In: YES
    user_id=1217113

    I had this problem too - until I found out, that the
    object has to be destroyed before exiting the program.
    Adjust the following code for your object names:

    sub MainWin_Terminate {
    # $MainWin->NotifyIcon->Delete(-id => 1);
    # $MainWin->Scintilla->DESTROY;
    $MainWin->RichEdit->DESTROY;
    return(-1);
    }

    This should solve your problem.
    However, I also do not understand why one has to
    destroy only the RichEdit object (or the Scintilla
    object when using Win32::GUI::Scintilla;).
    Why is this not the same mechanism/philosophy for
    all the objects (e.g. ListView, TreeView, ...)

    Hope this helps,
    Ciao,
    Christoph

     
  • Robert May
    Robert May
    2005-07-11

    • status: open --> closed-fixed
     
  • Logged In: NO

    Hi!

    In the meantime version 1.0 of Win32::GUI has been released.
    It can be retrieved from http://www.bribes.org/perl/ppmdir.html
    But again, you have to destroy the RichEdit objects before
    exiting. (The same is true for objects such as NotifyIcon and
    Scintilla. Why this behaves different to other Win32::GUI
    objects I still don't know).

    sub MainWin_Terminate {
    # $mainwindow->NotifyIcon->Delete(-id => 1);
    # $mainwindow->ScintillaObj->DESTROY;
    $mainwindow->WIN_HLP_RE->DESTROY;
    return(-1);
    }

    Hope this helps!
    Ciao,
    Chris