[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Toolbox] Event Handling Basics




>
>>2) The examples in the MacPerl book imply that redrawing a window consists
>>of re-executing the subroutine that drew the contents of the window
>>initially when the 'redraw' event is detected.  By extension, the
>>implication is that one has to have 'control' over the window's contents
>>(i.e, have created the window's content in the first place).  Can one update
>>(redraw) a window that one has not created the contents, like an "Open" or
>>"Save" dialog box?
>
>Not recommended.  You could try it if you are brave.  I don't know how much
>you could control it, if at all.

It's been a while since I've done any toolbox programming, so forgive me if
this isn't entirely helpful.  I'm not actually sure what you're doing that
you want to redraw an Open or Save dialog.  Under pre-Nav services stuff,
the standard file dialog boxes were fairly extensible.  You just have to
create a custom dialog resource, and then make use of the proc hooks to add
the functionality for what you added.

>
>
>>Specifically, what I am trying to do is update a Navigation Services
>>(Navigation.pm) 'NavGetFile' window, and I'm stuck.  I have found that
>>simply by placing a dummy event-handling subroutine in the NavGetFile call:
>>
>>     NavGetFile($defaultLocation, $dialogOptions, $typeList, sub {});
>>
>>that the dialog box becomes movable and resizable (NavPutFile comes this way
>>by default, and also seems to 'announce' itself as such, since Default
>>Folder 3.0.1 modifies the navigation buttons, and adds its own).  So, taking
>>the advice in Inside Macintosh, I wanted to write a simple subroutine to
>>handle the updating of the window.
>
>Ah, that is a little different than dealing with a window you didn't
>create, because your function would be, indeed, used by the same "object"
>that created the window.
>
>I do not know how to do what you want to do, so I want attempt to help on
>the specifics.  :)

I'm also curious why you actually want to update the whole window?  You
should only have to worry about anything you added - and gratefully let the
system handle everything else.

>
>
>>b) $macWindow->window "Returns the underlying toolbox GrafPtr" of the
>>window, is there a way to take an existing window's GrafPtr and associate it
>>with MacWindows object, so the method's defined for the class can be used?
>>(I was hoping, praying that my $windowMac = new MacWindow(GetWMgrPort())
>>might do it, but I don't think it worked).
>

I'd think you'd want to do something different than that.  What I think
you'd want to do is set the grafPort of the new MacWindow to the nav
services window grafPort.

-Jeff Lowrey



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org