The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Gradient backgrounds for Pollock

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
Gradient backgrounds for Pollock Posted: Apr 30, 2006 6:21 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Gradient backgrounds for Pollock
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement

Most Smalltalk UI's (in fact, most UI's in general) tend to look a bit bland. In recent years, It's become more popular to draw color gradients to make the UI's look more interesting. I thought I'd give this a try in Pollock to see what it would look like.

First off, here's what the final result looks like:

Gradient Window

The picture is a little munged by JPEG artifacts, but you get the idea.

To do this, I created a new Gradient pane and a GradientArtist to draw it. You set up a Gradient pane like this:

		gradient := Gradient
  				from: 0.0
 				color: ColorValue white
 				to: 1.0
 				color: (ColorValue red: 0.5 green: 0.5	blue: 1.0)
 				direction: #vertical
 

The Gradient class is pretty simple - it just specifies the GradientArtist as the artist and has some plumbing to delegate the important messages off to the artist.

The GradientArtist has a displayOn: method and a few helper methods to get the job done. Overall, it's pretty simple. Some of the calculations need to access the clipping bounds which is the only slightly complicated bit.

If you want to try it out, connect to the Cincom public store repository and download the package GradientBackground. There's a sample UI you can try out. Just run: GradientTestUI open.

Read: Gradient backgrounds for Pollock

Topic: Vayamos al Venezuela! Previous Topic   Next Topic Topic: An Agile Job Posting

Sponsored Links



Google
  Web Artima.com   

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