GUIs - A Modest Proposal

Grant Edwards invalid at invalid.invalid
Wed Jun 9 16:34:04 EDT 2010


On 2010-06-09, Martin v. Loewis <martin at v.loewis.de> wrote:
> Am 09.06.2010 01:54, schrieb Grant Edwards:
>> On 2010-06-08, Martin v. Loewis<martin at v.loewis.de>  wrote:
>>> Am 08.06.2010 20:15, schrieb Grant Edwards:
>>>> On 2010-06-08, Martin v. Loewis<martin at v.loewis.de>   wrote:
>>>>>> TkInter ->   Tcl ->   Tk ->   Xlib
>>>>>>
>>>>>> Is the Tcl intepreter really need to use this GUI? Why not:
>>>>>>
>>>>>> (Pyton ->) Tkinter-API ->   Xlib ?
>>>>>
>>>>> Even if this was possible (which it is not)
>>>>
>>>> Why is it not possible?  It seems to have been done for other
>>>> languages.
>>>
>>> So you don't know for sure? Which implementation specifically
>>> do you think of?
>>
>> There was a Scheme implementation called STk that didn't use Tcl.
>
> That's not true. See, for example, Src/tk-glue.c. It contains functions like
>
> static SCM TkResult2Scheme(Tcl_Interp *interp, int objproc)
...
> SCM STk_execute_Tcl_lib_cmd(SCM cmd, SCM args, SCM env, int eval_args)
> ...
>
> This looks *exactly* like the approach taken in _tkinter to me.
>
> One difference seems to be that they include the full source code of
> Tcl and Tk with the interpreter, so you don't need to download it
> separately.
>
> The other difference apparently is that they expose Tcl commands as
> Scheme functions, so that they can write
>
> (Tk:pack [Tk:frame w.top :relief "raised" :bd 1] :expand #t :fill "both")
>
> However, this still uses a Tcl_Interp object during evaluation.

Of course you're right.  I somehow missed the fact that Tcl was
included in the distribution.  That and the ability to bind Tk widgets
to Scheme "variables" (you didn't have to get/put values) had somehow
fooled me into thinking there wasn't a Tcl layer.

That said, PerlTk didn't use Tcl did it?

-- 
Grant Edwards               grant.b.edwards        Yow! When you get your
                                  at               PH.D. will you get able to
                              gmail.com            work at BURGER KING?



More information about the Python-list mailing list