Dialogs with popup menus

| | Comments (0)
For the longest time, dialogs in MacPerl could not have popup menus. Well, you could include one, but it wouldn't respond to clicks. If you wanted one, you needed to convert your Dialog into a Window, which means a lot more manual work to handle various things that Dialogs handle for you. So last night I decided to find out why.

I tracked it down to a difference between how the Window and Dialog classes were handling clicks. Window:

sub click {
    my($self, $pt) = @_;
    for my $pane (@{$self->{panes}}) {
        if ($pane->click($self, $pt)) {
            return 1;
    defined($handled = $self->callhook("click", @_)) and return 1;


sub click {
    defined($handled = $self->callhook("click", @_)) and return 1;

Popup menus were appearing via a pane, and the clicks were not being propogated down to the panes. Adding in the missing code to Mac::Dialogs::click(), popup windows now work in dialogs.

FWIW, I am making an über search, so that I can just type in a search term and select a search engine and it'll open my browser to the results, as described in my entry about Google searching. use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on May 10, 2002 5:15 AM.

New Server was the previous entry in this site.

The Sfio And The Bizarre is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.