Re: My hang-up about OOP (snit)

Liste des GroupesRevenir à cl tcl 
Sujet : Re: My hang-up about OOP (snit)
De : heller (at) *nospam* deepsoft.com (Robert Heller)
Groupes : comp.lang.tcl
Date : 28. Jun 2024, 12:49:11
Autres entêtes
Organisation : Deepwoods Software
Message-ID : <MLOcnQXJp5eqPuP7nZ2dnZfqn_udnZ2d@giganews.com>
References : 1 2
User-Agent : TkNews 3.0 (1.2.18)
At Fri, 28 Jun 2024 00:06:29 -0300 Luc <luc@sep.invalid> wrote:

 
On Fri, 28 Jun 2024 02:24:19 +0000, Robert Heller wrote:
 
Did you read the man pages for *Tk* itself?
>
snit::widget and snit::widgetadaptor create widget constructors that
behave *EXACTLY* like native Tk widgets.
 
 
I think I understand, but it took me a long time to grasp because I
think I was lured into something else.
 
snit::type dog {
    # ....
}
::dog
% dog create spot
::spot
spot execute method
 
 
So I thought,
 
snit::widget textbox {
# ....
text -options blahblahblah
 
}
 
textbox create textbox1
textbox1 -otheroptions blahblahblah
 
But it's nothing like that! I thought I was going to create and refer
to widgets by some fancy name of my own choosing, but I'm not.
I was disappointed.

Tk widgets, whether the "built in" (native) ones or ones created by snit (or
BWidget or any other Tcl/Tk widget extension) all *have* to obey the
convention that Tk widgets are in a hierarchical path:
".parent.child.grandchild" -- it does not matter if parent was created by a Tk
widget and child was created by a snit::widget and grandchild was created by a
BWidget (another Tk widget extension framework) class. This is *required* by
how the underlying structure of the Tk GUI subsystem works. All "widgets"
(windows) have to the be the child of some other widget (window) and container
widgets (eg toplevels, frames, etc.) can have children widgets. Only "." has
no parent and is in fact the final ancestor of all widgets. I believe this
parent and child structure is a standard feature of all GUI subsystems, not
just Tk. There are reasons for that, which could probably fill a whole
textbook / university course to explain.

Snit's "types" are not constrained by Tk -- they are their own thing
independent of Tk. Snit's "widgets" and "widgetadaptors" do use the same
internal structure as snit "types" (variables, methods, options, and
components), but their naming conventions are tied (hardwired) to follow the
same conventions as any other widget framework.

 
 

--
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller@deepsoft.com       -- Webhosting Services
                                                                                                              

Date Sujet#  Auteur
25 Jun 24 * My hang-up about OOP (snit)22Luc
25 Jun 24 +* Re: My hang-up about OOP (snit)10Rich
25 Jun 24 i`* Re: My hang-up about OOP (snit)9Luc
26 Jun 24 i +- Re: My hang-up about OOP (snit)1Robert Heller
26 Jun 24 i +- Re: My hang-up about OOP (snit)1Rich
26 Jun 24 i +- Re: My hang-up about OOP (snit)1Rich
26 Jun 24 i `* Re: My hang-up about OOP (snit)5Rich
27 Jun 24 i  +* Re: My hang-up about OOP (snit)3Luc
27 Jun 24 i  i`* Re: My hang-up about OOP (snit)2Rich
27 Jun 24 i  i `- Re: My hang-up about OOP (snit)1Lawrence Woodman
27 Jun 24 i  `- Re: My hang-up about OOP (snit)1Robert Heller
26 Jun 24 +- Re: My hang-up about OOP (snit)1saito
26 Jun 24 +* Re: My hang-up about OOP (snit)9Robert Heller
27 Jun 24 i`* Re: My hang-up about OOP (snit)8Luc
27 Jun 24 i `* Re: My hang-up about OOP (snit)7Robert Heller
27 Jun 24 i  `* Re: My hang-up about OOP (snit)6Luc
28 Jun 24 i   `* Re: My hang-up about OOP (snit)5Robert Heller
28 Jun 24 i    `* Re: My hang-up about OOP (snit)4Luc
28 Jun 24 i     `* Re: My hang-up about OOP (snit)3Robert Heller
28 Jun 24 i      `* Re: My hang-up about OOP (snit)2Luc
28 Jun 24 i       `- Re: My hang-up about OOP (snit)1Robert Heller
26 Jun 24 `- Re: My hang-up about OOP (snit)1Luis Mendes

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal