This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Ticker for BottomFeeder
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
As I'm sitting here right now, there is a black rectangle on my screen, zooming past instructions on how it can be used as a News Ticker. For example, one might wish to splash new items in Bottom Feeder in this ticker area.
Lets talk about the uses of this thing and how it behaves. Firstly, it's got a black background so that it stands out. It has no title bar, minimise button, icon, etc, but it does have an 'x' to close it if you really must.
The items in the ticker scroll from right to left at a configurable velocity, but if you move your mouse over an item, the ticker will decelerate to a full stop. Once you leave the ticker it will accelerate back up to the configured velocity.
You can move the mouse to the left/right side of the ticker and resize it vertically. Horizontally there are two heights that can be used: single line or double line. Many people may just wish to see the topic of the news item, others may also like to see what blog/newsfeed its from - for those they can use double line mode.
You can click anywhere in the ticker and drag the ticker around and place it wherever you like on your desktop. When it opens up again it will dutifully return to the size and position and line-mode that you left it in.
The mouse cursor changes from an arrow to a hand if you're on top of an item that you can do something with. If you move to the edges for resizing, the mouse cursor becomes a resize cursor.
Okay, lets shuffle from the behaviour side to the programming side. Programmers can give the Ticker a printBlock: and a secondPrintBlock: for the first and second lines of the ticker for each item. The result of those blocks can be a Text, which means you can have bold, italic, colours, all the usual stuff a Text can have.
If a user double clicks on an item, you can specify the defaultActionBlock: to be called so you can do something (such as read the item). You can also give it a menu: which will display if the user right clicks on the Ticker.
By checking if currentItem is not nil, you can enable/disable the popup menu items that are actions on the item the user pointed at. (such as 'ignore' or 'mark as old').
Sizing is also important, how much space do you give each item inside the ticker? Well, skipping the nitty gritty details, you can specify minimumItemSize: - around 125 is a good size for most things, but you'll have to experiment for yourself.
You can give it the performer: - who to call on a menu action and you can give it items:, which is the collection of objects to put in the ticker. (There's even a closeBlock: if you need it).
Beyond that, it's just a ticker pretty much. It's available in the Public Store repository and its package name is Ticker. When will it be in Bottom Feeder? Hopefully in Version 3.4 - or the development version soon.
How do you try it out? Once loaded, run TickerExample example
Bugs! I know of only two bugs, but someone is likely to surprise me with a few more sooner or later. If you resize the Ticker to have a smaller area, the Ticker may re-show some items it has already shown. The same goes for if you give it a smaller set of items: than it had before.
Also, it could do with a tad less flickering. Any one who wants to have a hack at the flickering then look down the bottom of the #tick method of TickerAppModel.