GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Jul 23, 2014 4:10 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: insert .png in textview
PostPosted: Tue Nov 21, 2006 6:32 am 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 7:05 am 
Offline
GTK+ Geek

Joined: Fri Oct 06, 2006 6:37 am
Posts: 57
palce png in src or give the path where png or loaded and replace xpm with png.
try it


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 3:42 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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/ ... ert-pixbuf

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group