The Artima Developer Community
Sponsored Link

Agile Buzz Forum
An unanticipated use for ExtraEmphases

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
An unanticipated use for ExtraEmphases Posted: Jan 14, 2005 11:49 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: An unanticipated use for ExtraEmphases
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement
I was sitting here modding a tool I use now and then again. I found that I needed to prompt the user to select an object from a list of objects. No problem. Use Dialog>>choose:fromList:values:lines:cancel:.

My problem is that I want to put a cute little icon at the front of each one. Whatever you pass as the fromList: argument though, will be turned into Text objects. Nominally, this usually means the displayString of an object, but you can pass a Text too, and it's happy to use that. That's handy in this case, because ExtraEmphases has the ability to add arbitrary glyphs into a character stream, either before, after, or in lieu of emphasized characters. So it's just a matter of doing something like:

	theText emphasizeFrom: 1 to: 1 with: theIcon

This is admittedly a hack. I'm betting Pollock will make things like this easier/more straightforward. But for now, it was kinda nice. BTW, ExtraEmphases by default uses this technique to place a little red stop sign in your code wherever you have a breakpoint inserted.

Read: An unanticipated use for ExtraEmphases

Topic: What's next for BottomFeeder? Previous Topic   Next Topic Topic: BottomFeeder Evolution

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use