Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
138 user(s) are online (122 user(s) are browsing Forums)

Members: 0
Guests: 138

more...

Support us!

Headlines

 
  Register To Post  

How compile MUI based programms to AOS4 ?
Home away from home
Home away from home


See User information
I have some aos3/aros/morphos related example, which i want port to aos4. So, i for first change all the includes on "proto/" (in case with mui, i add <proto/muimaster.h>, also i add #define __USE_INLINE__ 1 , but on linking stage i have tons of errors about "Reference to undefined symbol IMUIMaster".
I just do search for whole SDK on the "IMUIMaster" (for found correct lib.a to include), but found nothing.

First question is: have SDK by default any lib.a for mui , (like lubmui.a or libmuimaster.a), and if not have where get it.

And second one: I do no remember for now, need i open muimaster.library manually from code, or, just linking with right libmui.a will be enough ? For example for warp3d, i do that (when compile AOS3.x based progs):
Warp3DBase OpenLibrary("Warp3D.library"2L);

    
#ifdef __amigaos4__

    
IWarp3D = (struct Warp3DIFace *) GetInterface(Warp3DBase"main"1NULL);

    if (!
Warp3DBase && !IWarp3D) {
        
printf("Error opening Warp3D library\n");
        exit(
0);
    };

    
#endif


So should i do the same for Mui programms, and do OpenLibrary("muimaster.library") ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How compile MUI based programms to AOS4 ?
Quite a regular
Quite a regular


See User information
@kas1e

Yes, you have to open the library, then get the interface (the interface pointer is IMUIMaster).

Something like:

MUIBase = IExec->OpenLibrary ("MUI.library", 0);
if (MUIBase == NULL)
{
error recovery/death
}
else
IMUI = (struct MUIIFace *) IExec->GetInterface (
MUIBase, "main", 1, NULL);

cheers
tony
Go to top
Re: How compile MUI based programms to AOS4 ?
Home away from home
Home away from home


See User information
@tonyw

I do it like that for now:
struct Library                 *MUIMasterBase;
struct MUIMasterIFace *IMUIMaster;

   
MUIMasterBase OpenLibrary("muimaster.library"2L);
    if (!
MUIMasterBase) {
        
printf("Error opening muimaster library\n");
        exit(
0);
    };

    
IMUIMaster = (struct MUIMasterIFace *) GetInterface(MUIMasterBase"main"1NULL);

    if (!
MUIMasterBase && !IMUIMaster) {
        
printf("Error opening muimaster library\n");
        exit(
0);
    };


It is correct imho too ?

And one more question. Have this piece of code:
#define __USE_INLINE__ 1
#include <proto/muimaster.h>

APTR ImageButton(CONST_STRPTR textCONST_STRPTR image)
{
    
APTR objimg;

    
img MUI_NewObject("Dtpic.mui"MUIA_Dtpic_NameimageTAG_DONE);

    if (
text)
    {
        
obj VGroup,
            
ChildHCenter(img),
            
ChildTextObjecttextMUIA_Text_PreParse"\033c"End,
        
End;
    }
    else
    {
        
obj img;
    }

    return 
obj;
}


And have "'MUIA_Dtpic_Name' undeclared". I do search for whole SDK on that , and found nothing. I need somethere download Dtpic class with some tdpic related includes ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How compile MUI based programms to AOS4 ?
Just popping in
Just popping in


See User information
@kas1e

It's part of MUI but not documented, you need MUIUndoc from aminet.

Go to top
Re: How compile MUI based programms to AOS4 ?
Home away from home
Home away from home


See User information
@Gazelle

But its for 68k, no ? I found that for 68k and morphos, its defined as 0x80423d72. But that not works for aos4 (or i do something wrong in code)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How compile MUI based programms to AOS4 ?
Quite a regular
Quite a regular


See User information
@kas1e

Your code segment (for opening the library and interface) looks OK, but in the part where the GetInterface fails and you "exit (0)", you must Close the libray first, don't exit and leave it open.

I can't help you with MUI questions, I know nothing about it.

cheers
tony
Go to top
Re: How compile MUI based programms to AOS4 ?
Home away from home
Home away from home


See User information
@kas1e

It's just a tag, remove it.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: How compile MUI based programms to AOS4 ?
Just popping in
Just popping in


See User information
@LiveForIt

If he removes the tag, he won't see much of the image. :)

Anyway, it would berather weird if dtpic.mui wouldn't work the same way on OS4 as on 3.x or MorphOS.

Go to top
Re: How compile MUI based programms to AOS4 ?
Home away from home
Home away from home


See User information
@Fab

Yep, indeed cant remove that. And it works the same way (cool :) ). The problem was because of that part of original code:

ChildImageObject,
MUIA_Image_Spec, ( uint32 )"3:PROGDIR:data/draw.png",
MUIA_FrameMUIV_Frame_None,
End,


That not works, and not attach buttons to. So, i replace it on that:

ChildMUI_NewObject("Dtpic.mui",
MUIA_Dtpic_Name"PROGDIR:data/draw.png",
MUIA_FrameMUIV_Frame_None,
End,


And it works. Strange why .. Still, have some problems related to MUI, and if you have some free time, check that thread on UB.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: How compile MUI based programms to AOS4 ?
Just can't stay away
Just can't stay away


See User information
@kas1e

This is reminding me when I used to be "the guy" that made regular builds of YAM from the CVS tree, before the nightly builds existed.

I used to make my own libmui.a, I think it was something like (using GeekGadgets on OS3 to do this):

hunk2aout mui.lib
ar q libmui.a obj#?

Not sure if we have hunk2aout here? Then there's fd2pragma but I never used that.

Go to top
Re: How compile MUI based programms to AOS4 ?
Just popping in
Just popping in


See User information
@kas1e

Take a look at the Autodocs for MUI_Image.doc:

"3:<n>" where <n> is the name of an external boopsi image class.

I think you need this:

"5:<n>" where <n> is the name of an external picture file that should be loaded with datatypes. Kick 2.x users will get an empty image.

Go to top
Re: How compile MUI based programms to AOS4 ?
Home away from home
Home away from home


See User information
@Gazelle

That all strange, because it's not my code which i try to port. Its sources of aros paint program called LunaPaint. And it have exactly that stuff (3: and alt).

Maybe on AROS it must work like that .. Dunno, but that what i have with original source (with 3: and alt):

screenshot (you can see empty buttons).

And that (screenshot) how it looks like when i code on:
ChildMUI_NewObject("Dtpic.mui",
MUIA_Dtpic_Name"PROGDIR:data/draw.png",
MUIA_FrameMUIV_Frame_None,
End,


I think that background of buttons must be not black ..
Also, size of whole toolbar are wrong (but again, i change nothing in aros related source related to mui/strcuts/classes/size).

Mazze (who works on LunaPaint for now), say to me that this code:
ChildImageObject,
MUIA_Image_Spec, ( uint32 )"3:PROGDIR:data/draw.png",
MUIA_FrameMUIV_Frame_None,
End,



Would only work if ImageObject was a sub class of DtPic class. But that say for me nothing (and i change in code nothing related to mui). So, dunno why it not works originally.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project