Baboon has asked for the wisdom of the Perl Monks concerning the following question:

Fellow perlmonks,

Could you please share your experience how to manage .Xdefaults to be used for Tk on Win32?

I set "HOME" environment variable, and placed ".Xdefaults" file there.

My .Xdefaults file is as follows:

UserFont*userFont*foreground: red UserFont*userFont*background: green SystemFont*systemFont*foreground: white SystemFont*systemFont*background: white *font*background: black *font*background: black
I know it contains stupid color definitions, but they are such to do that obvious whether my file is accepted at all...

I searched Tk distribution but found nothing that I did wrong. Moreover, I saw mention about processing of that file on Win32.

Whoever sees I did something wrong, please advice me how to correct a situation.

Does anyone succeeded changing colors on Win32?

Thank you in advance,
I.R.Baboon.

Replies are listed 'Best First'.
Re: How to manage .Xdefaults to be used for Tk on Win32?
by Baboon (Acolyte) on Jun 15, 2002 at 16:50 UTC
    Actually my .Xdefaults file *was* processed by perl/Tk even on Win32 (after I placed that file in $HOME), the point was it contained values that did not affected anything I saw.

    When I put

    *background: yellow
    in there, it was obvious my file was processed

    And while trying to solve my problem I've discovered an interest way to override .Xdefaults from command line:

    perl -MTk -we "MainLoop(tkinit->Button(-text=>'test')->grid)" -- -xrm +*background:red -xrm *foreground:white
    and really short GUI program without any punctuation:
    perl -MTk -we "MainLoop tkinit"

    Best wishes,
    I.R.Baboon.

Re: How to manage .Xdefaults to be used for Tk on Win32?
by hagus (Monk) on Jun 14, 2002 at 07:13 UTC
    This is pretty thoroughly off-topic. --. Nevertheless, have you tried doing a google search for Tk related X resources?

    Furthermore, somewhere in the Tk distribution will be code that reads these X resources. Use the source.

    --
    Ash OS durbatulk, ash OS gimbatul,
    Ash OS thrakatulk, agh burzum-ishi krimpatul!
    Uzg-Microsoft-ishi amal fauthut burguuli.

      HOW IS THIS Off topic?

      The "options" database, described in Tk::options is what he's talking about.

        The fact that he doesn't mention Perl at all is a bit of a clue in. Tk is an extension to Tcl, not Perl. Yes, there is a Perl interface for it, but his question is a generalised one regarding the configuration of Tk, not something specific to the Tk Perl module.

        If it can be achieved with Tk::options, by all means enlighten us. It will be a useful contribution if he is indeed using the perl Tk module.

        --
        Ash OS durbatulk, ash OS gimbatul,
        Ash OS thrakatulk, agh burzum-ishi krimpatul!
        Uzg-Microsoft-ishi amal fauthut burguuli.

      Your reply is more likely offtopic (like mine now, sorry)

      RTFS is good advice, and, as I stated, I *did* RTFS but this leads me too deep into frustration.

      Are you a person who succeeded doing this and can share experience, as I asked?

      Why you're talking when you do not have something essential to say?

      Best wishes,
      I.R.Baboon.