I'm trying to draw a rectangle in a window using Win32::GUI::DC and
  I can't seem to get the background color of the rectangle to be the 
  same as the background color of the window.  The background color 
  of the rectangle comes out white.

  Here's my code to draw a button on a window and put a red rectangle around
  the button.  The background color of the rectangle is white instead of
  gray.  I played with BackColor and BkMode but it didn't seem to help.

  Any ideas?

#!perl

use Win32::GUI;

$DWin = new Win32::GUI::Window(
        -left   => 100,
        -top    => 100,
        -width  => 150,
        -height => 150,
        -name   => "DWin",
        -text   => "Test",
);

$DWin->Show();

$DWin->AddButton(
       -left=> 20,
       -top=>  20,
       -text => "OK",
       -name => "OK",
);

$DC = $DWin->GetDC;

# Color and thickness of rectangle border
$P = new Win32::GUI::Pen(
     -color => [150,0,0],
     -width => 1,
);

$DC->SelectObject($P);
$DC->Rectangle(10,10,66,60);

Win32::GUI::Dialog();

sub DWin_Terminate {
    return -1;
}



Reply via email to