Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Friday May 10, 2002
07:15 AM

Dialogs with popup menus

[ #4811 ]

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)) {
            $self->advance_focus($pane);
            return 1;
        }
    };
    my($handled);
    defined($handled = $self->callhook("click", @_)) and return 1;
}

Dialog:

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

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.