Files
wince/src/modules/templates/businessrow.cr

26 lines
855 B
Crystal

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