From: Jonathan S. <jso...@al...> - 2001-11-08 18:44:19
|
Another problem I am having. I would like the user to press enter in a Textfield object and append the results to a RichEdit object. I have done this before but for some reason it is not working now. Here is my code: $ChatBox = $GameWindow->AddRichEdit( -name => "ChatBox", -left => 400, -top => 5, -width => 230, -height => 330, -disabled=> 1, -addstyle=> WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN, -addexstyle=> WS_EX_CLIENTEDGE, ); $ChatText = $GameWindow->AddTextfield( -name => "ChatText", -top => 345, -left => 400, -width => 175, -height => 25, -disabled=> 1, -tabstop=> 1, ); $Send = $GameWindow->AddButton( -name => "SendText", -text => "Send", -top => 345, -left => 580, -height => 25, -width => 50, -tabstop=> 1, -default=> 1, -ok => 1, -disabled=> 1, ); and the subroutine for the button event: sub SendText_Click { if ($ChatText->Text() eq "") { return; } my $OldText = $ChatBox->Text(); my $NewText = $ChatText->Text(); if ($OldText eq "") { $ChatBox->Text("<$YourNick> $NewText"); } else { $ChatBox->Text("$OldText\n<$YourNick> $NewText"); } $ChatText->Text(""); $ChatText->SetFocus(); return; } Am I doing something wrong? Jonathan Southwick jso...@al... Technical & Network Services Allegheny College, Meadville, PA 16335 (814) 332-2755 |
From: Jonathan S. <jso...@al...> - 2001-11-08 18:53:16
|
Never mind I figured it out! I needed the: $Window->{-dialogue} = 1; Jonathan Southwick jso...@al... Technical & Network Services Allegheny College, Meadville, PA 16335 (814) 332-2755 At 11/8/2001 01:41 PM, Jonathan Southwick wrote: >Another problem I am having. I would like the user to press enter in a >Textfield object and append the results to a RichEdit object. I have done >this before but for some reason it is not working now. Here is my code: > > $ChatBox = $GameWindow->AddRichEdit( > -name => "ChatBox", > -left => 400, > -top => 5, > -width => 230, > -height => 330, > -disabled=> 1, > -addstyle=> WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_LEFT | > ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN, > -addexstyle=> WS_EX_CLIENTEDGE, > ); > $ChatText = $GameWindow->AddTextfield( > -name => "ChatText", > -top => 345, > -left => 400, > -width => 175, > -height => 25, > -disabled=> 1, > -tabstop=> 1, > ); > $Send = $GameWindow->AddButton( > -name => "SendText", > -text => "Send", > -top => 345, > -left => 580, > -height => 25, > -width => 50, > -tabstop=> 1, > -default=> 1, > -ok => 1, > -disabled=> 1, > ); > >and the subroutine for the button event: > >sub SendText_Click { > if ($ChatText->Text() eq "") { > return; > } > my $OldText = $ChatBox->Text(); > my $NewText = $ChatText->Text(); > if ($OldText eq "") { > $ChatBox->Text("<$YourNick> $NewText"); > } else { > $ChatBox->Text("$OldText\n<$YourNick> $NewText"); > } > $ChatText->Text(""); > $ChatText->SetFocus(); > return; >} > > > >Am I doing something wrong? > > > >Jonathan Southwick >jso...@al... >Technical & Network Services >Allegheny College, Meadville, PA 16335 >(814) 332-2755 > > >_______________________________________________ >Perl-Win32-GUI-Users mailing list >Per...@li... >https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Johannes G. <in...@de...> - 2001-11-08 23:02:47
|
Hello, im looking for information on the Button Widget. Can anyone explain me, what this options are doing: -default=> 1, -ok => 1, So, i played a little with the Events on the Button-Widget, but it seems that only the _Click Event are working ... ? There are short eg. for the other ones: DblClick() GotFocus() LostFocus() MouseDown() MouseUp() I triede for eg. the DblClick() event like that sub Button_DblClick { print "DblClick on Button.\n"; return 1; } But this doesn't work ... are this events not supportet yet? Thx for your input ;-) Hannes |