Pango::layout background color


#1

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


#2

Hi,

In removed_email_address@domain.invalid
“[ruby-gnome2-devel-en] pango::layout background color” on Tue, 16 Jan
2007 15:54:02 +0200,
Dobai-Pataky Bálint removed_email_address@domain.invalid 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


#3

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


#4

Hi,

In removed_email_address@domain.invalid
“Re: [ruby-gnome2-devel-en] pango::layout background color” on Sun, 21
Jan 2007 00:17:34 +0900 (JST),
Kouhei S. removed_email_address@domain.invalid 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


#5

Hi,

In removed_email_address@domain.invalid
“Re: [ruby-gnome2-devel-en] pango::layout background color” on Sat, 20
Jan 2007 00:06:21 +0200,
Dobai-Pataky B. removed_email_address@domain.invalid 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


#6

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 removed_email_address@domain.invalid 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


#7

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


#8

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