print error when failing to load image
This commit is contained in:
parent
2ec7bfc78a
commit
a39a752b15
@ -60,11 +60,17 @@
|
|||||||
|
|
||||||
(local found-icons {})
|
(local found-icons {})
|
||||||
|
|
||||||
|
(macro check-err [form]
|
||||||
|
`(let [(result# err#) ,form]
|
||||||
|
(or result#
|
||||||
|
(error err#))))
|
||||||
|
|
||||||
(fn load-icon [name]
|
(fn load-icon [name]
|
||||||
(let [pixbuf
|
(let [pixbuf
|
||||||
(if (= (name:sub 1 1) "/")
|
(if (= (name:sub 1 1) "/")
|
||||||
;; From a direct path
|
;; From a direct path
|
||||||
(GdkPixbuf.Pixbuf.new_from_file_at_scale name HEIGHT -1 true)
|
(check-err
|
||||||
|
(GdkPixbuf.Pixbuf.new_from_file_at_scale name HEIGHT -1 true))
|
||||||
;; From icon theme
|
;; From icon theme
|
||||||
(find-icon-pixbuf name))]
|
(find-icon-pixbuf name))]
|
||||||
(Gtk.Image.new_from_pixbuf pixbuf)))
|
(Gtk.Image.new_from_pixbuf pixbuf)))
|
||||||
|
Loading…
Reference in New Issue
Block a user