| MATLAB Central > MATLAB Newsreader > text alignment in GUI for long string |
|
|
|
Subject: text alignment in GUI for long string From: craq Date: 6 Aug, 2012 14:27:14 Message: 1 of 13 |
|
Hi, |
|
Subject: text alignment in GUI for long string From: matt dash Date: 7 Aug, 2012 03:57:08 Message: 2 of 13 |
|
"craq" wrote in message <jvok82$4p0$1@newscl01ah.mathworks.com>... |
|
Subject: text alignment in GUI for long string From: craq Date: 7 Aug, 2012 07:19:23 Message: 3 of 13 |
|
thanks Matt (and Yair, I've picked up a fair bit on UI programming from your blog) |
|
Subject: text alignment in GUI for long string From: craq Date: 7 Aug, 2012 09:49:15 Message: 4 of 13 |
|
one small thing... the setting is not persistent. I have it set in my callback function, so that every time I change the string, it updates the CaretPosition. But this doesn't work if I click in the text field, and then somewhere else on the GUI. The callback is not triggered, and the text goes back to normal (left aligned). Is there a workaround for this? |
|
Subject: text alignment in GUI for long string From: matt dash Date: 7 Aug, 2012 15:01:13 Message: 5 of 13 |
|
"craq" wrote in message <jvqoar$eei$1@newscl01ah.mathworks.com>... |
|
Subject: text alignment in GUI for long string From: craq Date: 7 Aug, 2012 15:33:13 Message: 6 of 13 |
|
brilliant! thanks =) |
|
Subject: text alignment in GUI for long string From: Yair Altman Date: 7 Aug, 2012 15:39:17 Message: 7 of 13 |
|
related articles: |
|
Subject: text alignment in GUI for long string From: Milan Date: 21 Sep, 2012 06:15:15 Message: 8 of 13 |
|
May it be possible, that the setCaretPosition attribute was introduces after 2010b? Matlab cries loud that this attribute cannot be assigned. I did not create the object by using uicontrol, thou. I used GUIDE to create a text box and I manipulated that with the suggested script. M |
|
Subject: text alignment in GUI for long string From: craq Date: 21 Sep, 2012 07:09:10 Message: 9 of 13 |
|
I don't know when it was introduced, but I'm using 2010a and it works here. Have you tried running the test function that Matt posted? |
|
Subject: text alignment in GUI for long string From: Yair Altman Date: 21 Sep, 2012 09:43:09 Message: 10 of 13 |
|
"Milan" wrote in message <k3h0li$7ua$1@newscl01ah.mathworks.com>... |
|
Subject: text alignment in GUI for long string From: Milan Date: 21 Sep, 2012 11:24:08 Message: 11 of 13 |
|
With a script from Matt, I've got an error one line earlier: |
|
Subject: text alignment in GUI for long string From: Milan Date: 21 Sep, 2012 11:35:08 Message: 12 of 13 |
|
Thank you Yiar, thank you craq, |
|
Subject: text alignment in GUI for long string From: Yair Altman Date: 21 Sep, 2012 11:39:08 Message: 13 of 13 |
|
"Milan" wrote in message <k3hioo$6av$1@newscl01ah.mathworks.com>... |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| guide | Milan | 21 Sep, 2012 07:39:11 |
| text box | Milan | 21 Sep, 2012 07:39:11 |
| aligment right | Milan | 21 Sep, 2012 07:39:11 |
| bug | Milan | 21 Sep, 2012 07:39:11 |
| long string | Milan | 21 Sep, 2012 07:39:11 |
| undocumented | Yair Altman | 7 Aug, 2012 11:39:19 |
| java | Yair Altman | 7 Aug, 2012 11:39:19 |
| horizontalalignmen... | craq | 6 Aug, 2012 10:29:13 |
| text | craq | 6 Aug, 2012 10:29:13 |
| uicontrol | craq | 6 Aug, 2012 10:29:13 |
| gui | craq | 6 Aug, 2012 10:29:13 |
