From: Mike on
I am attempting to create a log box in the matlab gui but am having different issues with the different things I attempt.

What I am wanting to do is to have a box on my gui where I will display log messages in.

I tried to use the edit box to do this, but when I would try to enter another message to display it will clear my previous message. I want to be able to add another line onto this.

I tried to copy the current text to a string, then add another line to the string and display it that way but it didn't work.

I also tried to use uicontrol to make an edit box. Doing this I was able to get more than 1 line to be displayed, however when I go to another function in my matlab gui it overwrites the previous log messages.

What I want the log box to look like is something like the following:

If I push the 'Retrieve Data' button a message will display in the log box: 'Retrieving Data....'
when done retrieving it displays: 'Retrieving Data.... Done.'

Then I will press another button, 'Process Data' where it will display to log box: 'Processing Data....'

So I want the log box to look like:
-----
Retrieving Data.... Done.
Processing Data....
-----

I have looked all over the internet for someone else who has tried to do this but I haven't been able to find anything that works or that I can make sense out of.

Thank you for any help!
From: Andy on
"Mike " <mikejcunningham(a)gmail.com> wrote in message <i02ebq$1qm$1(a)fred.mathworks.com>...
> I am attempting to create a log box in the matlab gui but am having different issues with the different things I attempt.
>
> What I am wanting to do is to have a box on my gui where I will display log messages in.
>
> I tried to use the edit box to do this, but when I would try to enter another message to display it will clear my previous message. I want to be able to add another line onto this.
>
> I tried to copy the current text to a string, then add another line to the string and display it that way but it didn't work.
>
> I also tried to use uicontrol to make an edit box. Doing this I was able to get more than 1 line to be displayed, however when I go to another function in my matlab gui it overwrites the previous log messages.
>
> What I want the log box to look like is something like the following:
>
> If I push the 'Retrieve Data' button a message will display in the log box: 'Retrieving Data....'
> when done retrieving it displays: 'Retrieving Data.... Done.'
>
> Then I will press another button, 'Process Data' where it will display to log box: 'Processing Data....'
>
> So I want the log box to look like:
> -----
> Retrieving Data.... Done.
> Processing Data....
> -----
>
> I have looked all over the internet for someone else who has tried to do this but I haven't been able to find anything that works or that I can make sense out of.
>
> Thank you for any help!

You should probably use a listbox for this. The messages themselves should be controlled by, for example, the pushbutton callback. (Every function that needs to report something to the log should take care of that on its own.)

Also, look on the file exchange for Matt Fig's GUI examples. They will show you how to do lots of basic things with GUIs.
From: Jan Simon on
Dear Mike!

The task, you described, sounds definitely as a really fine job for the command window. Then some FPRINTF or DISP commands are easier to use than adding strings to the 'String' property of a listbox.

I've experimented with some methods to display logs also. But finally I decided to use a simple wrapper for DISP, which writes all messages to the command window and a file.

Jan
From: Frédéric Bergeron on
"Mike " <mikejcunningham(a)gmail.com> wrote in message <i02ebq$1qm$1(a)fred.mathworks.com>...
> I am attempting to create a log box in the matlab gui but am having different issues with the different things I attempt.
>
> What I am wanting to do is to have a box on my gui where I will display log messages in.
>
> I tried to use the edit box to do this, but when I would try to enter another message to display it will clear my previous message. I want to be able to add another line onto this.
>
> I tried to copy the current text to a string, then add another line to the string and display it that way but it didn't work.
>
> I also tried to use uicontrol to make an edit box. Doing this I was able to get more than 1 line to be displayed, however when I go to another function in my matlab gui it overwrites the previous log messages.
>
> What I want the log box to look like is something like the following:
>
> If I push the 'Retrieve Data' button a message will display in the log box: 'Retrieving Data....'
> when done retrieving it displays: 'Retrieving Data.... Done.'
>
> Then I will press another button, 'Process Data' where it will display to log box: 'Processing Data....'
>
> So I want the log box to look like:
> -----
> Retrieving Data.... Done.
> Processing Data....
> -----
>
> I have looked all over the internet for someone else who has tried to do this but I haven't been able to find anything that works or that I can make sense out of.
>
> Thank you for any help!

Hey,

Have you tried writing the text for the 'string' property in a cell array, where different cells mean different lines?
From: Mike on
Andy, I don't think the listbox will give me the format I want. But I will see what I can do with it.

Jan, that is what I've started to do recently, since I can't figure it out otherwise... I would rather not have to do that, but it's the 'if all else fails plan'.

Frédéric, I'm not sure if I know what you mean exactly, but I believe I have tried that with no avail.

Thanks for suggestions, will keep trying and post if I find a solution.