#PB_Key_Return

Mac OSX specific forum
BurleyBorn
New User
New User
Posts: 2
Joined: Thu May 19, 2016 7:11 pm

#PB_Key_Return

Post by BurleyBorn »

Hi, just started with PB for OS X El Capitan and am hoping somebody can tell me what is wrong here.

String Gadget #0 correctly traps the 'change' but String Gadget #1 does not trap the 'Return Key'. Any help would be gratefully appreciated.

Code: Select all

If OpenWindow(0, 100, 200, 900, 350, "Return Key", #PB_Window_MinimizeGadget)
    
  StringGadget(0,  20, 20, 200, 24, "")
  StringGadget(1,  20, 60, 200, 24, "")
  
  Repeat
    Event = WaitWindowEvent()
    
      If Event = #PB_Event_Gadget
      
        Select EventGadget()
          Case 0
            If EventType() = #PB_EventType_Change
              MessageRequester("Info", "Text change", 0)
            EndIf 
          
          Case 1
            If EventType() = #PB_Key_Return       
              MessageRequester("Info", "Enter Key", 0)         
            EndIf
            
        EndSelect 
      
      EndIf       
  Until Event = #PB_Event_CloseWindow

EndIf

End 
Michael
User avatar
Keya
Addict
Addict
Posts: 1891
Joined: Thu Jun 04, 2015 7:10 am

Re: #PB_Key_Return

Post by Keya »

Code: Select all

           If EventType() = #PB_EventType_Change
 ...
           If EventType() = #PB_Key_Return
The first line is correct, but the second line isnt because #PB_Key_Return is not a #PB_EventType_
a search for #PB_Key_Return should yield an example :)
BurleyBorn
New User
New User
Posts: 2
Joined: Thu May 19, 2016 7:11 pm

Re: #PB_Key_Return

Post by BurleyBorn »

Thanks for pointing direction :)
Post Reply