[Pythonmac-SIG] Tkinter questions

Samuel Smith smith@oe.fau.edu
Thu, 22 Apr 1999 13:40:27 -0400


>Samuel,
>you should probably also ask your non-mac-specific Tkinter questions in the
>general Python mailinglist/newsgroup, where you have a much better chance of
>an answer.
>
>I'll stick to answering the mac things I know about:
>
>> The python menubar gets replaced with a new menu bar who's menus apparently
>> do nothing.
>
>This is a Tk problem, and I think there's little I can do about it.

I looked in the source distributed for tcl/tk and found this in one of the
source files for Wish.

void
TkMacInitMenus(
    Tcl_Interp 	*interp)
{
    gInterp = interp;

    /*
     * At this point, InitMenus() should have already been called.
     */

    if (TkMacUseMenuID(256) != TCL_OK) {
    	panic("Menu ID 256 is already in use!");
    }
    tkAppleMenu = NewMenu(256, "\p\024");
    if (tkAppleMenu == NULL) {
	panic("memory - menus");
    }

So tk has hard coded the use of a menuID that apparently is being used by
the Python interpreter?

Suggestions
use a different menu id in python
get rid of the code in tk the creates a menubar.

I found this code fragment in  _tkinter.c file in the Tkapp_New(screenName,
baseName, className, interactive) function

	v->interp = Tcl_CreateInterp();

#if defined(macintosh) && TKMAJORMINOR >= 8000
	/* This seems to be needed since Tk 8.0 */
	ClearMenuBar();
	TkMacInitMenus(v->interp);
#endif

So it looks like _tkinter is putting in the menu bar.

I don't know all the ramifications of what _tkinter is doing. Just not
calling TkMacInitMenus() might work?

Anybody have any ideas.

Still can't run Tkinter on the mac.

Can you forward to Steen Lumholt? don't know his email.

Sam
**********************************

Samuel M. Smith Ph.D.
Associate Professor
Director Advanced Marine Systems Lab


**************(Dania Building)***********************

Institute for Ocean and Systems Engineering
Florida Atlantic University
Rm. 225 B, SeaTech Bldg.
101 North Beach Road,  Dania, FL 33004

(voice) 954-924-7232
(secretary Paula) 954-924-7230
(fax) 954-924-7233
(email) smith@oe.fau.edu
(web) http://www.oe.fau.edu

************** (Boca Raton Campus) *******************
Ocean Engineering Dept. Bldg. 36
Florida Atlantic University
777 Glades Rd, Boca Raton FL 33431

(voice) 561-297-3606
(reception) 561-297-3430
(fax) 561-297-3885
(email) smith@oe.fau.edu
(web) http://www.oe.fau.edu

***********************************