Can load some basic business info from YELP

This commit is contained in:
2022-12-18 00:34:47 -08:00
parent 00814dd7e4
commit 5e2e9e2752
11 changed files with 151 additions and 8 deletions

View File

@@ -0,0 +1,26 @@
module Wince
@[Gtk::UiTemplate(resource: "/wince/ui/compiled/templates.ui", children: %w(businessName businessRating businessHours businessWebsite))]
class BusinessRow < Gtk::ListBoxRow
include Gtk::WidgetTemplate
@name : Gtk::Label
@rating : Gtk::Label
@hours : Gtk::Label
@website : Gtk::LinkButton
def initialize(name : String, rating : String, hours : String, website : String)
super()
@name = Gtk::Label.cast(template_child("businessName"))
@rating = Gtk::Label.cast(template_child("businessRating"))
@hours = Gtk::Label.cast(template_child("businessHours"))
@website = Gtk::LinkButton.cast(template_child("businessWebsite"))
@name.text = name
@rating.text = rating
@hours.text = hours
@website.uri = website
@website.label = "view on yelp"
end
end
end