how can i set the data to the text view control in xcode using carbon c?

Discussion in 'Mac Programming' started by chidambaram, Mar 10, 2008.

  1. macrumors member

    Joined:
    Mar 9, 2008
    #1
    hi all,

    I am working a carbon application in xcode.

    How can i set the data to the text view control?

    plz give some sample code...

    Thanks in advance and urgent plz...
     
  2. macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #2
    Not sure which text control you mean, but you can usually do this and have it work:

    Code:
    ControlRef tmpControl;
    ControlID tmpControlID;
    
    tmpControlID.id = 102;
    			
    tmpControlID.signature = 'Flat';
    			
    GetControlByID(GetControlOwner(theControl), &tmpControlID, &tmpControl);
    
    SetControlTitleWithCFString(tmpControl, CFSTR("Text can be changed dynamically."));
    This would work on a static text control, or any control with a title, obviously. You can also use SetControlProperty() and use the kControlStaticTextTextTag or kControlStaticTextCFStringTag constant, but you also have to provide a bunch of other params.
     

Share This Page