Rafael | 10 Jul 22:24

Draw text over image

Hi,

I'm new to pygtk and gtk and have been doing some tests and most of them are very successful (thanks for the excelent tutorial and api documentation)!

I have a question, and hope you could help me. I have a gtk.Image within a eventbox. The image is resized when the containter is resized. I want to write some text over this image and resize the text (proportional). My text is a pango layout.

I've made most part of it, but there are 2 problems: sometimes, when the eventbox is resized the text simply disapear and allways there's a flash when the text is refreshed.

Ok, probably that isn't the correct way to do this task, and that's why I'm here. Could anybody help me find the best way to write a text over an image (that's all I need for now)?

I've been looking on google and list archive but I didn't found anything about draw a text over an image.

Thank you in advance!

_______________________________________________
pygtk mailing list   pygtk <at> daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
A.T.Hofkamp | 5 Aug 12:34

Re: Draw text over image

[Sorry Rafael, I pressed the 'send' button instead of cancel]

Rafael wrote:
> Hi,
> 
> I have a question, and hope you could help me. I have a gtk.Image within a
> eventbox. The image is resized when the containter is resized. I want to
> write some text over this image and resize the text (proportional). My text
> is a pango layout.

Why don't you use a DrawingArea, and render the image and the text yourself?

Albert
_______________________________________________
pygtk mailing list   pygtk <at> daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Rafael | 5 Aug 22:22

Re: Draw text over image

On Tue, Aug 5, 2008 at 7:34 AM, A.T.Hofkamp <a.t.hofkamp <at> tue.nl> wrote:
[Sorry Rafael, I pressed the 'send' button instead of cancel]

Rafael wrote:
Hi,


I have a question, and hope you could help me. I have a gtk.Image within a
eventbox. The image is resized when the containter is resized. I want to
write some text over this image and resize the text (proportional). My text
is a pango layout.

Why don't you use a DrawingArea, and render the image and the text yourself?



Albert

Hi Albert,

Thank you for your help. I've been playing with the drawingarea and finally now I can do what I want. My problem, besides the wrong component, was on using wrong events.
Thank you again.

--
Rafael Ferreira Silva - Web Developer
http://rafaelsilva.net
http://drupal-br.org
_______________________________________________
pygtk mailing list   pygtk <at> daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Gmane