Message Bar problems

Post Reply
Gilbert
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Message Bar problems

Post 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 ? :(
Gilbert Vaillancourt
turbolog@videotron.ca
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Gilbert,

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

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
Gilbert
Posts: 74
Joined: Thu Oct 20, 2005 4:30 pm
Location: Canada

Post 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 :(
Gilbert Vaillancourt
turbolog@videotron.ca
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
Post Reply