I had the same issue today with the richedit crashing.
I found a post somewhere that said to call the
richedit's DESTROY method before terminating. That
worked for me.
My code looks like this:
sub Window_Terminate {
$re->DESTROY;
-1;}
-Ariel
--- [EMAIL PROTECTED] wrote:
> Thank you everyone for the replies to my Right Click
> problems, the issue
> is now solved. However, I am having a couple more
> issues that I can not
> figure out how to get around.
>
> The first issue is a known one, and it concerns a
> crash with RichEdit on
> 1.0 when exiting the application. I have created
> Global vars for the
> RichEdit controls, but I still get a crash on exit,
> so I'm not sure what
> i'm doing wrong.
>
> The next issue concerns a couple buttons that I have
> created and when I go
> to click on them the program just hangs. I tried
> adding a BusyTimer to
> make sure that the program was hanging and the
> BusyTimer stopped spewing
> out information, so I know it hung.
>
> Anyway, I have included some code below in hopes
> that someone can help me
> fix these issues. Please let me know if you need
> any more information and
> I will gladly include it.
>
> Thanks.
>
> Len.
>
> --------------------------[ Begin Code
> ]-------------------------------
>
> use strict;
>
> use Win32::GUI;
> use Win32::GUI::TabFrame;
>
> my $mainwindow;
>
> my $richedit_1;
> my $richedit_2;
>
> create_mainwindow();
>
> $mainwindow -> Show;
>
> Win32::GUI::Dialog();
>
> sub create_mainwindow {
> my $windowheight = 400;
> my $windowwidth = 700;
> my $windowmenu;
>
> $windowmenu = Win32::GUI::MakeMenu (
> "Item &1"
> => "",
> " > SubItem &1"
> =>
> "Item1SubItem1",
> " > SubItem &2"
> =>
> "Item1SubItem2",
> " > SubItem &3"
> =>
> "Item1SubItem3",
> " > -"
> => 0,
> " > E&xit"
> => "AppExit",
> "Item &2"
> => "",
> " > SubItem &1"
> =>
> "Item2SubItem1",
> );
>
> $mainwindow = Win32::GUI::Window -> new (
> -name => "Main",
> -width => $windowwidth,
> -height => $windowheight,
> -title => "Main Window",
> -menu => $windowmenu,
> );
>
> $mainwindow -> AddStatusBar (
> -name => "StatusBar"
> );
>
> $mainwindow -> AddTreeView (
> -text => "",
> -name => "TreeView",
> -left => -1,
> -top => -1,
> -rootlines => 1,
> -buttons => 1,
> );
>
> $mainwindow -> AddTabFrame (
> -name => "TabFrame",
> -panel => "TabPage",
> -tabstop => 1,
> );
>
> $mainwindow -> TabFrame -> InsertItem (
> -text => "Tab1",
> -border => 1,
> );
>
> $mainwindow -> TabFrame -> InsertItem (
> -text => "Tab2",
> -border => 1,
> );
>
> $mainwindow -> TabFrame -> InsertItem (
> -text => "Tab3",
> -border => 1,
> );
>
> $mainwindow -> TabFrame -> InsertItem (
> -text => "Tab4",
> -border => 1,
> );
>
> $richedit_1 = $mainwindow -> TabFrame ->
> TabPage0 -> AddRichEdit (
> -name => "RichEdit1",
> -multiline => 1,
> -vscroll => 1,
> -hscroll => 1,
> -readonly => 1,
> );
>
> $richedit_2 = $mainwindow -> TabFrame ->
> TabPage1 -> AddRichEdit (
> -name => "RichEdit2",
> -multiline => 1,
> -vscroll => 1,
> -readonly => 1,
> );
>
> $mainwindow -> TabFrame -> TabPage2 ->
> AddListView (
> -name => "ListView1",
> -style => WS_CHILD |
> WS_VISIBLE | WS_VSCROLL | 1,
> -fullrowselect => 1,
> );
>
> $mainwindow -> TabFrame -> TabPage2 ->
> ListView1 -> InsertColumn (
> -index => 0,
> -width => 220,
> -text => "Column 1",
> );
>
> $mainwindow -> TabFrame -> TabPage2 ->
> ListView1 -> InsertColumn (
> -index => 1,
> -width => 220,
> -text => "Column 2",
> );
>
> $mainwindow -> TabFrame -> TabPage2 ->
> AddButton (
> -name => "Button1",
> -text => "Button 1",
> -default => 1,
> -tabstop => 1,
> );
>
> $mainwindow -> TabFrame -> TabPage2 ->
> AddButton (
> -name => "Button2",
> -text => "Button 2",
> -tabstop => 1,
> );
>
> $mainwindow -> TabFrame -> TabPage3 ->
> AddListView (
> -name => "ListView2",
> -style => WS_CHILD |
> WS_VISIBLE | WS_VSCROLL | 1,
> -fullrowselect => 1,
> );
>
> $mainwindow -> TabFrame -> TabPage3 ->
> ListView2 -> InsertColumn (
> -index => 0,
> -width => 125,
> -text => "Column1",
> );
>
> $mainwindow -> TabFrame -> TabPage3 ->
> ListView2 -> InsertColumn (
> -index => 1,
> -width => 50,
> -text => "Column2",
> );
>
> $mainwindow -> TabFrame -> TabPage3 ->
> ListView2 -> InsertColumn (
> -index => 2,
> -width => 200,
> -text => "Column3",
> );
>
> $mainwindow -> TabFrame -> TabPage3 ->
> ListView2 -> InsertColumn (
> -index => 3,
> -width => 200,
> -text => "Column4",
> );
>
> $mainwindow -> {-dialogui} = 1;
>
> }
>
>
> sub Button1_Click {
>
> print "DEBUG - Button 1 was Clicked\n";
>
> }
>
>
> sub Button2_Click {
>
> print "DEBUG - Button 2 was Clicked\n";
>
> }
>
>
> sub AppExit_Click {
>
> Main_Terminate();
>
> }
>
>
> sub Main_Terminate {
>
> $mainwindow -> Hide();
>
> exit 0;
>
> }
>
>
> sub Main_Resize {
> my $windowheight = $mainwindow ->
> ScaleHeight();
> my $windowwidth = $mainwindow ->
> ScaleWidth();
> my $treeview_width = 200;
>
> $mainwindow -> TreeView -> Move (0, 0);
> $mainwindow -> TreeView -> Resize
> ($treeview_width, $windowheight
> - $mainwindow -> StatusBar -> ScaleHeight);
>
> $mainwindow -> TabFrame -> Move
> ($treeview_width, 0);
> $mainwindow -> TabFrame -> Resize
> ($windowwidth - $treeview_width,
> $windowheight - $mainwindow -> StatusBar ->
> ScaleHeight);
>
> $mainwindow -> TabFrame -> TabPage0 ->
> RichEdit1 -> Move (0, 0);
> $mainwindow -> TabFrame -> TabPage0 ->
> RichEdit1 -> Resize
> ($mainwindow -> TabFrame -> TabPage0 -> ScaleWidth,
> $mainwindow ->
> TabFrame -> TabPage0 -> ScaleHeight);
>
> $mainwindow -> TabFrame -> TabPage1 ->
> RichEdit2 -> Move (0, 0);
> $mainwindow -> TabFrame -> TabPage1 ->
> RichEdit2 -> Resize
> ($mainwindow -> TabFrame -> TabPage0 -> ScaleWidth,
> $mainwindow ->
> TabFrame -> TabPage0 -> ScaleHeight);
>
> $mainwindow -> TabFrame -> TabPage2 ->
> ListView1 -> Move (0, 0);
> $mainwindow -> TabFrame -> TabPage2 ->
> ListView1 -> Resize
> ($mainwindow -> TabFrame -> TabPage2 -> ScaleWidth,
> $mainwindow ->
> TabFrame -> TabPage2 -> ScaleHeight - 40 );
> $mainwindow -> TabFrame -> TabPage2 ->
> Button1 -> Move
> ($mainwindow -> TabFrame -> TabPage2 -> ScaleWidth /
> 2 - 70, $mainwindow
> -> TabFrame -> TabPage2 -> ScaleHeight - 30);
> $mainwindow -> TabFrame -> TabPage2 ->
> Button2 -> Move
> ($mainwindow -> TabFrame -> TabPage2 -> ScaleWidth /
> 2 , $mainwindow ->
> TabFrame -> TabPage2 -> ScaleHeight - 30);
>
> $mainwindow -> TabFrame -> TabPage3 ->
> ListView2 -> Move (0, 0);
> $mainwindow -> TabFrame -> TabPage3 ->
> ListView2 -> Resize
> ($mainwindow -> TabFrame -> TabPage3 -> ScaleWidth,
> $mainwindow ->
> TabFrame -> TabPage3 -> ScaleHeight);
>
> $mainwindow -> StatusBar -> Move (0,
> $windowheight - $mainwindow
> -> StatusBar -> Height);
> $mainwindow -> StatusBar -> Resize
> ($windowwidth, $mainwindow ->
> StatusBar -> Height);
>
> }
>
> --------------------------[ End Code
> ]-------------------------------
>
>
>
------------------------------------------------------------------------------
> Electronic Privacy Notice. This e-mail, and any
> attachments, contains information that is, or may
> be, covered by electronic communications privacy
> laws, and is also confidential and proprietary in
> nature. If you are not the intended recipient,
> please be advised that you are legally prohibited
> from retaining, using, copying, distributing, or
> otherwise disclosing this information in any manner.
> Instead, please reply to the sender that you have
> received this communication in error, and then
> immediately delete it. Thank you in advance for your
> cooperation.
>
==============================================================================
>