List Info

Thread: Cascade menus in 8.5 (HEAD)




Cascade menus in 8.5 (HEAD)
country flaguser name
Sweden
2007-05-31 13:11:59
Hi!

I've started playing with 8.5 on Mac (Intel) and it seems to
work fine
except for this:
Cascade menus don't seem to work at all.
Does anyone know if this is supposed to work?
Here is a sample snippet that works fine on Windows (after
changing to
ButtonPress-3):

################
set ::tk::mac::useCustomMDEF 1
catch {console show}

proc showmenu {} {
	set x [winfo pointerx .]
	set y [winfo pointery .]

	menu .submenu -type tearoff
	.submenu add command -label "Cascaded item"
-command "puts {Cascaded
item}"
	
	menu .m -tearoff 0
	.m add command -label "Test" -command "puts
Test"
	.m add cascade -label "And a cascade" -menu
.submenu
	update
	.m post $x $y
	update
	destroy .submenu
	destroy .m
}

bind . <ButtonPress-2> "showmenu"
################

Doesn't matter if I set useCustomMDEF to 0 either.

I'm using HEAD (from 29/5 at 14:44).

Cheers,

Linus



------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
Tcl-mac mailing list
tcl-maclists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Cascade menus in 8.5 (HEAD)
country flaguser name
Australia
2007-05-31 22:25:29
Linus,

On 01/06/2007, at 4:11, Linus Nyberg wrote:

> I've started playing with 8.5 on Mac (Intel) and it
seems to work fine
> except for this:
> Cascade menus don't seem to work at all.
> Does anyone know if this is supposed to work?

cascades work but only when part of the menubar or attached
to a  
menubutton...
the following patch fixes this limitation for me and seems
to have no  
negative effects, please test:

Index: macosx/tkMacOSXMenu.c
============================================================
=======
--- macosx/tkMacOSXMenu.c
+++ macosx/tkMacOSXMenu.c
 -1556,6
+1556,7  TkpPostMenu(
	    Tcl_CancelIdleCall(DrawMenuBarWhenIdle, NULL);
	    DrawMenuBarWhenIdle(NULL);
	}
+	RecursivelyInsertMenu(menuPtr);
	TkMacOSXTrackingLoop(1);
	popUpResult = PopUpMenuSelect(macMenuHdl, y, x,
menuPtr->active);

Cheers,

Daniel

-- 
** Daniel A. Steffen        Dept. of Mathematics  **
** Macquarie University     NSW 2109 Australia    **



------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
Tcl-mac mailing list
tcl-maclists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/tcl-mac

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )