I found it. I had AddTextField instead of AddTextfield. Correct caps are not my strong point apparently, but I imagine learning them would prevent further headaches! Thanks for the debugging tips. They came in handy when trying to find the problem.
----- Original Message ----- From: "Marjolein Katsma" <[EMAIL PROTECTED]> To: <perl-win32-gui-users@lists.sourceforge.net>; <perl-win32-gui-users@lists.sourceforge.net> Sent: Thursday, May 10, 2001 4:16 AM Subject: Re: [perl-win32-gui-users] weird textfield issue > Chris, > > Forgive me if I sound pedantic - but here's some advice from an old hand (slightly rheumatic by now - seriously!) at programming. If you want to find out the hard way (may do!) delete this *now*; don't read any further. > On the other hand...: > > Do *not* hide that DOS (command-line) window until you've fully debugged, alpha-tested and beta-tested your program. Until it's ready for release, you *need* that command-line window. > > Unless you want (or can afford to) to shell out for a debugger - but you don't *need* (to shell out for) a debugger until you've exhausted all other methods. > (When I was starting to writing COBOL there *were* no 'debuggers'. Debugging your code was inserting as many useful DISPLAY statements you could think of and then interpreting the text on the print-out you got back.) I have a debugger for Perl (Part of ActiveState's PDK, which costs $$$) but I rarely use it. I use the command-line window to display my "display" statements (plain old print in Perl) until I'm really stuck. > > If you want to know what goes on in your script, keep that window, and put liberal [print] statements into your code to trace every step: you're robbing yourself of a valuable resource until your code is really working (and confirmed as really working by people using your code). They'll give you a trace of what's happening, and a means of finding problems - well before you'll even *need* a debugger (or this list, for that matter). Leave your print statements (and code variations!) but 'comment them out' while you're trying to figure out something. Once it works, put in a new comment that explains (to you, 6 months later!) why it works. When you can still understand that comment after a week, your're ready to deleted the other commented-out trial-and-error code. If not, go back and explain it to yourself again (if you can still remember why this worked in the first place and something else didn't!); in a comment. > > And don't under-estimate the life-time of your code: trivial code intended for a week or so has a nasty habit of staying alive for 2 years or more... > > Debuggers are a wonderful invention - and I use them. But you don't need them (need to *pay* for them!) until you've exhausted all possibilities of displaying traces and variable values of your program while it's executing. With Perl on Win - that's just what you need your command-line window for: without it (or a debugger): how do you know what's happening? > > My Perl scripts (until ready for release) look really 'dirty' until they're working: they're full of comments of what I'm trying (commented code), and why, and why it doesn't work so what I'm trying next. > So try a few things, put in some print statements, and if your code doesn't work as you intended and you figured out why, put that into a comment as well. Ultimately you'll end up with working code, and comments explaining (to you!) why this works and something else you tried doesn't. > > (OK, I didn't even try your code - I just noticed you disabled the very means of finding out why it didn't work in the first place. IGNORE if you're not interested!) > > At 13:23 2001-05-09 -0500, Chris Etzel wrote: > >Hello, > > > >I am playing around with Win32::GUI trying to refresh my memory on Perl and > >Win32::GUI, and: > > > >I have written a test program that basically brings up a toolbar with a > >button to open a launcher window that I can type a command in and launch > >directly. Well, all works fine exept I can't see the text field. I even > >tried to copy and paste from my working example directly to the new code, > >but still no text field. Before I go insane, can someone look at this code > >and tell me if I messed up somewhere? Thanks! > > > >Chris > > > >----------code below-------------- > > > >use Win32::GUI; > >($DOS) = Win32::GUI::GetPerlWindow(); > > Win32::GUI::Hide($DOS); > > > >my $Toolbar=Win32::GUI::Window->new( > > -name=>'Toolbar', > > -size=>[600,75], > > -title=>"PEaRL ToolBar", > > ); > >my $launcher=$Toolbar->AddButton( > > -name=>'launcher', > > -pos=>[10,10], > > -text=>"Launcher", > > ); > >$Toolbar->launcher->Show(); > > > > sub launcher_Click{ > > my $Launcher=Win32::GUI::Window->new( > > -name=>'CommandLauncher', > > -size=>[300,75], > > -title=>"Launcher", > > ); > > $Launcher->Show(); > > > > my $runline=$Launcher->AddTextField( > > -name=>'CommandBox', #Here is > >where It should show the text field-but doesn't > > -background=>[255,255,255], > > -pos=>[10,10], > > -size=>[150,22], > > -prompt=>'Enter Command:', > > ); > > > > my $runButton-$Launcher->AddButton( > > -name=>'runbutton', > > -pos=>[160,10], > > -text=>'Run', > > -size=>[30,22], > > ); > > $Launcher->runbutton->Show(); > > sub runButton_Click{ > > exec($textfield->Text); > > } > > > > } > > > > > > > > > >$Toolbar->Show(); > >Win32::GUI::Dialog(); > > > > > > > > > >_______________________________________________ > >Perl-Win32-GUI-Users mailing list > >Perl-Win32-GUI-Users@lists.sourceforge.net > >http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > Cheers, > > Marjolein Katsma > HomeSite Help - http://hshelp.com/ - Extensions, Tips and Tools > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Perl-Win32-GUI-Users@lists.sourceforge.net > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users