Hi Bloodelf,

Want a brute-force way to do this? It may be ugly, but it will set the font of any grandchildren of the window to a font you specify.

Please don't use this as is and instead refine it to minimally suit your needs. I just want to give you some ideas. Uncomment the print statements to see the widgets you are operating on.

#! /usr/local/bin/perl -w use strict; use Tk; use Tk::BrowseEntry; # Create the main window my $w; $w->{main} = MainWindow->new; # Create the browse entry $w->{be} = $w->{main}->BrowseEntry( -label => "be" )->pack; $w->{be}->insert("end", "opt1"); $w->{be}->insert("end", "opt2"); $w->{be}->insert("end", "opt3"); # Make a font my $font = $w->{main}->fontCreate('myfont', -family => 'Helvetica', -s +ize => 20); # Assign it to the widget $w->{be}->configure(-font=> 'myfont'); # Find all the children of the browse entry. foreach ($w->{be}->children) { #print "$_\n"; # find all the grandchildren and assign them a new font. foreach ($_->children) { #print "\t$_\n"; if ($_->cget('-font')) { $_->configure(-font => 'myfont'); } } } MainLoop;
Good luck,
{NULE}
--
http://www.nule.org

In reply to Re: Tk::BrowseEntry by {NULE}
in thread Help with Tk::BrowseEntry by Bloodelf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.