MUI

From Amiga Development Wiki
Jump to: navigation, search

Building user interface

Basic MUI application.
#include <sys/types.h>
 
#include <dos/dos.h>
#include <libraries/mui.h>
#include <proto/muimaster.h>
 
int main()
{
   APTR app, win;
 
   app = ApplicationObject,
      SubWindow, win = WindowObject,
         WindowContents, VGroup,
            MUIA_Window_Title, "MUI sample application",
            Child, TextObject, MUIA_Text_Contents, "Have a nice day :)", End,
         End,
      End,
   End;
 
   if (app)
   {
      size_t signals = 0;
 
      while (DoMethod(app, MUIM_Application_Input, &signals) != MUIV_Application_ReturnID_Quit)
      {
         if (signals)
         {
            signals = Wait(signals | SIGBREAKF_CTRL_C);
 
            if (signals & SIGBREAKF_CTRL_C)
               break;
         }
      }
 
      MUI_DisposeObject(app);
   }
 
   return 0;
}

Links

The official MUI web site MUI on Wikipedia MUI 4 SDK (part of MorphOS SDK