Stefan Behrendt wrote:
Hi,

I have a couple of questions:

1. How do I change or remove the icon of a window?

Try $Window->SetIcon($icon)

2. Is it possible to start a Win32::GUI app. in an other programm wich
is running in fullscreen?

I expect so. You probably won't see anything though. What happened when you tried?

3. How do I change the colors of the titlebar, scrollbar(s),

From the Control panel: Display Properties->Appearance Tab.

textfields (background), etc.?
For the textfield, look up the -background option.

4. I want that the second textfield is always at the bottom of the
window, and that only the width is resizeable, not the height!

So only change the width:

#!perl -w
use strict;
use warnings;

use Win32::GUI 1.05 qw(WS_CLIPCHILDREN);

my $height_of_edit2 = 24;

my $mw = Win32::GUI::Window->new(
    -name     => "Window",
    -title    => "W",
    -pos      => [100, 100],
    -size     => [400, 400],
    -onResize => \&resize,
    -addstyle => WS_CLIPCHILDREN, # Reduce redraw flicker
);

$mw->AddTextfield(
    -name      => "Edit",
    -multiline => 1,
    -vscroll   => 1,
    -autovscroll => 1,
);

$mw->AddTextfield(
    -name      => "Edit2",
    -autovscroll => 1,
);

$mw->Show();
Win32::GUI::Dialog();
$mw->Hide();
exit(0);

sub resize {
    my ($self) = @_;
    my ($width, $height) = ($self->GetClientRect())[2..3];

    $self->Edit->Resize($width, $height - $height_of_edit2);
    $self->Edit2->Move(0, $height - $height_of_edit2);
    $self->Edit2->Resize($width, $height_of_edit2);

    return 0;
}
__END__

Regards,
Rob.

Reply via email to