setMargins - Newbie Question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

setMargins - Newbie Question

Don Hamilton
Hi,

I have a listBox from where the user steps through aLookup keys and where
the associations are displayed in a multi-line text presenter. In trying to
enhance the text display I have the following in onViewOpened.

super onViewOpened.
textPresenter view setMargins:4.

This works fine when the view is opened from a workspace but the margins do
not take effect in the deployed app until clicking on a listbox selection,
the margins remain from then on.

Where am I going wrong?. Should the text be pre-formatted?

Should add that I'm using Dolphin 3 and ADK.


Reply | Threaded
Open this post in threaded view
|

Re: setMargins - Newbie Question

Christopher J. Demers
Don Hamilton <[hidden email]> wrote in message
news:9trfcb$7c1$[hidden email]...
...
> I have a listBox from where the user steps through aLookup keys and where
> the associations are displayed in a multi-line text presenter. In trying
to
> enhance the text display I have the following in onViewOpened.
>
> super onViewOpened.
> textPresenter view setMargins:4.
>
> This works fine when the view is opened from a workspace but the margins
do
> not take effect in the deployed app until clicking on a listbox selection,
> the margins remain from then on.
>
...

I don't have experience with your exact issue, however a few thoughts come
to mind.

Are you deploying this based on an open window, or are you doing a
SessionManager subclass code based deployment?  If you are doing non code
based deployment the view is not running onViewOpened and is instead being
recreated from a object that may not be saving that attribute.  However I do
not understand why it would be using a margin after you change the selection
if that is the case.

I have a vague memory of an issue slightly similar to this with tab stop
settings inside a multiline text box.  They were behaving oddly (in general,
not just in a deployed app), so I just used a RichTextEdit view instead with
preformatted RTF text.  If you can't get the margins to work consistently
you might look into an RichTextEdit.

This would be a real kludge, but if you can make it work consistently and it
does not look too odd you could force a selection change in the listbox (or
do what ever that does) to get the margins set in your onViewOpened method.

Good luck, hope this helps,
Chris