It is currently Sat Dec 05, 2020 4:20 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: The Same code Mac Don't Go In Win..Why?
PostPosted: Sat Apr 02, 2016 12:11 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Nov 03, 2005 12:30 pm
Posts: 123
Location: Italy
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:

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:


Top
 Profile  
Reply with quote  
 Post subject: Re: The Same code Mac Don't Go In Win..Why?
PostPosted: Sat Apr 02, 2016 4:33 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 24, 2011 12:40 am
Posts: 536
Location: Iowa, USA
EventType() does not support events from buttons or buttonImage gadgets.
Remove this line and it should work.
Code:
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: The Same code Mac Don't Go In Win..Why?
PostPosted: Sun Apr 03, 2016 10:27 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2745
Location: Germany
No problem with "#PB_EventType_LeftClick" on Buttons or ImageButtons at all OS

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: The Same code Mac Don't Go In Win..Why?
PostPosted: Sun Apr 03, 2016 10:42 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 6263
Location: Wales, UK
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:
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: falsam, Majestic-12 [Bot] and 67 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye