For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > December 2005 > Tk and xdefaults on windows (prompted by Re: Tk's lack of "chrome")









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Tk and xdefaults on windows (prompted by Re: Tk's lack of "chrome")
Nick Ing-Simmons

2005-12-10, 7:12 pm

Hans Jeuken <haje@toneel.demon.nl> writes:
>
>A couple of years ago i had a W98 machine and i was
>sharing my linux home folder on that machines through
>samba. When launching a perl/Tk script from that
>shared drive on the W98 it used the settings in
>the .Xdefaults file in my homedirectory on my linux
>machine. I do not remember if all settings were correct,
>but at least background colours matched.


I know how basics work as I have used them myself.
You are correct that for some meaning of "home directory"
(which isn't really a Win32 concept) it will find an .Xdefaults
file and parse & load it - in a tk core way which isn't quite
the way other X toolkits work. But there isn't the X11 concept
of defaults per-Display (or per-Screen).

>
>My guess therefore is that an .Xdefaults in the root
>of the drive from where you are launching the script
>will be used on Windows, but i did not pursue this
>then and now i don't have a Windows machine to
>test.
>
>I don't know if anybody has been investigating this,
>but would be very interested to hear experiences.
>
>Hans
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server. If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to majordomo@lists.stanford.edu



-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu

Slaven Rezic

2005-12-14, 7:02 pm

Nick Ing-Simmons <nick@ing-simmons.net> writes:

> Hans Jeuken <haje@toneel.demon.nl> writes:
>
> I know how basics work as I have used them myself.
> You are correct that for some meaning of "home directory"
> (which isn't really a Win32 concept)


I once found this API call:

my $server = get_domain_server();
if (defined $server) {
my($userinfo) = {};
Win32API::Net::UserGetInfo($server, Win32::LoginName(), 2, $userinfo);
if ($userinfo) {
return $userinfo->{homeDir}; # this is the "home" directory
}
}

Which probably only works in a networked windows environment.

Otherwise there are some environment variables which possibly denote a
"home" directory: HOMEDRIVE+HOMEPATH, USERPROFILE, HOMESHARE, HOME...

Regards,
Slaven

--
Slaven Rezic - slaven <at> rezic <dot> de

Tk-AppMaster: a perl/Tk module launcher designed for handhelds
http://tk-appmaster.sf.net
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com