'Invalid memory Access' with GTK-API

Linux specific forum
Pinhead
User
User
Posts: 47
Joined: Fri Sep 09, 2005 11:24 pm

'Invalid memory Access' with GTK-API

Post by Pinhead »

It runs!
Thank you!
Last edited by Pinhead on Sat Sep 10, 2005 12:39 am, edited 1 time in total.
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

The last parameter must be the pointer to a long variable to receive the cursor position after the text was inserted.
Also you should probably remove the "+1" there from datenmenge.l

gtk_editable_insert_text_(GadgetID(#Editor_1),*Buffer,datenmenge.l,@position.l)
quidquid Latine dictum sit altum videtur
Pinhead
User
User
Posts: 47
Joined: Fri Sep 09, 2005 11:24 pm

Post by Pinhead »

I tried this:

Code: Select all

	      If ReadFile(#File_1, File.s)
		         laenge=FileSize(File.s)
		         *Buffer.b = AllocateMemory(laenge)
		         If *Buffer
		             datenmenge.l = ReadData(*Buffer, laenge)
		             CloseFile(#File_1)
   		           *Buffer = AllocateMemory(datenmenge.l)
           		   *position.l=AllocateMemory(1)
   		           PokeB(*position,0)
		             gtk_editable_insert_text_(GadgetID(#Editor_1),*Buffer,datenmenge.l,@position.l)
		         Else
	               MessageRequester("Fehler", "Speicher nicht reserviert!", 0)
	          EndIf
	      Else
In the characters in the editor are not showabel, I only see squaers...
The Input file is a html file
Post Reply