Mercurial > projects > doodle
diff doodle/tk/palette.d @ 61:08ffc44fc21a
More palette work.
author | daveb |
---|---|
date | Wed, 11 Aug 2010 15:07:58 +0930 |
parents | b190a9d9352e |
children |
line wrap: on
line diff
--- a/doodle/tk/palette.d Tue Aug 10 22:55:54 2010 +0930 +++ b/doodle/tk/palette.d Wed Aug 11 15:07:58 2010 +0930 @@ -2,14 +2,16 @@ // XXX Not sure whether to use delegates or observer pattern... -interface IPalette { +interface IPalette(T) { struct Item { string iconPath; string labelText; string tooltipText; - void delegate(int) callback; - } + T t; + }; - void configure(in Item[] items); - void activate(in int index); + alias void delegate(T) Callback; + + void configure(Item[] items, Callback callback); + void activate(T t); }