<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Setting line position in an edit-box uicontrol</title> <atom:link href="http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/feed/" rel="self" type="application/rss+xml" /><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/</link> <description>Charting Matlab's unsupported hidden underbelly</description> <lastBuildDate>Mon, 21 May 2012 11:05:42 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.1</generator> <item><title>By: Nick</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-82023</link> <dc:creator>Nick</dc:creator> <pubDate>Wed, 18 Apr 2012 13:37:28 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-82023</guid> <description>Johannes,Similar to you, I&#039;m adding a console/log window to a GUI and would like the scroll bar at the bottom.  With a list box, were you able to get rid of the &#039;jump&#039; problem altogether?I think there might be a solution using an edit box by diving deeper into the underlying Java. However, I have only recently started using the findjobj utility, so I could be wrong about that.Nick</description> <content:encoded><![CDATA[<p>Johannes,</p><p>Similar to you, I&#8217;m adding a console/log window to a GUI and would like the scroll bar at the bottom.  With a list box, were you able to get rid of the &#8216;jump&#8217; problem altogether?</p><p>I think there might be a solution using an edit box by diving deeper into the underlying Java. However, I have only recently started using the findjobj utility, so I could be wrong about that.</p><p>Nick</p> ]]></content:encoded> </item> <item><title>By: Sainath M</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-72868</link> <dc:creator>Sainath M</dc:creator> <pubDate>Tue, 31 Jan 2012 10:40:23 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-72868</guid> <description>I can able to work now...
Thank you..</description> <content:encoded><![CDATA[<p>I can able to work now&#8230;<br
/> Thank you..</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-72855</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Tue, 31 Jan 2012 08:54:55 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-72855</guid> <description>@Sainath - read the third paragraph: &lt;i&gt;&quot;The first step in accessing the underlying Java control is to download my FindJObj submission on the File Exchange&quot;&lt;/i&gt;</description> <content:encoded><![CDATA[<p>@Sainath &#8211; read the third paragraph: <i>&#8220;The first step in accessing the underlying Java control is to download my FindJObj submission on the File Exchange&#8221;</i></p> ]]></content:encoded> </item> <item><title>By: Sainath M</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-72823</link> <dc:creator>Sainath M</dc:creator> <pubDate>Tue, 31 Jan 2012 04:13:24 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-72823</guid> <description>Hello Yair,I am facing one problem when I write Java methods in Matlab.
Ex:
&gt;&gt; % Create the multi-line edit-box
&gt;&gt; str = {&#039;multi&#039;,&#039;line&#039;,&#039;editbox&#039;};
&gt;&gt; hEdit = uicontrol(&#039;style&#039;,&#039;edit&#039;,&#039;max&#039;,3,&#039;string&#039;,str);This is the script I am writing in Matlab command window. After that
when I type the code
&gt;&gt; jhEdit = findjobj(hEdit)Matlab is showing error??? Undefined function or method &#039;findjobj&#039; for input arguments of type
&#039;double&#039;.It is the first time I am using Jmethods in Matlab, will you please guide me what is the problem...Thank you for your time,Regards,
Sainath M.</description> <content:encoded><![CDATA[<p>Hello Yair,</p><p> I am facing one problem when I write Java methods in Matlab.<br
/> Ex:<br
/> &gt;&gt; % Create the multi-line edit-box<br
/> &gt;&gt; str = {&#8216;multi&#8217;,'line&#8217;,'editbox&#8217;};<br
/> &gt;&gt; hEdit = uicontrol(&#8216;style&#8217;,'edit&#8217;,'max&#8217;,3,&#8217;string&#8217;,str);</p><p>This is the script I am writing in Matlab command window. After that<br
/> when I type the code</p><p>&gt;&gt; jhEdit = findjobj(hEdit)</p><p>Matlab is showing error</p><p>??? Undefined function or method &#8216;findjobj&#8217; for input arguments of type<br
/> &#8216;double&#8217;.</p><p>It is the first time I am using Jmethods in Matlab, will you please guide me what is the problem&#8230;</p><p>Thank you for your time,</p><p>Regards,<br
/> Sainath M.</p> ]]></content:encoded> </item> <item><title>By: Johannes</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-57868</link> <dc:creator>Johannes</dc:creator> <pubDate>Tue, 27 Sep 2011 14:12:07 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-57868</guid> <description>Never mind, I found a different solution using listboxes. It works now as I want it to be.All the best,
Johannes</description> <content:encoded><![CDATA[<p>Never mind, I found a different solution using listboxes. It works now as I want it to be.</p><p>All the best,<br
/> Johannes</p> ]]></content:encoded> </item> <item><title>By: Johannes</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-57484</link> <dc:creator>Johannes</dc:creator> <pubDate>Fri, 23 Sep 2011 11:38:54 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-57484</guid> <description>Hello Yair,first of all, thank you for the superb coding, findjobj has saved me from a lot of trouble. I am using your code to set the caret position to the last line inside an edit text box (used as a log inside my GUI) whenever I update the output.
One problem remains: To write something inside the edit text box, I am using
&lt;pre lang=&quot;matlab&quot;&gt;
% get existing text
exTex=get(handles.outputWindow,&#039;String&#039;);
% new Text to be appended
addTest=sprintf(&#039;Some new text&#039;);
% write new text
newText=sprintf(&#039;%s \r %s &#039;, exText, addText);
% update output handle
set(handles.outputWindow,&#039;String&#039;,newText);
&lt;/pre&gt;The problem now is: the set command in the last line resets the scroll bar to the top. So if some lines stream into the output window, it jumps to the top and quickly back to the bottom (due to the set.caretPosition). Is there any other way I could write lines into my output window, without resetting the scroll bar to the top?Thanks and lots of regards from Germany!</description> <content:encoded><![CDATA[<p>Hello Yair,</p><p>first of all, thank you for the superb coding, findjobj has saved me from a lot of trouble. I am using your code to set the caret position to the last line inside an edit text box (used as a log inside my GUI) whenever I update the output.<br
/> One problem remains: To write something inside the edit text box, I am using</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;"><span style="color: #228B22;">% get existing text</span>
exTex=<span style="color: #0000FF;">get</span><span style="color: #080;">&#40;</span>handles.<span style="">outputWindow</span>,<span style="color:#A020F0;">'String'</span><span style="color: #080;">&#41;</span>;
<span style="color: #228B22;">% new Text to be appended</span>
addTest=<span style="color: #0000FF;">sprintf</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'Some new text'</span><span style="color: #080;">&#41;</span>;
<span style="color: #228B22;">% write new text </span>
newText=<span style="color: #0000FF;">sprintf</span><span style="color: #080;">&#40;</span><span style="color:#A020F0;">'%s \r %s '</span>, exText, addText<span style="color: #080;">&#41;</span>;
<span style="color: #228B22;">% update output handle</span>
<span style="color: #0000FF;">set</span><span style="color: #080;">&#40;</span>handles.<span style="">outputWindow</span>,<span style="color:#A020F0;">'String'</span>,newText<span style="color: #080;">&#41;</span>;</pre></div></div><p>The problem now is: the set command in the last line resets the scroll bar to the top. So if some lines stream into the output window, it jumps to the top and quickly back to the bottom (due to the set.caretPosition). Is there any other way I could write lines into my output window, without resetting the scroll bar to the top?</p><p>Thanks and lots of regards from Germany!</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-40639</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Tue, 19 Apr 2011 19:20:20 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-40639</guid> <description>This should happen automatically. Perhaps you simply need to add a call to &lt;code&gt;jEdit.repaint();&lt;/code&gt;In any case, here&#039;s how to programmatically move the vertical scrollbar to the bottom:
&lt;pre lang=&quot;matlab&quot;&gt;
jVScroll = jhEdit.getVerticalScrollBar;
jVScroll.setValue(jVScroll.getMaximum);
jhEdit.repaint;
&lt;/pre&gt;More information about the scroll-bars: &lt;a target=&quot;_blank&quot; href=&quot;http://undocumentedmatlab.com/blog/customizing-listbox-editbox-scrollbars/&quot; rel=&quot;nofollow&quot;&gt;http://UndocumentedMatlab.com/blog/customizing-listbox-editbox-scrollbars/&lt;/a&gt;</description> <content:encoded><![CDATA[<p>This should happen automatically. Perhaps you simply need to add a call to <code>jEdit.repaint();</code></p><p>In any case, here&#8217;s how to programmatically move the vertical scrollbar to the bottom:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">jVScroll = jhEdit.<span style="">getVerticalScrollBar</span>;
jVScroll.<span style="">setValue</span><span style="color: #080;">&#40;</span>jVScroll.<span style="">getMaximum</span><span style="color: #080;">&#41;</span>;
jhEdit.<span style="">repaint</span>;</pre></div></div><p>More information about the scroll-bars: <a
target="_blank" href="http://undocumentedmatlab.com/blog/customizing-listbox-editbox-scrollbars/" rel="nofollow">http://UndocumentedMatlab.com/blog/customizing-listbox-editbox-scrollbars/</a></p> ]]></content:encoded> </item> <item><title>By: Sylvain</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-40575</link> <dc:creator>Sylvain</dc:creator> <pubDate>Tue, 19 Apr 2011 05:26:13 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-40575</guid> <description>Hi everyone,I have used the FindObj fonction (great job M. Altman) and the carret does go to the end of the editbox, but the problem is that the view don&#039;t follow the carret...
I would like to know if you have any idea, maybe a simple setting that I don&#039;t know , to get the scrollbar at the bottom of the text (I am quite a beginner with the whole matlab graphic interface).Regards,Sylvain</description> <content:encoded><![CDATA[<p>Hi everyone,</p><p>I have used the FindObj fonction (great job M. Altman) and the carret does go to the end of the editbox, but the problem is that the view don&#8217;t follow the carret&#8230;<br
/> I would like to know if you have any idea, maybe a simple setting that I don&#8217;t know , to get the scrollbar at the bottom of the text (I am quite a beginner with the whole matlab graphic interface).</p><p>Regards,</p><p>Sylvain</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-1122</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Mon, 01 Jun 2009 17:38:24 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-1122</guid> <description>@Bindermann - I can think of two reasons for this problem:1. the figure or one of its components is hidden, thereby causing a problem in retrieving the RootPane and/or TopLevelAncestor (=Frame peer) references.2. are you using the latest version of FindJObj? - one of the latest versions increased the size/position tolerance used when trying to locate a handle onscreen and this may solve the problem of FindJObj not finding this handle.If none of these appear to be the cause, then please email me a reproducible code snippet and I&#039;ll try to fix the problem.</description> <content:encoded><![CDATA[<p>@Bindermann &#8211; I can think of two reasons for this problem:</p><p>1. the figure or one of its components is hidden, thereby causing a problem in retrieving the RootPane and/or TopLevelAncestor (=Frame peer) references.</p><p>2. are you using the latest version of FindJObj? &#8211; one of the latest versions increased the size/position tolerance used when trying to locate a handle onscreen and this may solve the problem of FindJObj not finding this handle.</p><p>If none of these appear to be the cause, then please email me a reproducible code snippet and I&#8217;ll try to fix the problem.</p> ]]></content:encoded> </item> <item><title>By: A. Bindemann</title><link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/#comment-1118</link> <dc:creator>A. Bindemann</dc:creator> <pubDate>Mon, 01 Jun 2009 12:25:14 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-1118</guid> <description>Yair,I&#039;m having a problem with findjobj.  It returns an empty result when I pass it the MATLAB handle of an edit box.    The problem appears to begin in the call to getRootPanel on line 319 (jRootPane = jFigPanel.getRootPane).The function falls through to line 346 (jRootPane = jRootPane.getTopLevelAncestor;) which also returns an empty result.I&#039;m trying to use a MATLAB GUI to display a message log, and would like to position the cursor at the end of the edit box.  Interestingly, the edit box behavior under R14SP3 always placed the cursor at the end of the edit box.  The behavior changed somewhere between that version and R2007b.Any ideas you might have would be appreciated.Thanks,
A. Bindemann</description> <content:encoded><![CDATA[<p>Yair,</p><p>I&#8217;m having a problem with findjobj.  It returns an empty result when I pass it the MATLAB handle of an edit box.    The problem appears to begin in the call to getRootPanel on line 319 (jRootPane = jFigPanel.getRootPane).</p><p>The function falls through to line 346 (jRootPane = jRootPane.getTopLevelAncestor;) which also returns an empty result.</p><p>I&#8217;m trying to use a MATLAB GUI to display a message log, and would like to position the cursor at the end of the edit box.  Interestingly, the edit box behavior under R14SP3 always placed the cursor at the end of the edit box.  The behavior changed somewhere between that version and R2007b.</p><p>Any ideas you might have would be appreciated.</p><p>Thanks,<br
/> A. Bindemann</p> ]]></content:encoded> </item> </channel> </rss>

<!-- W3 Total Cache: Minify debug info:
Engine:             disk: basic
Theme:              b7666
Template:           single
-->
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: undocumentedmatlab.com @ 2012-05-21 19:18:30 -->

<!-- W3 Total Cache: Page cache debug info:
Engine:             disk: enhanced
Cache key:          blog/setting-line-position-in-edit-box-uicontrol/feed/_index.xml_gzip
Caching:            enabled
Status:             not cached
Creation Time:      0.664s
Header info:
X-Pingback:         http://undocumentedmatlab.com/blog/xmlrpc.php
Set-Cookie:         wpgb_visit_last_php-default=1337653110; expires=Wed, 22-May-2013 02:18:30 GMT; path=/
Link:               <http://undocumentedmatlab.com/?p=81>; rel=shortlink
Content-Type:       text/xml; charset=UTF-8
Last-Modified:      Tue, 22 May 2012 02:18:30 GMT
Vary:               Accept-Encoding, Cookie
Expires:            Tue, 22 May 2012 03:18:30 GMT
Pragma:             public
Cache-Control:      public, must-revalidate, proxy-revalidate
Etag:               37f8c0ff7ac9390a6300f386ee0a5757
Content-Encoding:   gzip
-->
