GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

insert .png in textview

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
ramesh
GTK+ Guru


Joined: 16 Nov 2006
Posts: 134
Location: INDIA

PostPosted: Tue Nov 21, 2006 6:32 am    Post subject: insert .png in textview Reply with quote

hi
is anybody knows how to insert smile.png into gtktext view
i previosly used smile.xpm
and the code is

GtkWidget *image;
image= gdk_pixbuf_new_from_file(smile.xpm, NULL);
gtk_text_buffer_get_end_iter(cw->buffer1,&end);
gtk_text_buffer_insert_pixbuf (cw->buffer1,&end,image);

but now it want to change smile.png

please show me the way

thank you
Back to top
cnu_sree
GTK+ Geek


Joined: 06 Oct 2006
Posts: 57

PostPosted: Tue Nov 21, 2006 7:05 am    Post subject: Reply with quote

palce png in src or give the path where png or loaded and replace xpm with png.
try it
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Tue Nov 21, 2006 3:42 pm    Post subject: Reply with quote

Or, you can just load the PNG as a GdkPixbuf and and use gtk_text_buffer_insert_pixbuf() found at:

http://developer.gnome.org/doc/API/2.0/gtk/GtkTextBuffer.html#gtk-text-buffer-insert-pixbuf
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP