From: Zbigniew Diaczyszyn on
When I define a procedure tk::mac::ShowPreferences working on a Mac
Leopard Snow with the Mac version of ActiveState Tcl/Tk I can use the
Mac Preference menu without problems. Great work!

But normally I work on a Unix platform compiling my program with
tclkit-darwin-aqua for a Mac Platform. And defining a procedure

proc ::tk::mac::ShowPreferences {} {
tk_messageBox -type ok -icon info -default ok \
-title "Preferences" \
-message "Here will be a Preference Dialog!"
}

and compiling it for aqua will fail on the Mac.

Probably I have to add the tk::mac namespace to my Linux Tcl/Tk. But the
package tclAE depends on a Mac TK, true? Is there any other way to add a
library which will be enabling tk::mac::ShowPreferences on my Linux host?



From: Kevin Walzer on
On 2/26/10 3:38 AM, Zbigniew Diaczyszyn wrote:
> When I define a procedure tk::mac::ShowPreferences working on a Mac
> Leopard Snow with the Mac version of ActiveState Tcl/Tk I can use the
> Mac Preference menu without problems. Great work!
>
> But normally I work on a Unix platform compiling my program with
> tclkit-darwin-aqua for a Mac Platform. And defining a procedure
>
> proc ::tk::mac::ShowPreferences {} {
> tk_messageBox -type ok -icon info -default ok \
> -title "Preferences" \
> -message "Here will be a Preference Dialog!"
> }
>
> and compiling it for aqua will fail on the Mac.
>
> Probably I have to add the tk::mac namespace to my Linux Tcl/Tk. But the
> package tclAE depends on a Mac TK, true? Is there any other way to add a
> library which will be enabling tk::mac::ShowPreferences on my Linux host?
>
>
>
The preferences menu is a system-provided menu on the Mac. The
::tk::mac::ShowPreferences procedure is Mac-only, as it hooks into Apple
Events. Your best bet is probably to wrap the procedure in a Tk
windowing system call to avoid errors on non-Mac platforms, i.e.

if [tk windowingsystem] == "aqua"] {

proc ::tk::mac::ShowPreferences {} {

.....
}

}


HTH, Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
From: Zbigniew Diaczyszyn on
Kevin Walzer schrieb:

> The preferences menu is a system-provided menu on the Mac. The
> ::tk::mac::ShowPreferences procedure is Mac-only, as it hooks into Apple
> Events. [...]

So there is no other way then to compile my program with
tclkit-darwin-aqua on a Mac? There aren't any libraries I could add to
my linux hosted Tcl/Tk? For example like:

if [tk windowingsystem] == "aqua"] {

package require mac_events

proc ::tk::mac::ShowPreferences {} {

......
}

If you do often versioning it is much more convenient to sit before your
terminal and just do some bash scripting: make_aqua; make_win;
make_linux