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
##### START OF CODE #########
use win32::GUI;
$menu = new Win32::GUI::Menu(
"&Search" => "mnuSearch",
" > &Songs..." => "mnuSearchSongs",);
$windowClass = new Win32::GUI::Class(
-name => "myWindowClass",
-color=> 16);
$window = new Win32::GUI::Window(
-title => "Blue Steel",
-left => 0,
-top => 0,
-width => 640,
-height => 480,
-class => $windowClass,
#-style => WS_SYSMENU | WS_MINIMIZEBOX,
-name => "myWindow",
-menu => $menu
);
$searchDialog = new Win32::GUI::DialogBox(
-title => "Search Song(s)",
-name => "mySearchDialog",
-class => "myWindowClass",
-parent => "myWindow",
-height => 210,
-width => 380,
-helpbox => 0
);
$window->Show;
$window->Dialog();
sub OpenSearchDialog()
{
$title_string ="";
$searchTitle =
$searchDialog->AddTextfield(
-name => "txtTitle",
-left => 20,
-top => 20,
-height => 20,
-width => 300,
-multiline => 0,
-tabstop => 1,
-prompt => ["Title ",30]
);
$searchDialog->AddButton(
-name => "searchButton",
-left => 170,
-top => 140,
-height => 20,
-width => 90,
-tabstop => 1,
-text => "Search",
);
$searchDialog->Show;
$searchDialog->Enable();
#Win32::GUI::Dialog();
$searchDialog->Dialog();
}
sub Separate()
{
print
"========================================================"
;
}
sub searchButton_Click
{
$title_string = $searchTitle->Text;
print $title_string . "\n";
$searchTitle->Text("");
print $title_string;
mySearchDialog_Terminate();
}
sub mnuSearchSongs_Click
{
OpenSearchDialog();
Separate();
}
sub mySearchDialog_Terminate
{
$searchDialog->Hide;
$window->Enable();
return -1;
}
sub myWindow_Terminate
{
Win32::GUI::Show($DOS);
return -1;
}
__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/