#36 -dialogui = 1 causes a hang when a button is clicked

closed-wont-fix
Robert May
None
1
2006-10-15
2005-05-13
jw
No

If you rin the programme below, it will hang when a
button is clicked on tab2. if -dialogui => 1, is
commented out, the programme runs fine.

use strict;
use warnings;

use Win32::GUI;
use Win32::GUI::TabFrame;

my $mainwindow;

create_mainwindow();

$mainwindow -> Show;

Win32::GUI::Dialog();

sub create_mainwindow {
my $windowheight = 400;
my $windowwidth = 700;
my $windowmenu;

$windowmenu = Win32::GUI::MakeMenu (
"Item &1" => "",
" > SubItem &1"
=> "Item1SubItem1",
" > SubItem &2"
=> "Item1SubItem2",
" > SubItem &3"
=> "Item1SubItem3",
" > -" => 0,
" > E&xit"
=> "AppExit",
"Item &2" => "",
" > SubItem &1"
=> "Item2SubItem1",
);

$mainwindow = Win32::GUI::Window -> new (
-name => "Main",
-width => $windowwidth,
-height => $windowheight,
-title => "Main Window",
-menu => $windowmenu,
-dialogui => 1,
);

$mainwindow -> AddStatusBar (
-name => "StatusBar"
);

$mainwindow -> AddTabFrame (
-name => "TabFrame",
-panel => "TabPage",
-tabstop => 1,
);

$mainwindow -> TabFrame -> InsertItem (
-text => "Tab1",
-border => 1,
);

$mainwindow -> TabFrame -> InsertItem (
-text => "Tab2",
-border => 1,
);

$mainwindow -> TabFrame -> TabPage1 ->
AddListView (
-name => "ListView1",
-style => WS_CHILD | WS_VISIBLE |
WS_VSCROLL | 1,
-fullrowselect => 1,
);

$mainwindow -> TabFrame -> TabPage1 ->
ListView1 -> InsertColumn (
-index => 0,
-width => 220,
-text => "Column 1",
);

$mainwindow -> TabFrame -> TabPage1 ->
ListView1 -> InsertColumn (
-index => 1,
-width => 220,
-text => "Column 2",
);

$mainwindow -> TabFrame -> TabPage1 ->
AddButton (
-name => "Button1",
-text => "Button 1",
-default => 1,
-tabstop => 1,
);

$mainwindow -> TabFrame -> TabPage1 ->
AddButton (
-name => "Button2",
-text => "Button 2",
-tabstop => 1,
);

#$mainwindow -> {-dialogui} = 1;

}

sub Button1_Click {

print "DEBUG - Button 1 was Clicked\n";

}

sub Button2_Click {

print "DEBUG - Button 2 was Clicked\n";

}

sub AppExit_Click {

Main_Terminate();

}

sub Main_Terminate {

$mainwindow -> Hide();

exit 0;

}

sub Main_Resize {
my $windowheight = $mainwindow -> ScaleHeight
();
my $windowwidth = $mainwindow -> ScaleWidth
();
my $statusbar_height = $mainwindow ->
StatusBar -> Height();

$mainwindow -> TabFrame -> Move (0, 0);
$mainwindow -> TabFrame -> Resize
($windowwidth, $windowheight - $statusbar_height);

$mainwindow -> TabFrame -> TabPage1 ->
ListView1 -> Move (0, 0);
$mainwindow -> TabFrame -> TabPage1 ->
ListView1 -> Resize ($mainwindow -> TabFrame ->
TabPage1 -> ScaleWidth, $mainwindow -> TabFrame ->
TabPage1 -> ScaleHeight - 40 );

$mainwindow -> TabFrame -> TabPage1 ->
Button1 -> Move ($mainwindow -> TabFrame ->
TabPage1 -> ScaleWidth / 2 - 70, $mainwindow ->
TabFrame -> TabPage1 -> ScaleHeight - 30);
$mainwindow -> TabFrame -> TabPage1 ->
Button2 -> Move ($mainwindow -> TabFrame ->
TabPage1 -> ScaleWidth / 2 , $mainwindow ->
TabFrame -> TabPage1 -> ScaleHeight - 30);

$mainwindow -> StatusBar -> Move (0,
$windowheight - $mainwindow -> StatusBar -> Height);
$mainwindow -> StatusBar -> Resize
($windowwidth, $mainwindow -> StatusBar -> Height);

}

Discussion

  • Robert May
    Robert May
    2005-12-01

    • priority: 5 --> 1
    • assigned_to: nobody --> robertemay
    • status: open --> open-wont-fix
     
  • Robert May
    Robert May
    2006-10-15

    • status: open-wont-fix --> closed-wont-fix