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 F2504BBC0 for ; Thu, 30 Mar 2006 10:38:26 +0200 (CEST) Received: from smtp2.syd.swiftdsl.com.au (smtp2.syd.swiftdsl.com.au [218.214.225.98]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id k2U8cJjJ010300 for ; Thu, 30 Mar 2006 10:38:25 +0200 Received: (qmail 13821 invoked from network); 30 Mar 2006 08:38:29 -0000 Received: from unknown (HELO coltrane.mega-nerd.net) (218.214.64.136) by smtp2.syd.swiftdsl.com.au with SMTP; 30 Mar 2006 08:38:29 -0000 Received: from coltrane (localhost [127.0.0.1]) by coltrane.mega-nerd.net (Postfix) with SMTP id E0D417B6E for ; Thu, 30 Mar 2006 18:38:15 +1000 (EST) Date: Thu, 30 Mar 2006 18:38:15 +1000 From: Erik de Castro Lopo To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] lablgtk2 : connecting scroll bar adjustments to a view widget. Message-Id: <20060330183815.18864ef5.ocaml-erikd@mega-nerd.com> In-Reply-To: <17449.3395.461238.170914@karryall.dnsalias.org> References: <20060328172132.77f5db6a.ocaml-erikd@mega-nerd.com> <20060324222122.621a4d5e.ocaml-erikd@mega-nerd.com> <17449.3395.461238.170914@karryall.dnsalias.org> Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed version 2.0.4 (GTK+ 2.8.10; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 442B98FB.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lablgtk:01 widget:01 andrieu:01 widget:01 lablgtk:01 gtk:01 reuse:01 gpack:01 gtk:01 ocaml:01 ocaml:01 api:01 desc:01 cheers:01 scrollbars: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.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Olivier Andrieu wrote: > Not quite. Apparently this signal is not meant to be connected by > application code but is used by widget implementations. Yes, Jacques Garrigue explained this on the lablgtk list. > 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. Ah ha. > 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. Hmm, fortunately I am much more proficient in C than I am in Ocaml so my best bet is write a widget in C that fits my needs in exactly and then wrap that in Ocaml. > cf. http://developer.gnome.org/doc/API/2.0/gtk/GtkScrolledWindow.html#desc > for a more detailed description of how scrollable widgets are managed. Thanks again. I'll check it out. Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo +-----------------------------------------------------------+ "Being completely naked during the act of coitus annuls the marriage." -- Rashad Hassan Khalil, a former dean of Al-Azhar University's faculty of Sharia (or Islamic law)