;================================================================================= ; Xt/Athena Widgets dialog box example. ; ; The LSCR Project. ;================================================================================= format ELF include '../../../macros.inc' include '../../../../include/symbols.inc' include '../../../../include/x.inc' include '../../../../include/x_res.inc' public _start section '.text' executable _start: mov eax, esp mov edx, esp add edx, 4 ccall XtInitialize, [edx], toplvl, 0, 0, eax, edx ; initialize the toolkit mov [top_level], eax ccall XtSetValues, [top_level], param1, 2 ; apply the resources ccall XtCreateManagedWidget, dialog_s, [dialogWidgetClass], [top_level], 0, 0 ; create dialog box mov [dialog], eax ccall XtSetValues, [dialog], param2, 2 ccall XawDialogAddButton, [dialog], clear_l, clear, [dialog] ; add control buttons ccall XawDialogAddButton, [dialog], quit_l, quit, [dialog] ccall XtRealizeWidget, [top_level] ccall XtMainLoop quit:;----------------------------------------------------------------------------------; mov eax, SYS_EXIT xor ebx, ebx int 0x80 clear:;---------------------------------------------------------------------------------; ccall XtSetValues, [dialog], param2+8, 1 ; clear the edit field ret section '.data' writeable param1 dd XtNheight, 150 dd XtNwidth, 300 param2 dd XtNlabel, lab_l dd XtNvalue, val_l toplvl db "toplvl",0 dialog_s db "dialog",0 lab_l db "Enter something:",0 val_l db 0 clear_l db "Clear",0 quit_l db "Quit",0 dialog rd 1 top_level rd 1