×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    3

    Red face Changing a Labels Text

    First of all, Hey all

    new to symbian C++ and stuff. Trying to learn but i am getting really annoyed as im having problems with such a simple thing =/

    ok im using the gui application with UI designer

    i just have a container with a button and a label

    here is the code i have:

    Code:
    void CKownageContainer::HandleButton1StateChangedL(CCoeControl*,TCoeEvent)
    	{
    	iLabel1->SetTextL(_L("hello"));
    	}
    this code kinda works in the emulator (when i say kinda i mean when you click the button, it does change the label text but it takes ~20 seconds)

    it doesnt work on my phone (when i press the button nothing happens)

    its just confusing me as to why it will work on the emulator and there are no compiler errors so im not sure if im doing something wrong like maybe i should have a function in one of the headers but if this is working on the emulator i thought it should work on my phone

    btw my phone is a nokia 5800 xpressmusic


    THANKS


    EDIT: App is now working on emulator after making it draw
    Code:
    TInt counta = 0;
    void CKownageContainer::HandleButton1StateChangedL(CCoeControl* , TCoeEvent)
    	{
    	counta++;
    	TBuf<20> text;
        text.Num(counta);
    	iLabel1->SetTextL(text);
    	iLabel1->DrawNow();
    	}
    is this the correct way?
    Last edited by SuperSeb; 2010-02-09 at 16:51. Reason: made code simpler

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Changing a Labels Text

    I'm not sure who would be calling the HandleButton1StateChangedL and try out the CAknButton as explained in: http://wiki.forum.nokia.com/index.ph...-_S60_Touch_UI

    Anyway the label setting should work just like that.

Similar Threads

  1. NewB Question -> How to obtain text from Text Edit
    By mikedeklerk in forum Symbian
    Replies: 8
    Last Post: 2008-03-17, 14:45
  2. Problems when changing text in edwin while in FEP transaction
    By thedawn1977 in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-09-07, 15:38
  3. Notifications of changing text input mode
    By GuusDavidson in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-11-07, 05:05
  4. Changing softkey labels problem
    By kburgess in forum Symbian
    Replies: 1
    Last Post: 2005-07-14, 19:59
  5. Replies: 2
    Last Post: 2005-06-22, 17:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×