Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTDisable and GTEnable seem to have no effect on GTShape type gadgets #90

Open
FraBro1 opened this issue Feb 25, 2024 · 6 comments
Open
Labels
blitzlib related to a certain blitz library bug Something isn't working help wanted Extra attention is needed wontfix This will not be worked on

Comments

@FraBro1
Copy link

FraBro1 commented Feb 25, 2024

I tried it with BlitzBasic too and the behaviour is consistent;

One can disable the GTShape gadget from the start but then it ends up never being usable at all.

@honitos honitos added investigation blitzlib related to a certain blitz library labels Mar 5, 2024
@honitos honitos self-assigned this Mar 5, 2024
@honitos
Copy link
Member

honitos commented Mar 7, 2024

can you please provide me a short code example to reproduce this behaviour?

@FraBro1
Copy link
Author

FraBro1 commented Mar 7, 2024

sure.

`;

LoadShape 1,"blitzinc:_dat/iff/getfile.br"

FindScreen 1

Window 1,0,11,600,200,$140f,"hello, click mouse",2,1

GTShape 1,1,100,30,0,1
GTText 1,2,100,50,50,24,"hello",0,"olleh"

AttachGTList 1,1

Repeat
MouseWait

  db.w=1-db

  If db=1

    GTEnable 1,1

    WLocate0,0:Print "enabled"
    Redraw1
  Else

    GTDisable 1,1

    WLocate0,0:Print "disabled"
    Redraw1
  EndIf

Until WaitEvent=$200
End
`

@honitos
Copy link
Member

honitos commented Mar 8, 2024

I tried your code with the original function of gadtools GT_SetGadgetAttrsA_ to disable the shape and it did not work either.
I have no experience with gadtools.library, so I am not able to investigate it further. I don't see any problems in the source code of the blitzlib gadtoolslib:

My example code:

WBStartup : NoCli
LoadShape 1,"//data/ball"

FindScreen 1

AddIDCMP #IDCMP_GADGETUP|#IDCMP_GADGETDOWN;|#IDCMP_INTUITICKS
ww.w = 600 : wh.w = 200
wx.w = (ScreenWidth - ww) / 2
wy.w = (ScreenHeight - wh) / 2
Window  1,wx,wy,ww,wh,#WFLG_CLOSEGADGET|#WFLG_DEPTHGADGET|#WFLG_DRAGBAR|#WFLG_GIMMEZEROZERO|#WFLG_ACTIVATE,"hello, click mouse",2,1
*win.Window = Peek.l(Addr Window(1))
Use Window 1

GTShape  1,1,100,30, $2000, 1
GTString 1,2,100,60,50,24,"hello",0,32,"olleh"
GTButton 1,3,100,90,50,24,"Toogle",$2000
AttachGTList 1,1

*gad2.Gadget = GTGadPtr(1,2)
*gad1.Gadget = GTGadPtr(1,1)

Repeat

  ev.l = Event
  If ev
  WLocate 0,18 : Print "event: ", Hex$(ev), " ",Hex$(*win)," ",Hex$(*gad)
  EndIf
  Select ev
  Case #IDCMP_GADGETUP

    Select GadgetHit
    Case 1
      WLocate 0,30 : Print "SHAPE HIT"
      BeepScreen 1: VWait 1
    Case 3
      Select GTStatus(1,3)
      Case 1 :
        GTEnable 1,1 : GTEnable 1,2

      Case 0 :
        ;GTDisable 1,2
        GT_SetGadgetAttrsA_ *gad2,*win,0,Tags(#GA_Disabled,True)

        ;GTDisable 1,1
        GT_SetGadgetAttrsA_ *gad1,*win,0,Tags(#GA_Disabled,True)
      End Select
    End Select

    WLocate 0,0
    NPrint "string status: ", GTGetAttrs(1,2,#GA_Disabled), " shape status: ", GTGetAttrs(1,1,#GA_Disabled)
  Default
    WLocate 0, 30 : Print "                "
  End Select

Until ev = #IDCMP_CLOSEWINDOW
End

@honitos honitos added bug Something isn't working help wanted Extra attention is needed wontfix This will not be worked on and removed investigation labels Mar 8, 2024
@honitos honitos removed their assignment Mar 8, 2024
@FraBro1
Copy link
Author

FraBro1 commented Mar 8, 2024

thanks for trying.

i did try GT_SetGadgetAttrsA_ myself but my Amigalibs.res in FSUAE (in BlitzBasic, where the same happens,) has no #GA_Disable/#GA_Enable included.

It was for someone else, but i thought i ask the expert...

@FraBro1
Copy link
Author

FraBro1 commented Mar 8, 2024

the GTShape gets drawn correctly disabled, if it was initialised as disabled at time of creation.

@honitos
Copy link
Member

honitos commented Mar 8, 2024

If you could organize a working example that uses the gadtools.library functions,
I could inspect the asmcode of the blitzlib what is different there.

The example could be in Blitzbasic or C.

I guess it is the way the gadget is created by the blitzlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blitzlib related to a certain blitz library bug Something isn't working help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants