You must not return -1 from mySearchDialog_Terminate, because it destroys and releases all the objects associated with it. You want to reuse the DialogWindow, so just Hide() it and return One. That does not exit your Dialog() call, but that's not needed. If you want to make the Dialog modal, you have to give it the focus when the mainWindow gets the focus. Otherwise, all widgets and all windows are being handled by a single call to Win32::GUI::Dialog() - don't use $myWinVar->Dialog().
Maybe you can go with your way of having another Dialog() call for the DialogWindow - if you return 0 from your terminate sub. That would also exit the Dialog() call, but retain the window and its widgets for later use. I don't know if that would solve the modality issue, if you want that. Have fun, Harald > -----Original Message----- > From: emir cruz [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 30, 2002 04:52 > To: perl-win32-gui-users@lists.sourceforge.net > Subject: [perl-win32-gui-users] textfield problem > > > hey guys.. i got a problem... > below is a program with a main window with menu. > Selecting the 'Search Song' menu item shows a dialog > box with textfield. I want to get an input from the > user and store that input into a variable named > $title_string. > > Heres the problem... > it only prints the first time around... > > theres something wrong with the code.. i duno what it > is. im kinda new to perl and win32 and help would be > appreciated very much.. thanks > > [SNIP] > sub mySearchDialog_Terminate > { > $searchDialog->Hide; > $window->Enable(); > return -1; > } > > sub myWindow_Terminate > { > Win32::GUI::Show($DOS); > return -1; > }