Chris' Cairo Blog

July 26, 2010

Visuals and Labels all in one

Filed under: What I am working on — thorgch @ 11:45 pm

I was putting together another animation overview when I realized that a large majority of the PNG images that make up the overview were also going to need a label. I could use a CairoPNGImageView and PangoMarkupLabelView and then group them into a transform group, but why not just make a new visual component that contains both? It’s just more convenient and it helps clean up the GUIPainter tree considerably, since I now have one tree icon instead of 3 (label, image and group).

The CairoLabeledVisualView will take any cairo based visual (e.g. PNG image or region) and apply a label to it. There are only a whopping 3 cairo based visual components at the moment, but I hope that will grow over time.

Here’s a screen shot of the component. The most involved configuration slice would be the Label Details slice. This slice lets the user configure the usual aspects of the label much like you would if you were just using the PangoMarkupLabelView. I also added some alignment details to help with quick alignment of the label.

That’s it for now. If you want to play around with this component, you’ll find it in the latest release of the CGK (7.7.11, cthorgrimsson).

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: