package Tie::Textfield; sub TIEHANDLE { my ($class, $control) = @_; bless { control => $control }, $class; } sub PRINT { my ($self, $text) = @_; $self->{'control'}->{'-text'} .= $text; } #### sub ::btnButton1_Click { defined(my $win = $Win32::GUI::Loft::window{main}) or return(1); # the main script action goes here return(1); } ############################################## my $fileWindow = "test.gld"; my $objDesign = Win32::GUI::Loft::Design->newLoad($fileWindow) or die("Could not open window file ($fileWindow)"); $main = $objDesign->buildWindow() or die("Could not build window ($fileWindow)"); ############################################## tie *STDOUT, 'Tie::Textfield', $main->tfoutput; $main->Show(); Win32::GUI::Dialog();