From: Adrian R. <adr...@gm...> - 2012-11-28 21:20:38
|
I think if it's possible for Tk to support a widget option consistently across platforms it should do its best to do so. What is or isn't best programming practice is one thing, but the API is kind of like a contract, that allows cross-platform applications to be written without the need for a lot of if-then's to handle different environments. This is why when ttk was added, the approach was to provide a more minimal set of configuration options for each widget, to ensure that it could be adhered to for each platform, rather than providing a bigger set of which parts might or might not work in a given environment. -Adrian On 2012/11/28, at 11:07, Kevin Walzer <kw...@co...> wrote: > Hi list, > > On 11/26/12 4:31 PM, Russell E. Owen wrote: >> >> Would it be OK to change Tcl/Tk so that the width option on these >> widgets actually does specify roughly how many chars could be displayed? >> Its a simple change, though admittedly one that requires a Mac-specific >> branch. I guess an obvious question is how widely others are already >> hacking around this issue. (I assume most users use width=0 and thus >> don't see this bug). > > I would appreciate others weighing in on this. > > As I've commented to Russell at the bug report, my view is that what > he's seeing is not a bug but simply the platform-specific > implementation, i.e. Cocoa may simply calculate text width and render it > a bit differently than did Carbon. (Carbon used QuickDraw and then ATSUI > for its text rendering, while Cocoa uses CoreText.) If he does not use > hard-coded widths then the text displays fine, although it may change > the layout of his app. > > My understanding is that it's not considered a best practice in Tk to > hard-code text widths and font sizes, because font rendering can vary so > widely across platforms: what looks good on one platform may look quite > different (and not so good) on another. My limited experience with > deploying a Tk app on Windows confirms this. > > I'm reluctant to go against the platform-specific grain and investigate > a change that would preserve cross-platform compatibility at the expense > of best practices on the specific platform, cf. how other Cocoa-based > apps do it. I'm especially reluctant to do so (and not even sure it can > be done) given that Russell has found a workaround for his use case. > > Other opinions are welcome. > > Thanks, > Kevin > > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > > ------------------------------------------------------------------------------ > Keep yourself connected to Go Parallel: > INSIGHTS What's next for parallel hardware, programming and related areas? > Interviews and blogs by thought leaders keep you ahead of the curve. > http://goparallel.sourceforge.net > _______________________________________________ > Tcl-mac mailing list > tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac |