The Same code Mac Don't Go In Win..Why?

Just starting out? Need help? Post your questions and find answers here.
User avatar
LESTROSO
Enthusiast
Enthusiast
Posts: 124
Joined: Thu Nov 03, 2005 12:30 pm
Location: Italy
Contact:

The Same code Mac Don't Go In Win..Why?

Post by LESTROSO »

Hi to everybody,

Why the same code go in mac, but don't go in windows...the image button gadgets don't receive the clicks i think ...and block my program...

Here below i post a little portion of my code:

Code: Select all


IncludeFile "RD-Mac.pbf" 
Global numero1
Global numero2
Global risultato
Global test

numero1=0
numero2=0
risultato=0
test=0

UseJPEGImageDecoder()
UsePNGImageDecoder()

Img_RouletteD_0 =CatchImage(#PB_Any ,?sfondo)
Img_RouletteD_1=CatchImage(#PB_Any ,?ResetButton)
Img_RouletteD_2 =CatchImage(#PB_Any ,?Mano1)
Img_RouletteD_2 =CatchImage(#PB_Any ,?Mano2)
Img_RouletteD_4=CatchImage(#PB_Any,?Purelogo)
Img_RouletteD_3=CatchImage(#PB_Any,?Dollaro)




OpenRouletteD()

If LoadFont(0, "Times", 20)
  StringGadget(#Messaggi, 220, 20, 320, 90, "RD By Fasa 2016")
  
  SetGadgetFont(#Messaggi, FontID(0))   
EndIf



Repeat
 
  Event = WaitWindowEvent()
 
  Select Event
     
    Case #PB_Event_CloseWindow
      Quit = 1
                 
    Case #PB_Event_Gadget ; The Event that the window received
 
      If EventGadget() = #But1 
        
        If EventType() = #PB_EventType_LeftClick ; Is the type of Event a LeftClick ?
       
          If test=0
            HideGadget(DOLLARO1,0)
          If numero1=0
            numero1=1
          Else
             numero2= 1 
             If numero1<> 0
               If numero2<> 0
            Gosub ANALISI
                EndIf
                EndIf
                EndIf
              EndIf
              EndIf
                EndIf

EndSelect
Until Quit > 0


Can Somebody help me please????

Thanks a lot ,

lestroso :oops:
User avatar
BasicallyPure
Enthusiast
Enthusiast
Posts: 536
Joined: Thu Mar 24, 2011 12:40 am
Location: Iowa, USA

Re: The Same code Mac Don't Go In Win..Why?

Post by BasicallyPure »

EventType() does not support events from buttons or buttonImage gadgets.
Remove this line and it should work.

Code: Select all

If EventType() = #PB_EventType_LeftClick ; Is the type of Event a LeftClick ?
If it works on Mac, that is by accident and not intended to work on all operating systems.

Read the help for EventType() and you will see that only the following gadgets are to be used with EventType().
Help wrote:The following gadgets support EventType():

- CanvasGadget() - The CanvasGadget has a special set of event types.
- ComboBoxGadget()
- DateGadget()
- EditorGadget()
- ExplorerListGadget()
- ExplorerTreeGadget()
- ImageGadget()
- ListViewGadget()
- ListIconGadget()
- MDIGadget()
- OpenGLGadget()
- SpinGadget()
- StringGadget()
- WebGadget() - The WebGadget has a special set of event types.
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.
User avatar
mk-soft
Always Here
Always Here
Posts: 5398
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: The Same code Mac Don't Go In Win..Why?

Post by mk-soft »

No problem with "#PB_EventType_LeftClick" on Buttons or ImageButtons at all OS
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: The Same code Mac Don't Go In Win..Why?

Post by IdeasVacuum »

LESTROSO, it's difficult for us to see what is happening because the code snippet cannot be run - RD-Mac.pbf and OpenRouletteD() and the Constants are missing (we can live without the images). Note that test = 0 is always true, so Gosub ANALISI is not executed. However, ANALISI should probably be a Procedure.

Code: Select all

numero1=0
numero2=0
risultato=0
test=0
These variables are zero when assigned, so the above code does nothing.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply