Anyone have an idea why the proxy icon *appears* to be disabled. I checked
the documentation and found no information on how to change the state but
only that it can and should be changed.
Thanks,
W.
-----Original Message-----
From: Robert Purves
To: futurebasic@...
Sent: 10/21/03 1:38 AM
Subject: Re: [FB] window path proxy icon [was: what is that called]
On Tuesday, October 21, 2003, Edwards, Waverly wrote:
> You must have read my mind. Thank you for all your help.
> Now allow me to help in my own small way.
>
> Instead of using ev.what = 0 use %event,0
> I know they SHOULD do the same thing but whenever I need to clear an
> event I
> use %event,0 as I have found ev.what and eventRecPtr&.evtNum% =
> _nullEvt to
> not always be reliable.
>
> One day I would like to really know why it always works when other
> methods
> do not.
Thank you for the vital clue to a hard-to-find error in my code.
The bug is not in ev.what = 0, but in my declaration of ev.
dim as EventRecord ev meant that we were working with a copy of
the event, and ev.what = 0 naturally failed to have any effect on the
original.
I feel sure that this is not the first time I, and others, have made
the mistake.
Here is the corrected version of the window path proxy icon demo:
local mode
local fn DoEvent
'~'1
//dim as EventRecord ev // stupid bug :-(
dim ev as ^EventRecord // ah, that's better...
dim as WindowRef @ evntWnd
dim as OSStatus ignore
dim as long @ ignoreMenuResult
ev = event
long if ( ev.what == _mButDwnEvt )
select fn FindWindow( #ev.where, @evntWnd )
case _inProxyIcon, _inDrag
long if ( fn IsWindowPathSelectClick( evntWnd, #ev ) )
ignore = fn WindowPathSelect( evntWnd, 0, @ignoreMenuResult )
ev.what = 0
end if
end select
end if
end fn
dim as OSStatus err
dim as FSSpec fss
on event fn DoEvent
long if ( files$( _FSSpecOpen,,, fss ) != "" )
window 1, fss.name
err = fn SetWindowProxyFSSpec( window( _wndRef ), fss )
print "Command click the title"
do
HandleEvents
until 0
end if
Robert P.
--
To unsubscribe, send ANY message to
<futurebasic-unsubscribe@...>