Hi! i'm studying class2.c example and i modified it a little bit.
I added to the class the Input_Mode_RelVerify so it acts as a button.
When i click the button i make start two methods:
1) i read a string costant with get and put it in a variable
2) i take that value and i want to use it as a muia text value of a textbox.
Problem: the best thing i can obtain is to trash the textbox. the worst it writes nothing. Prob'bly it's a "visibility" problem or a casting one.
These are two "requests". myobj is the are object and mytext a simple text area...
static ULONG mGet(struct IClass *cl,Object *obj,struct opGet *msg)
{
struct MyData *data = INST_DATA(cl,obj);
switch ((msg)->opg_AttrID)
{
case MYSNDATTR:
*(char**)msg->opg_Storage="foo";
return(TRUE);
}
return(DoSuperMethodA(cl,obj,(APTR)msg));
}
char caoo[7];
these are two domethods
DoMethod(MyObj, MUIM_Notify, MUIA_Pressed, FALSE, MyObj,3, OM_GET, MYSNDATTR,(ULONG)&caoo);
DoMethod(MyObj, MUIM_Notify, MUIA_Pressed, FALSE, mytext, 3, MUIM_Set, MUIA_Text_Contents,(ULONG) caoo);
I really don't understand why and i know it's surely a silly thing...
[ Edited by rebraist 04.03.2012 - 08:32 ]Mac Mini g4 1,5 mos 3.1 registered
Powerbook g4 1,67 mos 3.1 unregistered
Sam440 Os4.1.6
Aros-Aros-Aros.