Madhan
Madhan

Reputation: 1321

Controls Moving problem in Perl Win32::GUI

In Perl Win32::GUI desktop apps, While checkbox checked status I need to hide some controls and I need to move the controls to places which are hidden, for window compact view in Perl Win32::GUI. While using below code the control's images are repeated(duplicates) at the time of Controls movement. Kindly please give solution to avoid duplicate images of controls while moving and resizing the window.

sub Check_Status{
  if($btwdates->GetCheck eq 1){
    $Pushlistmodelabel->Move(30,168);
    $Fromdatelabel->Show();
    $get_From_day->Show();
    $Todatelabel->Show();
    $get_To_day->Show();
    $FoldersOption->Disable();


    $PushListButton->Move(200,255);
    $processlabel->Move(2,285);

    $PushListButton->Move(135,295);
    $processlabel->Move(2,320);


    $Selectionlabel->Move(195,168);
    $FilesOption->Move(200,195);
    $FoldersOption->Move(200,225);

    $With_root->Move(35,195);
    $Without_root->Move(35,225);
    $changeOption->Move(35,255);
    $replacepath->Move(180,255);
    Win32::GUI::DoEvents() >= 0;

  }
  else{
    $FoldersOption->Move(200,165);
    $FilesOption->Move(200,135);
    $FoldersOption->Enable();
    $Selectionlabel->Move(195,108);
    $Pushlistmodelabel->Move(30,108);

    $Fromdatelabel->Hide();
    $get_From_day->Hide();
    $Todatelabel->Hide();
    $get_To_day->Hide();


    $PushListButton->Move(200,195);
    $processlabel->Move(2,225);
    $Pushlistmodelabel->Move(30,108);
    $With_root->Move(35,135);
    $Without_root->Move(35,165);
    $changeOption->Move(35,195);
    $replacepath->Move(180,195);

  }
}

Upvotes: 0

Views: 325

Answers (1)

Andy
Andy

Reputation: 4866

Taking a shot in the dark (I don't have a win32 perl install), you could try the SetRedraw method. SetRedraw(0) before rearranging the controls and SetRedraw(1) afterwards. Maybe also a manual Redraw() afterwards.

There is a non-perl-specific discussion of some techniques for avoiding flicker when updating a window in the question Win32 GUI flickering on resize.

Upvotes: 2

Related Questions