Skip to content

Instantly share code, notes, and snippets.

@gnacu
Created April 18, 2024 20:45
Show Gist options
  • Save gnacu/98608d5cb902a838f57b7a032c5d9ada to your computer and use it in GitHub Desktop.
Save gnacu/98608d5cb902a838f57b7a032c5d9ada to your computer and use it in GitHub Desktop.
a_togwrap ;Menu option toggle wrap
#ldxy tkenv
jsr settkenv
#storeget tstviews,8 ;Checkbox
jsr ptrthis
ldy #cflags
lda (this),y
eor #cf_state
sta (this),y
jsr thisdirt
;... fallthrough
togwrap ;Toggle Text Wrap
;this -> checkbox
.block
#pushptr this
ldy #cflags
lda (this),y
and #cf_state
beq dounwrap
;-- Turn On Wrap --
#storeget tabviews,4 ;TKScroll
jsr ptrthis
ldy #setbar_
jsr getmethod
ldx #0 ;Horz Off
ldy #1 ;Vert On
jsr sysjmp
#storeget tabviews,5 ;TKText
jsr ptrthis
ldy #setstrf_
jsr getmethod
ldy #tstrflgs
lda (this),y
ora #f_wrap
jsr sysjmp
jmp done
dounwrap ;-- Turn Off Wrap --
#storeget tabviews,4 ;TKScroll
jsr ptrthis
ldy #setbar_
jsr getmethod
ldx #1 ;Horz On
ldy #1 ;Vert On
jsr sysjmp
#storeget tabviews,5 ;TKText
jsr ptrthis
ldy #setstrf_
jsr getmethod
ldy #tstrflgs
lda (this),y
and #f_wrap:$ff
jsr sysjmp
done #pullxy
jsr ptrthis
jmp mkdirt
.bend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment