Hi guys !
I'm learning how to use the DCS7 GUI API, and I'm encountering several problems
I made a simple GUI with a large window, a text button, a close button and a text which is invisible first. I want the button to make the text visible, but the prgm quits anyway after the call GUIMouse. Here is the code :
Code:
Do you see anything wrong in it ?
I'm learning how to use the DCS7 GUI API, and I'm encountering several problems
I made a simple GUI with a large window, a text button, a close button and a text which is invisible first. I want the button to make the text visible, but the prgm quits anyway after the call GUIMouse. Here is the code :
Code:
org userMem - 2
db 0BBh, 6Dh
xor d
ret
jr Start
; Description
word Desc
db 7, 0
; Icon
word 0
; ALE
word 0
Start:
ld a, 0
ld (dispText), a
ld (mustExit), a
call OpenGUIStack
ld hl, myWin
ld de, myWinWinButtons - myWin
ld a, GUIRLargeWin
call PushGUIStack
ld hl, myWinWinButtons
ld de, myWinText - myWinWinButtons
ld a, GUIRWinButtons
call PushGUIStack
ld hl, myWinButton
ld de, dataEnd - myWinButton
ld a, GUIRButtonText
call PushGUIStack
ld a, (dispText)
or a
jr z, skipText
ld hl, myWinText
ld de, myWinButton - myWinText
ld a, GUIRText
call PushGUIStack
skipText:
ld hl, 0
call GUIMouse
call ResetAppPage
ld a, (mustExit)
or a
jr z, Start
call CloseGUIStack
ret
onButtonClick:
call ResetAppPage
ld a, 1
ld (dispText), a
ret
exitProg:
call ResetAppPage
ld a, 1
ld (mustExit), a
ret
Desc:
db "Simple test", 0
; Widgets data
myWin:
db 0F8h, 88h, 88h, 88h, 0F8h
db "Hello world", 0
myWinWinButtons:
db 00100000b
word 0
word 0
word exitProg
myWinText:
db 0, 0, 0
db "Hello world!", 0
myWinButton:
db 40, 20
word onButtonClick
db "Button", 0
dataEnd:
; Misc. datas
dispText:
db 0
mustExit:
db 0
Do you see anything wrong in it ?