From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA13739; Mon, 5 May 2003 20:56:42 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA13292 for ; Mon, 5 May 2003 20:56:41 +0200 (MET DST) Received: from swordfish ([216.241.35.41]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h45IueT19419 for ; Mon, 5 May 2003 20:56:41 +0200 (MET DST) Received: from matt by swordfish with local (Exim 3.35 #1 (Debian)) id 19Cl8m-0001Tl-00 for ; Mon, 05 May 2003 12:56:44 -0600 Date: Mon, 5 May 2003 12:56:44 -0600 From: Matt Gushee To: caml-list@pauillac.inria.fr Subject: [Caml-list] Is LablTk extensible? Message-ID: <20030505185643.GA5035@swordfish> Reply-To: Matt Gushee Mail-Followup-To: caml-list@pauillac.inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i X-Spam: no; 0.00; gushee:01 mgushee:01 havenrock:01 labltk:01 extensible:01 all--:01 widgets:01 widget:01 seamlessly:01 api:01 configuring:01 recognized:99 gui:01 englewood:01 manure:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, all-- I have been experimenting with compound widgets in LablTk (a simple example would be something like a scrolled text window, consisting of a regular Text widget with horizontal and vertical scroll bars gridded into a frame), and have come up with a puzzle: Is there a way to create compound widgets that will fit seamlessly into the LablTk API? In other words, they will respond to all functions in the appropriate way? Taking the scrolled text example, in most cases the behavior should match that of the built-in Text widget: e.g., ScrolledText.insert index text widget should insert text in the text window, just as Text.insert does. But in other cases, such as configuring width and height, the outer frame should be the target of the operation. Well, it is easy enough to create module-specific functions that forward their actions to the appropriate sub-widgets. But what about global functions such as 'pack' and 'grid'? I am not yet familiar enough with the Tk widget types to be sure, but it seems that they are a closed set, so that new widgets cannot be recognized as LablTk widgets. Or is there a straightforward way to 'register' a new widget, so that it can be passed to 'pack', 'grid', and so on? By the way, I'm also curious why LablTk doesn't use an object oriented architecture. Though I'm not an OO fanatic by any means, it seems to me that OO fits rather naturally with GUI programming, especially for complex applications where you need to maintain state beyond what is contained in the widgets themselves. A fully-OO widget library would also be easier to extend, wouldn't it? -- Matt Gushee When a nation follows the Way, Englewood, Colorado, USA Horses bear manure through mgushee@havenrock.com its fields; http://www.havenrock.com/ When a nation ignores the Way, Horses bear soldiers through its streets. --Lao Tzu (Peter Merel, trans.) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners