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=bzDoLxp3kHP1/Lbmpr61bZqN2HXCTqmYq8DC9B1mDCs=; b=V8cMxDY4w1+b/BQ96K0hbPtWcBoRme59qD41tbNQxwYYXuTEq/7sf8KYTZIMeLh6c1FGoghw7G4Us7GFzKRJghwTKgnin0fFZ6Q01fB64hmd+C73uLVy7vz06gK6TjTvz00sP2WOkk9UtqTol8Skg+htXWmt36Icbwe1H7Xt0j4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=n13wf5IXXPpE0CBuH5wmJBEz5pPERHjtV2afTaBrvb9UVULiGV4Le8T/eEdD7bqqIRZpzVBfrj1Xu6EI7+sEZ2X0S9q389Gc2qpzkffL1b2nzPrNGZJnGCoAStlhRwEmEWPBViOJ7nuI1C2bJoyfg5cBb/01yAutpSkt/3PP2Ck= Message-ID: Date: Thu, 15 May 2008 00:33:54 -0400 From: "Jacques Le Normand" To: lablgtk at yquem.inria.fr MIME-Version: 1.0 Subject: [Lablgtk] gnomecanvas and automatic resizing Mime-version: 1.0 Content-Type: multipart/mixed; boundary="===============1785028758==" Content-Length: 4366 --===============1785028758== Content-Type: multipart/alternative; boundary="----=_Part_8411_6615136.1210826034115" ------=_Part_8411_6615136.1210826034115 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello lablgtk, I managed to fix my linking error by adding lablgnomecanvas.cma to my compile line However, now I have another problem; I'd like to add widgets to a gnome canvas and have them resize automatically. Furthermore, I want to move my widgets around the canvas this is my first attempt: (* compiled with ocamlc -I +lablgtk2 lablgtk.cma lablgnomecanvas.cma gtkInit.cmo test.ml*) open Gobject let _ = let source_window = GWindow.window () in let buffer = GText.buffer () in let view = GText.view ~buffer:buffer ~show:true () in let canvas = GnoCanvas.canvas ~show:true ~packing:source_window#add () in let item = GnoCanvas.widget ~widget:view ~width:100.0 ~height:100.0 canvas#root in buffer#insert "some text"; source_window#show (); source_window#maximize (); GMain.Main.main () unfortunately, the size of the widget is fixed. I can resize it with item#set [`HEIGHT 50.0], but there's no way of knowing the widget's natural size (or is there?) this is my second attempt: open Gobject let _ = let source_window = GWindow.window () in let buffer = GText.buffer () in let canvas = GnoCanvas.canvas ~show:true ~packing:source_window#add () in let _ = GText.view ~buffer:buffer ~show:true ~packing:canvas#add () in buffer#insert "some text"; source_window#show (); source_window#maximize (); GMain.Main.main () So now my widget (created with GText.view) resizes automatically, but I can't move it around! in fact, canvas#root#get_items is empty! Is there any way out of the conundrum? --Jacques ------=_Part_8411_6615136.1210826034115 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello lablgtk,
I managed to fix my linking error by adding lablgnomecanvas.cma to my compile line
However, now I have another problem; I'd like to add widgets to a gnome canvas and have them resize automatically. Furthermore, I want to move my widgets around the canvas

this is my first attempt:

 (* compiled with ocamlc -I +lablgtk2 lablgtk.cma lablgnomecanvas.cma gtkInit.cmo test.ml*)
open Gobject
let _ =
  let source_window = GWindow.window () in
  let buffer = GText.buffer () in
  let view = GText.view ~buffer:buffer ~show:true  ()  in
  let canvas = GnoCanvas.canvas ~show:true ~packing:source_window#add () in
  let item = GnoCanvas.widget ~widget:view ~width:100.0 ~height:100.0 canvas#root   in
    buffer#insert "some text";
    source_window#show ();
    source_window#maximize ();
    GMain.Main.main ()
     

unfortunately, the size of the widget is fixed. I can resize it with item#set [`HEIGHT 50.0], but there's no way of knowing the widget's natural size (or is there?) this is my second attempt:

open Gobject
let _ =
  let source_window = GWindow.window () in
  let buffer = GText.buffer () in
  let canvas = GnoCanvas.canvas ~show:true ~packing:source_window#add () in
  let _ = GText.view ~buffer:buffer ~show:true ~packing:canvas#add  ()  in
    buffer#insert "some text";
    source_window#show ();
    source_window#maximize ();
    GMain.Main.main ()
     
So now my widget (created with GText.view) resizes automatically, but I can't move it around! in fact, canvas#root#get_items is empty! Is there any way out of the conundrum?
--Jacques


------=_Part_8411_6615136.1210826034115-- --===============1785028758== 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 --===============1785028758==--