Hey all,
Ariel Serbin and I have notice something strange occurring with the splitter demo, and specifically the splitter control itself. Run the script attached, a previous post contained it. Then, drag the splitter to the left a short distance, then back to the right and equal amount. You'll notice that there is a nasty artifact showing up on the screen. Of course when your test in the text field overlaps this artifact, it is resolved within the relative area of the text [Rob and all may know the proper names, but unfortunately I'm not that in depth]. I believe it has something to with the underlying DC objects that are drawing the splitter control, but am fully aware that I don't have the understanding to fix this. WinXP SP2, AS 5.8.7, Win32-GUI 1.02 and Win32-GUI 1.02_03 this occurs. Jason P. Note: For ease of replicable visibility, we've widened the splitter control in the code below. --CODE- #!perl -w use strict; use warnings; use Win32::GUI; my $mw = Win32::GUI::Window->new( -title => "Splitter Test", -pos => [100,100], -size => [500,400], -onResize => \&main_resize, ); $mw->AddTextfield( -name => "TF1", -multiline => 1, -width => 200, ); $mw->AddSplitter( -name => "SP", -left => 200, -width => 10, #FATTY -onRelease => \&do_splitter, ); $mw->AddTextfield( -name => "TF2", -multiline => 1, -left => 200 + $mw->SP->Width(), ); $mw->Show(); Win32::GUI::Dialog(); exit(0); # NEM splitter event gets 2 parameters. The first (as always) # is the window object the wvwnt came from - in this case the # splitter window; The second depends on the splitter orientation: # if horzontal it is the top coordinate; if vertical it is # the left coordinate. (coordinates relative to the parent's # client area) # The splitter window is moved by the splitter object, so you only # have to re-position your other windows sub do_splitter { my ($splitter, $coord) = @_; $mw->TF1->Width($coord); $mw->TF2->Move($coord+$mw->SP->Width(), 0); $mw->TF2->Resize($mw->ScaleWidth()-$mw->SP->Width(), $mw->ScaleHeight()); } sub main_resize { my $self = shift; $mw->TF1->Height($self->ScaleHeight()); $mw->SP->Height($self->ScaleHeight()); $mw->TF2->Resize($mw->ScaleWidth()-$self->TF1->Width()-$mw->SP->Width(), $mw->ScaleHeight()); } __END__
<<attachment: splitterbug.JPG>>