From 45ce51260f6753f454d4d2ae9262756262c08397 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Feb 2009 04:56:38 -0600 Subject: [PATCH] Add ui.gadgets.icons --- basis/ui/gadgets/icons/authors.txt | 1 + basis/ui/gadgets/icons/icons.factor | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 basis/ui/gadgets/icons/authors.txt create mode 100644 basis/ui/gadgets/icons/icons.factor diff --git a/basis/ui/gadgets/icons/authors.txt b/basis/ui/gadgets/icons/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/basis/ui/gadgets/icons/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/basis/ui/gadgets/icons/icons.factor b/basis/ui/gadgets/icons/icons.factor new file mode 100644 index 0000000000..8f9bacad37 --- /dev/null +++ b/basis/ui/gadgets/icons/icons.factor @@ -0,0 +1,12 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: kernel accessors ui.images ui.render ui.gadgets ; +IN: ui.gadgets.icons + +TUPLE: icon < gadget image ; + +: ( image-name -- icon ) icon new swap >>image ; + +M: icon draw-gadget* image>> draw-image ; + +M: icon pref-dim* image>> image-dim ; \ No newline at end of file