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

    Mar 9, 2008
    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


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

    ControlRef tmpControl;
    ControlID tmpControlID; = 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