Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Matt Gushee <mgushee@havenrock.com>
To: caml-list@pauillac.inria.fr
Subject: [Caml-list] Is LablTk extensible?
Date: Mon, 5 May 2003 12:56:44 -0600	[thread overview]
Message-ID: <20030505185643.GA5035@swordfish> (raw)

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


                 reply	other threads:[~2003-05-05 18:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030505185643.GA5035@swordfish \
    --to=mgushee@havenrock.com \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox