Page 1 of 1

Message Bar problems

Posted: Sun May 21, 2006 2:41 pm
by Gilbert
Hi All,

At window activation I prompt `LogIn` in the message bar. So far so good
Once the user has entered is login name I want to display the user name in the message bar.

So I use:

oMsgBar:SetMsg(cUserName), oMsgBar:Refresh()

I can see the user name display for a fraction of second and `LogIn` redisplays again on top.

What am I doing wrong ? :(

Posted: Sun May 21, 2006 5:42 pm
by Antonio Linares
Gilbert,

Do you have a menuitem that uses ... MESSAGE "Login" ?

Posted: Fri May 26, 2006 8:09 pm
by James Bott
I had fits with this too. It may be a bug. Here is a workaround.

oWnd:oMsgBar:cMsgDef:=cUserName
oWnd:oMsgBar:setMsg("")

cMsgDef is the message that gets displayed.

This works for me.

James

Posted: Fri Oct 06, 2006 7:27 pm
by Gilbert
Hi all,


Sorry it took so long to reply, too muxh work I guess.

I dont have any menuitem with MESSAGE `Login`

I also tried James Bott solution but it did`nt work.


Regards,

Gilbert :(

Posted: Fri Oct 06, 2006 7:40 pm
by James Bott
Gilbert,

Sorry, you also need to do a refresh().

Code: Select all

// Purpose: To test changing the message bar message

#include "fivewin.ch"

function main()
   local oWnd,oBar
   local cUsername:= "James"

   define window oWnd

   define buttonbar oBar of oWnd
   define button of oBar ;
     action (oWnd:oMsgBar:cMsgDef:= cUsername, oWnd:oMsgBar:setMsg(""),oWnd:oMsgBar:refresh())

   set message of oWnd to "Login"

   activate window oWnd

return nil