in reply to remove a combobox from a win32::GUI::Window

Marynella,
Once you add a checkbox, you can use the Show() and Hide() methods to... well, hide and show it. Here is some sample code to demonstrate:

use strict; use Win32::GUI; my $Window = new Win32::GUI::Window( -name => "Window", -left => 100, -top => 100, -width => 150, -height => 150, -title => "checkbox test", ); $Window->AddCheckbox( -name => 'mycheckbox', -left => 10, -top => 10, -height => 15, -width => 15, ); $Window->AddButton( -text => 'Hide checkbox', -left => 10, -top => 35, -height => 30, -width => 100, -name => 'btnHide', ); $Window->AddButton( -text => 'Show checkbox', -left => 10, -top => 75, -height => 30, -width => 100, -name => 'btnShow', ); $Window->Show(); Win32::GUI::Dialog(); sub Window_Terminate { return -1; } sub btnShow_Click { $Window->mycheckbox->Show(); } sub btnHide_Click { $Window->mycheckbox->Hide(); }
Update:
If you really want to *remove* a checkbox or combobox, something like this might work:

Win32::GUI::DestroyWindow($Window->{mycheckbox}{-handle}); delete $Window->{mycheckbox}; #use hashref syntax instead of autoload +ed methods

Replies are listed 'Best First'.
Re^2: remove a combobox from a win32::GUI::Window
by marynella (Novice) on Jun 10, 2004 at 14:58 UTC

    Thanx for the answer ... I really want to 'remove' the checkboxes/label/comboboxes and add new ones ..... (the checkboxes and labels are added according to what was selected in one first combobox and when a checkbox is checked on/off I add/remove other comboboxes ... but this is the project logic)

    I used:

    Win32::GUI::DestroyWindow($Window->$name);

    where  $name is the name of the label/checkbox or combobox I want to remove.