Re: popup menus

From: Erick Gallesio <eg_at_unice.fr>
Date: Mon, 30 Nov 1998 12:47:38 +0100 (CET)

Stacy Marsella writes:

> I am new to STk and have run into a curious problem trying to use popup menus
> under STk-3.1.1. If I try to create a popup menu, I get an error message which
> states the variable tk::popup is unbound. The menu code which defines
> tk::popup is loaded from menu.stk.
>
> Here is a portion of the toplevel of that file:
>
> ----
> (unless (or (tk-command? Tk:menu) (tk-command? Tk:menubutton))
> (let ()
> ....
> (define tk::popup #f)
> ....
> ))
>
> (define (Tk:popup menu x y entry)
> (if (or tk::popup tk::posted-mb)
> ;; plus various other fcns and vars defined in the above let
> ...
> )
>
> ----
>
> My problem is that I do not see how the above is supposed to work. The
> function Tk:popup uses variables and functions defined inside a let. However,
> the behavior of the two schemes I use (mainly bigloo but now also STk) is that
> the fcns and vars will be undefined outside of the let. So how is the above
> code supposed to work?

As you said that's clearly false. You can if you want delete the which
was here only as a "barrier" to avoid a too big name space pollution
or just put the definition of tk::popup outside of the let.
This problem should not exists in recent version of STk since we have
modules.


>
> I noticed under 3.99, Tk:popup works fine and menu.stk uses modules to provide
> a local context for the menu operations. There is no let. Presumably, the let
> in the above 3.1.1 code is trying to achieve the same effect without using
> modules (3.1.1 does not have modules). Unfortunately, it is not working for me.
>
> And why I am on the subject - I am using version 3.1.1 because it is critical
> that I be able to move my unix code eventually to win95. What is the outlook
> for a win95 version of the 4.0 version of STk?

A first release is planned for the end of the month or so.



> Stacy
>
> marsella_at_isi.edu


                -- Erick
Received on Mon Nov 30 1998 - 12:50:23 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST