Pango::layout background color


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Hi,

In [email protected]
“[ruby-gnome2-devel-en] pango::layout background color” on Tue, 16 Jan
2007 15:54:02 +0200,
Dobai-Pataky Bálint [email protected] wrote:

i finally generate a print preview for my treeviews.
i wanna set the background color of the columns’ headers. they are
pango::layouts.
if anyone know how to, please guide me.

Could you show us your sample script?

Thanks,

kou


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

there is no sample yet:
text_cell = cr.create_pango_layout
text_cell.set_font_description(Pango::FontDescription.new(“sans 12”))
text_cell.set_text(‘test’)

i wanna set background for this pango layout, or something similar.
i wanted to place a pango rectangle there, to border the text, but it’s
not supported.

i might place a cairo rectange, but found no docs for it.

so i thought at least i should change the background of the pango
layout.

thanks

balint

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] pango::layout background color” on Sun, 21
Jan 2007 00:17:34 +0900 (JST),
Kouhei S. [email protected] wrote:

y = …
w, h = text_cell.pixel_size
cr.rectangle(x, y, w, h)
cr.draw

I found a typo.

cr.draw

cr.stroke

Thanks,

kou


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] pango::layout background color” on Sat, 20
Jan 2007 00:06:21 +0200,
Dobai-Pataky B. [email protected] wrote:

there is no sample yet:
text_cell = cr.create_pango_layout
text_cell.set_font_description(Pango::FontDescription.new(“sans 12”))
text_cell.set_text(‘test’)

i wanna set background for this pango layout, or something similar.
i wanted to place a pango rectangle there, to border the text, but it’s not
supported.

x = …
y = …
w, h = text_cell.pixel_size
cr.rectangle(x, y, w, h)
cr.draw

Thanks,

kou


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Hi,

As far as I know, the documentation for rcairo is very light, however,
in the doc of ruby-gtk2, you have some samples that give a broad
aspect of rcairo. On my system, I have them under
/usr/share/doc/ruby-gtk2-0.14.1/sample/gtk-demo/cairo*

I hope that helps.

Alexis

PS: It seems I have two days’ lag on my mailer, forgive me if I appear
late…

On 1/22/07, Dobai-Pataky Bálint [email protected] wrote:

x = …



Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Kouhei S. wrote:

y = …
w, h = text_cell.pixel_size
cr.rectangle(x, y, w, h)
cr.draw
cr.stroke

this works, draws a rectangle.
is there a way i can fill this rectangle with a color?

my first idea was to draw a bar with a light color.

Kou, can you please tell me where i can find the documentation for
rcairo?

thanks,

balint


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs