template main => sub {
    window {
        attr {
            id => "findfile-window", title => "Find Files", orient => "horizontal",
            xmlns => $::XUL_NAME_SPACE,
        };

        vbox {
            show('buttons');
            show('textboxes');
            show('checkbox');
            show('radio_buttons');
        }
    };
};

private template buttons => sub {
    hbox {
        button { attr { label => "Normal" } }
        button { attr { label => "Disabled", disabled => 'true' } }
    }
};

private template textboxes => sub {
    hbox {
        label { attr { control => 'some-text', value => 'Enter some text' } }
        textbox { attr { id => 'some-text' } }
        label { attr { control => 'some-password', value => 'Enter a password' } }
        textbox { attr { id => 'some-password', type => 'password', maxlength => '8' } }
    }
};

private template checkbox => sub {
    checkbox { attr { id => 'case-sensitive', checked => 'true', label => 'Case sensitive' } }
};

private template radio_buttons => sub {
    groupbox {
        caption { attr { label => 'Colors' } }
        radiogroup {
          for my $id ( qw< orange violet yellow > ) {
              radio { attr { id => $id, label => ucfirst($id), $id eq 'violet' ? (selected => 'true') : () } }
          }
        }
    }
};
