図 4–4 は、英語と日本語の環境での UIL のプログラム例を示します。

次のプログラム例で LLL はロケール・テキストを示します。LLL には日本語、韓国語、中国語 (繁体字)、ギリシャ語、フランス語、その他の言語が入ります。
uil_sample.uil
!
! sample uil file - uil_sample.uil
!
! C source file - uil_sample.c
!
! Resource file - uil-sample.resource
!
module Test
version = 'v1.0'
names = case_sensitive
objects = {
XmPushButton = gadget;
}
!************************************
! declare callback procedure
!************************************
procedure
exit_CB ;
!***************************************************************
! declare BulletinBoard as parent of PushButton and Text
!***************************************************************
object
bb : XmBulletinBoard {
arguments{
XmNwidth = 500;
XmNheight = 200;
};
controls{
XmPushButton pb1;
XmText text1;
};
};
!****************************
! declare PushButton
!****************************
object
pb1 : XmPushButton {
arguments{
XmNlabelString = #Normal “LLLexit buttonLLL”;
XmNx = 50;
XmNy = 50;
};
callbacks{
XmNactivateCallback = procedure exit_CB;
};
};
!*********************
! declare Text
!*********************
text1 : XmText {
arguments{
XmNx = 50;
XmNy = 150;
};
};
end module;
/*
* C source file - uil_sample.c
*
*/
#include <Mrm/MrmAppl.h>
#include <locale.h>
void exit_CB();
static MrmHierarchy hierarchy;
static MrmType *class;
/******************************************/
/* specify the UID hierarchy list */
/******************************************/
static char *aray_file[] =
{“uil_sample.uid”};
static int num_file =
(sizeof aray_file / sizeof aray_file[0]);
/******************************************************/
/* define the mapping between UIL procedure names*/
/* and their addresses */
/******************************************************/
static MRMRegisterArg reglist[]={
{“exit_CB”,(caddr_t) exit_CB
}