<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162828</link>
    <title>MATLAB Central Newsreader - setptr</title>
    <description>Feed for thread: setptr</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 29 Jan 2008 21:58:01 -0500</pubDate>
      <title>setptr</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162828#411877</link>
      <author>Mohammad salehizadeh</author>
      <description>I want to know  what is function of hittest and setptr in &lt;br&gt;
the following instruction?&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
%%%%%%%%%%%%%%&lt;br&gt;
% localHover %&lt;br&gt;
%%%%%%%%%%%%%%&lt;br&gt;
function localHover(eventSrc,eventData)&lt;br&gt;
&amp;nbsp;%---WindowButtonMotionFcn&lt;br&gt;
&amp;nbsp;&amp;nbsp;obj = hittest(eventSrc);&lt;br&gt;
&amp;nbsp;&amp;nbsp;switch lower(get(obj,'tag'))&lt;br&gt;
&amp;nbsp;&amp;nbsp;case 'slider'&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setptr(eventSrc,'hand');&lt;br&gt;
&amp;nbsp;&amp;nbsp;otherwise&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setptr(eventSrc,'arrow');&lt;br&gt;
&amp;nbsp;&amp;nbsp;end</description>
    </item>
    <item>
      <pubDate>Tue, 29 Jan 2008 22:12:03 -0500</pubDate>
      <title>Re: setptr</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162828#411880</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fno7h9$3mb$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Mohammad salehizadeh &amp;lt;en66salehi.mohammad@example.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I want to know  what is function of hittest and setptr in &lt;br&gt;
&amp;gt;the following instruction?&lt;br&gt;
&lt;br&gt;
&amp;gt;%%%%%%%%%%%%%%&lt;br&gt;
&amp;gt;% localHover %&lt;br&gt;
&amp;gt;%%%%%%%%%%%%%%&lt;br&gt;
&amp;gt;function localHover(eventSrc,eventData)&lt;br&gt;
&amp;gt; %---WindowButtonMotionFcn&lt;br&gt;
&amp;gt;  obj = hittest(eventSrc);&lt;br&gt;
&amp;gt;  switch lower(get(obj,'tag'))&lt;br&gt;
&amp;gt;  case 'slider'&lt;br&gt;
&amp;gt;     setptr(eventSrc,'hand');&lt;br&gt;
&amp;gt;  otherwise&lt;br&gt;
&amp;gt;     setptr(eventSrc,'arrow');&lt;br&gt;
&amp;gt;  end&lt;br&gt;
&lt;br&gt;
Both hittest() and setptr() appear to be local functions,&lt;br&gt;
or perhaps defined in some Matlab toolbox that I do not have.&lt;br&gt;
&lt;br&gt;
My deduction for setptr would be:&lt;br&gt;
&lt;br&gt;
function setptr(eventSrc,shape)&lt;br&gt;
&amp;nbsp;&amp;nbsp;set(eventSrc, 'Pointer', shape)&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
That is, set the figure pointer to be the given shape.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
hittest:&lt;br&gt;
&lt;br&gt;
The source event that you get for the localHover function is the&lt;br&gt;
figure, not an individual object. I believe hittest() applied to the&lt;br&gt;
figure must somehow determine which object within the figure is&lt;br&gt;
being pointed to, and returns the handle of that object.&lt;br&gt;
&lt;br&gt;
But checking the tag of an object against the string 'slider' would&lt;br&gt;
not be the most robust way to detect a uicontrol of type slider,&lt;br&gt;
as tags can be defined by the user. *Possibly* the object returned&lt;br&gt;
is even lower level than uicontrol(), if the localHover() function&lt;br&gt;
is intended to switch to the hand pointer only when you are pointing&lt;br&gt;
to some sub-parts of a slider uicontrol.&lt;br&gt;
-- &lt;br&gt;
This is a Usenet signature block. Please do not quote it when replying&lt;br&gt;
to one of my postings.&lt;br&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Signature_block&quot;&gt;http://en.wikipedia.org/wiki/Signature_block&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 30 Jan 2008 17:50:20 -0500</pubDate>
      <title>Re: setptr</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162828#412024</link>
      <author>Malcolm Lidierth</author>
      <description>setptr is a standard ML function - type help setptr&lt;br&gt;
&lt;br&gt;
hittest is undocumented. It returns the handle of the &lt;br&gt;
object under the CurrentPoint in the figure. If &lt;br&gt;
WindowButtonMotionFcn or WindowButtonUpFcn are inactive, &lt;br&gt;
that should correspond to gco, the last object clicked on.&lt;br&gt;
Otherwise it will be the object underneath the presently &lt;br&gt;
displayed cursor position. See the doc for figure &lt;br&gt;
properties (CurrentPoint).</description>
    </item>
    <item>
      <pubDate>Wed, 30 Jan 2008 18:15:06 -0500</pubDate>
      <title>Re: setptr</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/162828#412036</link>
      <author>Yair Altman</author>
      <description>&quot;Malcolm Lidierth&quot; &amp;lt;ku.ca.lck@htreidil.mloclam&amp;gt; wrote in&lt;br&gt;
message &amp;lt;fnqdcs$qu5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; setptr is a standard ML function - type help setptr&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I beg to disagree: setptr is an internal Matlab function&lt;br&gt;
that is unsupported and only semi-documented: it has a help&lt;br&gt;
page but no doc page and no online help. This is probably&lt;br&gt;
due to an error on the part of MathWorks programmers, who&lt;br&gt;
forgot to un-help this function using the standard &quot;This is&lt;br&gt;
undocumented, unsupported and will change in future versions&lt;br&gt;
yada yada&quot; message. There are a few other similar&lt;br&gt;
semi-documented functions lurking around (it's so much fun&lt;br&gt;
finding them!). The criteria for whether a function is&lt;br&gt;
supported or not seems to be the availability of a doc page,&lt;br&gt;
not a help page.&lt;br&gt;
&lt;br&gt;
Specifically regarding setptr - this is a very useful&lt;br&gt;
function that has been around for many years. It's a pity&lt;br&gt;
it's still officially unsupported (I haven't checked whether&lt;br&gt;
this has changed in R2008a).&lt;br&gt;
&lt;br&gt;
Yair Altman&lt;br&gt;
&lt;a href=&quot;http://ymasoftware.com&quot;&gt;http://ymasoftware.com&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

