Hi Pier,

nice tip and thanks for sharing it with the list :)

Lorenzo

> Hi to all!
> I reply to myself, because I've found the solution of my question.
> To better undestand what I mean with "small images into a gtk.TextView
> border window" you can have a look to the screenshot I attached.
> 
> So, step one obtain a reference to the border window you want to use
> 
> left_win= view.get_window(gtk.TEXT_WINDOW_LEFT) #view is an instance
>                                                 #of gtk.TextView
> than create a color to use as background color for your image; to obtain
> a color you can do the follow:
> 
> colormap=left_win.get_colormap()
> color=colormap.alloc_color("seashell")  
> 
> ("seashell" is the border color of the screenshot)
> 
>  
> At this point you can create a pixmap from file. I use the function
> gtk.gdk.pixmap_create_from_xpm:
> 
> (pixmap, mask)= gtk.gdk.pixmap_create_from_xpm(left_win, color, 
> file_name )
> 
> Obtain image width and height
> 
> (width, height)= pixmap.get_size()
> 
> Finally you can put the pixmap into the border window with draw_drawable
> method
> 
> left_win.draw_drawable(gc, pixmap, src_x, src_y, des_x , des_y, width,
> height)
> 
> gc is the graphics context obtained with a call like this
> 
> gc = left_win.new_gc()
> 
> I hope this can be useful to someone else..
> 
> Best regards!
> Pier
> 
> 
> 
> 
> Il gio, 2003-10-30 alle 10:22, Pier Carteri ha scritto:
> > Hi to all,
> > can someone tell me how to put an image into the border window of a
> > gtkTextView? 
> > Any examples?
> > 


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to