#AdditionalLib: SwiftyButton.framework.swift.3
#MinVersion: 8
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public App As Application
Public NavControl As NavigationController
Private Page1 As Page
End Sub
Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.Title = "Page 1"
Page1.RootPanel.Color = Colors.White
NavControl.ShowPage(Page1)
Dim b As Button = CreateFlatButton(Colors.Red)
Page1.RootPanel.AddView(b, 10, 10, 200, 100)
b.Text = "sdf"
End Sub
Sub CreateFlatButton (clr As Int) As Button
Dim no As NativeObject
no = no.Initialize("SwiftyButton.FlatButton").RunMethod("alloc", Null)
no = no.RunMethod("initWithFrame:", Array(no.MakeRect(0, 0, 0, 0)))
no.SetField("color", no.ColorToUIColor(clr))
Return no
End Sub