Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^3: Perl/TK borderwidth question

by kcott (Chancellor)
on Oct 26, 2012 at 15:38 UTC ( #1001115=note: print w/replies, xml ) Need Help??

in reply to Re^2: Perl/TK borderwidth question
in thread Perl/TK borderwidth question

There's probably a few things you should take into consideration before making universal changes.

As well as borderWidth, some widgets also have activeBorderWidth, insertBorderWidth and selectBorderWidth - Tk::options has details of these. If, for instance, you had borderWidth and activeBorderWidth with different sizes, you'll get unwanted visual effects when you interact with these widgets.

Other widgets, such as Tk::Frame, have a default borderWidth of zero which you'll generally not want to change.

In short, while $mw->optionAdd('*borderWidth', '1'); might look like a quick fix, it will probably lead to all sorts of unwanted problems - some of which may not be immediately obvious.

My advice would be to just change what you need on a widget-by-widget basis.

Here's a few more examples, taken from the same script as the earlier examples, that demonstrate some of the points I've just made:

$mw->optionAdd(q{*Entry*borderWidth}, 1, $priority); $mw->optionAdd(q{*Entry*insertBorderWidth}, 0, $priority); $mw->optionAdd(q{*Entry*selectBorderWidth}, 0, $priority); $mw->optionAdd(q{*NoteBook.borderWidth}, 1, $priority); $mw->optionAdd(q{*NoteBook.activeBorderWidth}, 1, $priority); $mw->optionAdd(q{*NoteBook.Frame.borderWidth}, 0, $priority); $mw->optionAdd(q{*NoteBook.Frame.activeBorderWidth}, 0, $priority) +;

-- Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1001115]
[Corion]: Ouch! It seems that MacOS "High Sierra" doesn't handle fork() calls while there are threads running. I'm not really sure whether one should mix fork and threads though...
[ambrus]: Corion: pre-fork before creating any threads
[ambrus]: it's good practice anyway, even if Linux tolerates forking after creating threads (tolerates, as in, the fork works, but other threads are dead which can lead to interesting deadlocks)
[marto]: could be worse, could be dust
[ambrus]: Corion: if you're forking from perl, then schmorp has a module that helps this prefork magic

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2017-10-19 14:45 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (253 votes). Check out past polls.