Can load some basic business info from YELP
This commit is contained in:
26
src/modules/templates/businessrow.cr
Normal file
26
src/modules/templates/businessrow.cr
Normal 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
|
||||
Reference in New Issue
Block a user