This is a big trouble for me.
I spent many times without success.
I want to make a simple window with button and every time I press it
I would create another windows. Simple, but I have only problem.
(I like this example also to understand mui subclass)
What I have do:
- In the headers I declare a dispatcher
ULONG Dispatcher(void);
and a simple data
struct MyData
{
int dummy;
};
- in the main I create simple gui with windows and button. This is ok.
I haven't any problem.
- also, in the main I create my custom class:
MyClass = MUI_CreateCustomClass(base, MUIC_Window, NULL, sizeof(
struct MyData), (APTR)&MyDispatcher);
With returnId (I know this is not a good solution but I after I solve
this little problem) I catch the press button event and I create a new
class. (newwin is pointer object)
newwin = (APTR)NewObject(MyClass->mcc_Class,NULL, TAG_DONE);
- in the dispatcher in om_new switch:
return MyNew(cl, obj, (APTR)msg);
- this is my om_new function:
static ULONG MyNew(struct IClass *cl, Object *obj, struct opSet *msg){
obj = (Object *)DoSuperNew(cl, obj,
WindowContents, VGroup,
Child, HGroup, MUIA_Group_SameSize, TRUE,
Child, HSpace(0),
Child, HSpace(0),
Child, HSpace(0),
End,
End,
TAG_MORE, msg->ops_AttrList);
return (ULONG)obj;
}
Here, all' is ok. Obj is not null. I take many examples on the net
(psi.c especially).
But I can't open this windows. I use:
set(obj,MUIA_Window_Open,TRUE);
the program crash. On UAE I have to restart computer, on morphos my
windows freeze.
I try to make this instruction in dispatcher, in main or at the end of
this MyNew function without any results.
I can manage the (new)window pointer with other functions like
MUIA_Window_Title, MUIA_Window_ID...
The flow is correct because my program goes in dispatcher and after
this in MyNew.
Does anybody can help me?
Tks.
Luca.
Visit http://www.amiga.dk/tumult for MUI-related
information, especially about MUI custom classes.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MUI/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/