From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9F5C1BBBB for ; Tue, 28 Mar 2006 12:17:41 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k2SAHeav028283 for ; Tue, 28 Mar 2006 12:17:41 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA29162 for ; Tue, 28 Mar 2006 12:17:40 +0200 (MET DST) Received: from kraid.nerim.net (smtp-102-tuesday.nerim.net [62.4.16.102]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k2SAHetF028279 for ; Tue, 28 Mar 2006 12:17:40 +0200 Received: from karryall.dnsalias.org (karryall.dnsalias.org [213.41.240.180]) by kraid.nerim.net (Postfix) with ESMTP id 9183E40FCF; Tue, 28 Mar 2006 12:17:39 +0200 (CEST) Received: by karryall.dnsalias.org (Postfix, from userid 500) id A6209596C82; Tue, 28 Mar 2006 12:17:39 +0200 (CEST) From: Olivier Andrieu Message-ID: <17449.3395.461238.170914@karryall.dnsalias.org> Date: Tue, 28 Mar 2006 12:17:39 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Erik de Castro Lopo Cc: caml-list@inria.fr, lablgtk@math.nagoya-u.ac.jp Subject: Re: [Caml-list] lablgtk2 : connecting scroll bar adjustments to a view widget. In-Reply-To: <20060328172132.77f5db6a.ocaml-erikd@mega-nerd.com> References: <20060328172132.77f5db6a.ocaml-erikd@mega-nerd.com>, <20060324222122.621a4d5e.ocaml-erikd@mega-nerd.com> X-Mailer: VM 7.19 under Emacs 21.4.1 X-Miltered: at concorde with ID 44290D45.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44290D44.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; andrieu:01 oandrieu:01 nerim:01 lablgtk:01 widget:01 lablgtk:01 gtksignal:01 widget:01 gtk:01 reuse:01 gpack:01 gtk:01 api:01 desc:01 2006:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Erik de Castro Lopo [Tuesday 28 March 2006] : > > HI all, > > I posted this to the lablgtk list but received no reply. I'm hoping > someone here might be able to answer this. > > I have a pair of view objects and I'd like to connect a GData.adjustment > to them. I think this has something to do with this method: > > method set_scroll_adjustments : > callback:(GData.adjustment option -> GData.adjustment option -> unit) > -> GtkSignal.id Not quite. Apparently this signal is not meant to be connected by application code but is used by widget implementations. > but I can't figure out how to use it. Anyone have a clue how to do > this? What you'd need is the gtk_widget_set_scroll_adjustments() function (which will emit the set_scroll_adjustments signal you've mentionned). Unfortunately this function is not wrapped in lablgtk. All is not lost however, you can still use the GtkScrolledWindow convenience widget to implement some "linked scrollbars" setup. You simply need to tell the second scrollbar you create to reuse the GtkAdjustment object of the first scrollbar. (Untested) Pseudo-code follows: ,---- | let pane = GPack.paned `HORIZONTAL ~packing () in | | let scroll_win_1 = | GBin.scrolled_window | ~packing:pane#add1 () in | let scroll_win_2 = | GBin.scrolled_window | ~vadjustment:scroll_win_1#vadjustment | ~packing:pane#add2 () in | | let text_view_1 = GText.view ~packing:scroll_win_1#add () in | let text_view_2 = GText.view ~packing:scroll_win_2#add () in | ... `---- This is not exactly what you wanted (there are 2 scrollbars) ; you'd need gtk_widget_set_scroll_adjustments() for a one-scrollbar-two-textviews setup. cf. http://developer.gnome.org/doc/API/2.0/gtk/GtkScrolledWindow.html#desc for a more detailed description of how scrollable widgets are managed. -- Olivier