_gtkTextBufferInsertImage

Insert a pixbuf to a textbuffer. The pixbuf will be considered as one character and will be represented by the Unicode "object replacement character" 0xFFFC whenever the contains of the textbuffer will return (if 'unhidden' flag is 1, see _gtkTextBufferGet).

Insère une image dans un textbuffer.

Type :

fun [ObjGtkTextBuffer ObjGtkPixbuf I] ObjGtkTextBuffer

_textbuffer_ : ObjGtkTextBuffer : any textbuffer already created.

_pixbuf_ : ObjGtkPixbuf : image resource.

_position_ : I : set the position of the pixbuf into the textbuffer.

Return : ObjGtkTextBuffer : the same _textbuffer_ or nil if error.

WARNING : the textview (associated with this textbuffer) should be created with an explicit textbuffer, i.e not nil. Otherwise, the default textbuffer doesn't display the pixbuf, probably my code ...

Example :

	typeof win = ObjGtk;;
	typeof object = ObjGtk;;
	typeof buffer = ObjGtkTextBuffer;;
	typeof pixbuf = ObjGtkPixbuf;;

	fun end (obj, u)=
		_gtkMainQuit;
		_closemachine;
		0;;

	fun main ()=
		_showconsole;
	
		set win = _gtkWindowNew _channel nil "My test" SGTK_POS_MOUSE;
		_gtkWindowResize win 400 400;
		_gtkWindowCBdestroy win @end nil;
	
		set pixbuf = _gtkPixbufNewFile _channel _checkpack "logo.bmp";
		set buffer = _gtkTextBufferNew _channel nil;
		set object = _gtkTextNew _channel buffer;
		_gtkTextSet object "The Scol language  is a GREAT language !
			Have phun ! ;-)" nil;
		_gtkTextBufferInsertImage buffer pixbuf 18;
	
		_gtkWidgetAddContainer win object;
		_gtkWidgetShow win;
		_gtkMain;
		0;;

_gtkTextBufferInsertImage

Back