Hello, I have the following problem. I have made this window:
which is self-explanatory. All command event handlers are handled properly.
There is one problem though. Below is the code that handles the conversion to uppercase:
the problem is that I don't see any letters drawn on the second text field! What is my fault?
which is self-explanatory. All command event handlers are handled properly.
There is one problem though. Below is the code that handles the conversion to uppercase:
Code:
pascal void MyCommandHandler(WindowRef window){
cout << "handler\n";
ControlHandle stringInTextEdit;
ControlHandle stringOutTextEdit;
ControlID stringInControlID = {kControlSignature, kStringInControlID};
ControlID stringOutControlID = {kControlSignature, kStringOutControlID};
CFMutableStringRef theString;
GetControlByID(window, &stringInControlID, &stringInTextEdit);
GetControlByID(window, &stringOutControlID, &stringOutTextEdit);
GetControlData(stringInTextEdit,
kControlEntireControl,
kControlEditTextCFStringTag,
sizeof(CFStringRef),
&theString,
NULL);
CFStringUppercase(theString,NULL);
SetControlData(stringOutTextEdit,
kControlEntireControl,
kControlEditTextCFStringTag,
sizeof(CFStringRef),
&theString);
DrawOneControl(stringOutTextEdit);
cout << theString;
}