Differenze tra le versioni di "Ottenere informazioni sul tempo meteorologico di una città mediante il sito web wttr.in"

Da Gambas-it.org - Wikipedia.
(Creata pagina con "Il sito web "https://wttr.in/Roma" consente di conoscere il tempo meteorologico di una città. In Gambas potrà essere consultato con almeno due soluzioni. Il seguente codic...")
 
Riga 5: Riga 5:
 
Il seguente codice si basa sul Componente "gb.qt5" (o "gb.gui.qt") di Gambas, ed è necessario attivare anche il Componente "gb.qt5.webkit" (o "gb.gui.qt.webkit").  
 
Il seguente codice si basa sul Componente "gb.qt5" (o "gb.gui.qt") di Gambas, ed è necessario attivare anche il Componente "gb.qt5.webkit" (o "gb.gui.qt.webkit").  
 
  Private wv As New WebView(Me) As "Webv"
 
  Private wv As New WebView(Me) As "Webv"
  Private tl As New TextLabel(Me)
+
  Private tl As TextLabel
 
   
 
   
 
   
 
   
Riga 13: Riga 13:
 
     .W = Screen.AvailableWidth
 
     .W = Screen.AvailableWidth
 
     .H = Screen.AvailableHeight
 
     .H = Screen.AvailableHeight
     .Arrangement = Arrange.Fill
+
  End With
 +
 +
  With tl = New TextLabel(Me)
 +
    .X = 0
 +
    .Y = 0
 +
    .W = Me.W
 +
    .H = Me.H
 +
     .Background = Color.DarkGreen
 
   End With
 
   End With
 
   
 
   

Versione delle 08:38, 24 set 2023

Il sito web "https://wttr.in/Roma" consente di conoscere il tempo meteorologico di una città.

In Gambas potrà essere consultato con almeno due soluzioni.

Il seguente codice si basa sul Componente "gb.qt5" (o "gb.gui.qt") di Gambas, ed è necessario attivare anche il Componente "gb.qt5.webkit" (o "gb.gui.qt.webkit").

Private wv As New WebView(Me) As "Webv"
Private tl As TextLabel


Public Sub Form_Open()

 With Me
   .W = Screen.AvailableWidth
   .H = Screen.AvailableHeight
 End With

 With tl = New TextLabel(Me)
   .X = 0
   .Y = 0
   .W = Me.W
   .H = Me.H
   .Background = Color.DarkGreen
 End With

 wv.Url = "https://wttr.in/Roma"

End


Public Sub Webv_Load()

 tl.Text = wv.HTML

End

In quest'altro esempio, invece, si dovranno attivare i Componenti "gb.net" e "gb.net.curl":

Public Sub Main()
 
 Dim hc As New HttpClient

 Print hc.Download("https://wttr.in/Roma", Null)

End