caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Is LablTk extensible?
@ 2003-05-05 18:56 Matt Gushee
  0 siblings, 0 replies; only message in thread
From: Matt Gushee @ 2003-05-05 18:56 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-05 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-05 18:56 [Caml-list] Is LablTk extensible? Matt Gushee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).