content: sub init()
      m.grid = m.top.findNode("comicsGrid")
      m.grid.observeField("itemSelected", "onComicSelected")
  
  end sub
  
  sub populateGrid()
      comics = m.top.comics
      gridContent = CreateObject("roSGNode", "ContentNode")
      
      for each comic in comics
          item = gridContent.createChild("ContentNode")
          item.title = comic.title
          item.HDPosterUrl = comic.thumbnail.path + "." + comic.thumbnail.extension
          item.id = comic.id
      end for
  
      m.grid.content = gridContent
  end sub
  
  sub onComicSelected(event as Object)
      index = event.getData()
      comic = m.top.comics[index]
      m.global.callFunc("ShowComicCharacters", comic.id)
  end sub
  
  ' Fetch Comics Data
  function FetchMarvelComics() as Object
      url = "https://gateway.marvel.com/v1/public/comics?ts=1&apikey=your_public_key&hash=your_generated_hash"
      request = CreateObject("roUrlTransfer")
      request.SetUrl(url)
      request.SetRequest("GET")
      response = request.GetToString()
      
      if response <> invalid
          json = ParseJSON(response)
          return json.data.results
      else
          return []
      end if
  end function