How do you add tabs to strings for MUI? C style tabs ( \t ) don't do anything and \033t does not seem to be valid.
/* Compile thusly:
> vc +morphos -o spanning_columns spanning_columns.c -lauto -lamiga
*/
#include <clib/alib_protos.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/muimaster.h>
Object *App, *Win;
Object* build_gui(void)
{
return(MUI_NewObject(MUIC_Application, MUIA_Application_Window,
(ULONG)(Win = MUI_NewObject(MUIC_Window,
MUIA_Window_Title, (ULONG)"spanning columns",
MUIA_Window_RootObject, MUI_NewObject(MUIC_Group, /* defaults to vertical display of Child entries */
MUIA_Group_Child, MUI_NewObject(MUIC_Group, MUIA_Group_Horiz, TRUE, /* contains three vertical groups */
/* each containing a MUIC_Text object & MUIC_Group object */
MUIA_Group_Child, MUI_NewObject(MUIC_Group, MUIA_Frame, MUIV_Frame_Group, /* vertical group 1 */
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla 133n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Group,
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
TAG_END),
TAG_END), /* End of vertical group 1 */
MUIA_Group_Child, MUI_NewObject(MUIC_Group, MUIA_Frame, MUIV_Frame_Group, /* vertical group 2 */
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla 233n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Group, MUIA_Group_Columns, (2),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
TAG_END),
TAG_END), /* End of vertical group 2 */
MUIA_Group_Child, MUI_NewObject(MUIC_Group, MUIA_Frame, MUIV_Frame_Group, /* vertical group 3 */
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla 333n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Group, MUIA_Group_Columns, (3),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
MUIA_Group_Child, MUI_NewObject(MUIC_Text, MUIA_Text_Contents, (ULONG)"33cbla33n", TAG_END),
TAG_END),
TAG_END), /* End of vertical group 3 */
TAG_END), /* End of the horizontal group containing the three vertical groups */
TAG_END), /* End of the RootObject group */
TAG_END)), /* End of NewObject(MUIC_Window) */
TAG_END)); /* End of NewObject(MUIC_Application) & termination of the return() statement */
}
void notifications(void)
{
DoMethod(Win, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, App, 2,
MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
}
void main_loop(void)
{
ULONG signals = 0;
set(Win, MUIA_Window_Open, TRUE);
while (DoMethod(App, MUIM_Application_NewInput, &signals)
!= MUIV_Application_ReturnID_Quit)
{
signals = Wait(signals | SIGBREAKF_CTRL_C);
if (signals & SIGBREAKF_CTRL_C) break;
}
set(Win, MUIA_Window_Open, FALSE);
}
int main(void)
{
if(App=build_gui())
{
notifications();
main_loop();
MUI_DisposeObject(App);
}
return(0);
}
PPC assembly ain't so bad... ;)