[perl-win32-gui-users] Question about AddTextbox.
Is there any easy way to append to an "AddRichEdit" text field? I would like
it to just add to the text field without replacing it.
I found a work around which was to concatenate strings together and feed it
to the AddRichEdit->Text but I am not sure this will work on large amounts
of text.
Here is some sample code for what I mean:
I would like to replace the start2_click with something a little less memory
intensive. It would probably be ok if I could force it to go to the bottom
of the window after every ->Text("");
use Win32::GUI;
$Win = new Win32::GUI::Window(
-left => 301,
-top=> 236,
-width => 485,
-height => 571,
-title => "Test for TexBox"
);
$output= $Win->AddRichEdit(
-name => "Test AddRichEdit",
-text => "",
-left=> 7,
-top => 138,
-width => 463,
-height => 392,
-readonly => 1,
);
$Win->AddButton( # add a button to the main window
-name => "close",
-text => "Close",
-top=> 65,
-left => 370,
-width => 81,
-height => 25,
);
$Win->AddButton( # add a button to the main window
-name => "start",
-text => "Start",
-top=> 40,
-left => 370,
-width => 81,
-height => 25,
);
$Win->AddButton( # add a button to the main window
-name => "start2",
-text => "Start2",
-top=> 90,
-left => 370,
-width => 81,
-height => 25,
);
sub Window_Terminate {
return -1;
}
$Win->Show();
Win32::GUI::Dialog();
sub close_Click {
exit;
}
sub start_Click {
for ($i = 0; $i <= 10; $i++){
$output->Text("$i \n");
}
}
sub start2_Click {
$starttext = "";
for ($i = 0; $i <= 10; $i++){
$starttext = $starttext . "$i\n";
}
$output->Text($starttext);
}
Thanks
Don
Re: [perl-win32-gui-users] Question about AddTextbox.
Is there any easy way to append to an "AddRichEdit" text field? I would
like
it to just add to the text field without replacing it.
$myRichEdit->Select(-1,-1);
I found a work around which was to concatenate strings together and feed it
to the AddRichEdit->Text but I am not sure this will work on large amounts
of text.
Here is some sample code for what I mean:
I would like to replace the start2_click with something a little less
memory
intensive. It would probably be ok if I could force it to go to the bottom
of the window after every ->Text("");
use Win32::GUI;
$Win = new Win32::GUI::Window(
-left => 301,
-top=> 236,
-width => 485,
-height => 571,
-title => "Test for TexBox"
);
$output= $Win->AddRichEdit(
-name => "Test AddRichEdit",
-text => "",
-left=> 7,
-top => 138,
-width => 463,
-height => 392,
-readonly => 1,
);
$Win->AddButton( # add a button to the main window
-name => "close",
-text => "Close",
-top=> 65,
-left => 370,
-width => 81,
-height => 25,
);
$Win->AddButton( # add a button to the main window
-name => "start",
-text => "Start",
-top=> 40,
-left => 370,
-width => 81,
-height => 25,
);
$Win->AddButton( # add a button to the main window
-name => "start2",
-text => "Start2",
-top=> 90,
-left => 370,
-width => 81,
-height => 25,
);
sub Window_Terminate {
return -1;
}
$Win->Show();
Win32::GUI::Dialog();
sub close_Click {
exit;
}
sub start_Click {
for ($i = 0; $i <= 10; $i++){
$output->Text("$i \n");
}
}
sub start2_Click {
$starttext = "";
for ($i = 0; $i <= 10; $i++){
$starttext = $starttext . "$i\n";
}
$output->Text($starttext);
}
Thanks
Don
_
Get MSN 8 Dial-up Internet Service FREE for one month. Limited time offer--
sign up now! http://join.msn.com/?page=dept/dialup
Re: [perl-win32-gui-users] Question about AddTextbox.
Sorry about that last message; I must have accidentally hit a wrong key Is there any easy way to append to an "AddRichEdit" text field? I would like it to just add to the text field without replacing it. $myRichEdit->Select(-1,-1); # position cursor at end $myRichEdit->ReplaceSel($text_to_add); # current selection has length 0, so none # of the current text is lost I believe (-1,-1) are the proper parameters to put the cursor at the very end; but I might be wrong. _ Get McAfee virus scanning and cleaning of incoming attachments. Get Hotmail Extra Storage! http://join.msn.com/?PAGE=features/es

