Imagegadget is no gadget?

Mac OSX specific forum
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Imagegadget is no gadget?

Post by jesperbrannmark »

This happens when i do a frame3dgadget. I found this out the hard way, though life.
Click first black thing = works
Click second black thing = not work

Can someone confirm? Workaround?

Code: Select all

OpenWindow(0,0,0,500,500,"")
Frame3DGadget(0,100,100,300,300,"")
CreateImage(0,50,50)
ButtonImageGadget(1,120,120,50,50,ImageID(0))
ImageGadget(2,200,120,50,50,ImageID (0))
Repeat
  If WaitWindowEvent()=#PB_Event_Gadget
    Debug "EVENTGADGET"
  EndIf
ForEver
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Imagegadget is no gadget?

Post by WilliamL »

Yup, it does the same thing here in Snow Leopard. Wierd Take out the Frame3DGadget and it works fine. Looks like a bug to me.

Yes, you can waste a lot of time on something like this.
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
User avatar
Shardik
Addict
Addict
Posts: 2076
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: Imagegadget is no gadget?

Post by Shardik »

jesperbrannmark wrote:Workaround?

Code: Select all

ImportC ""
  NewControlUserPaneHitTestUPP(ControlUserPaneActivateCallback.L)
  SetControlData(ControlRef.L, ControlPartCode.W, TagName.L, BufferSize.L, *Buffer)
EndImport

#kControlUserPaneHitTestProcTag = $68697474 ; 'hitt'

ProcedureC UserPaneHitTestCallback(ControlRef.L, Point.L)
  Debug "Click onto ImageGadget"
EndProcedure

OpenWindow(0,270,100,500,500,"")
Frame3DGadget(0,100,100,300,300,"")
CreateImage(0,50,50)
ButtonImageGadget(1,120,120,50,50,ImageID(0))
ImageGadget(2,200,120,50,50,ImageID(0))

UserPaneHitTestUPP = NewControlUserPaneHitTestUPP(@UserPaneHitTestCallback())
SetControlData(GadgetID(2), 0, #kControlUserPaneHitTestProcTag, 4, @UserPaneHitTestUPP)

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break
    Case #PB_Event_Gadget
      Debug "Click onto Gadget #" + Str(EventGadget())
  EndSelect
ForEver
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: Imagegadget is no gadget?

Post by jesperbrannmark »

You are like a high priest :D
I wish I had the knowledge to understood your code, anyhow.. it works.

J
Post Reply