Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=Hr44qeRH6NcNLKQxsQQsee/HlhH2hj5RbmaTCd+feEo=; b=oMonRBShOS7JJA9Mbf6MuxFmmBFTuR4mROOCxXRfHOaLsLgD0Xbyv4BD2ATS+tlF07 PrRoKAu00oUWZ3Tg4MYEyeE/que7V1nGxe2OfBBG/Uhpl/ii8bWhKmkO3jJ6dqiYH4TA cJob0qDb0aXq6ViCzg5u4D189njCZwfpgo3Rk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=D2vP6B7FV0304Nne5cTaR/x2LiapBknBN60saqYMIf+rbRWLonC0uqH5vbC32VD2pu CMfHfgbk1sDbQYZQ3wZVC3qzKpZ+N1mbWNZowOo10LEImrNBg59WVgF9oiJZ1r8DtF7C 3hFEQmcnKYZ9VaLCOYzMR/nkRBrH9EMRTZu1E= Message-ID: Date: Tue, 2 Sep 2008 22:12:43 -0400 From: "Jacques Le Normand" To: lablgtk at yquem.inria.fr MIME-Version: 1.0 Subject: [Lablgtk] erasing anchors Mime-version: 1.0 Content-Type: multipart/mixed; boundary="===============0907127125==" Content-Length: 2651 --===============0907127125== Content-Type: multipart/alternative; boundary="----=_Part_15799_32539366.1220407963125" ------=_Part_15799_32539366.1220407963125 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline dear lablgtk, I've written a small program that inserts a text_entry into a text_view, erases it, then inserts it again unfortunately, it doesn't show the text_entry; could someone tell me what I'm doing wrong? here's the code: open Gobject let clearTextBuffer (tb:GText.buffer) = let a = tb#start_iter in let b = tb#end_iter in tb#delete a b let _ = let source_window = GWindow.window () in let buffer = GText.buffer () in let view = GText.view ~buffer:buffer ~packing:source_window#add () in let entry = GEdit.entry () in view#add_child_at_anchor (entry :> GObj.widget) (buffer#create_child_anchor (buffer#get_iter (`OFFSET 0))); source_window#show (); clearTextBuffer buffer; view#add_child_at_anchor (entry :> GObj.widget) (buffer#create_child_anchor (buffer#get_iter (`OFFSET 0))); GMain.main () ------=_Part_15799_32539366.1220407963125 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
dear lablgtk,

I've written a small program that inserts a text_entry into a text_view, erases it, then inserts it again
unfortunately, it doesn't show the text_entry; could someone tell me what I'm doing wrong?
here's the code:


open Gobject



let clearTextBuffer (tb:GText.buffer) =
  let a = tb#start_iter in
  let b  = tb#end_iter in
    tb#delete a b


let _ =
let source_window = GWindow.window () in
let buffer = GText.buffer () in
let view = GText.view ~buffer:buffer ~packing:source_window#add  () in
let entry = GEdit.entry () in
  view#add_child_at_anchor (entry :> GObj.widget) (buffer#create_child_anchor (buffer#get_iter (`OFFSET 0)));
  source_window#show ();
  clearTextBuffer buffer;
  view#add_child_at_anchor (entry :> GObj.widget) (buffer#create_child_anchor (buffer#get_iter (`OFFSET 0)));
  GMain.main ()

------=_Part_15799_32539366.1220407963125-- --===============0907127125== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk --===============0907127125==--