From: SourceForge.net <no...@so...> - 2012-11-07 16:29:36
|
Bugs item #3580194, was opened at 2012-10-25 12:11 Message generated for change (Comment added) made by reowen You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=3580194&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 20. [tk_optionMenu] Group: current: 8.5.12 Status: Open Resolution: Invalid Priority: 5 Private: No Submitted By: Russell Owen (reowen) Assigned to: Kevin Walzer (wordtech) Summary: Width too narrow on MacOS X Initial Comment: The -width option on tk_optionMenu results in a widget that is far too narrow to display that many characters on MacOS X. If -indicatoron is 1 the result is even worse (even less of the text is displayed). For example: tk_optionMenu .om omVar DC1 DC2 DC3 .om configure -width 3 pack .om this displays as expected on Linux, but the widget is far too narrow on MacOS X. ---------------------------------------------------------------------- >Comment By: Russell Owen (reowen) Date: 2012-11-07 08:29 Message: I posted two screen shots on unix. I don't have access to Windows. I didn't realize tk_optionMenu had switched to using native widgets. If the desired behavior is that the widgets tend to look good with "reasonable" parameters on all platforms (I hope that width and indicatoron are both still considered reasonable), I would think the math for controlling width may have to be different for different platforms. ---------------------------------------------------------------------- Comment By: Russell Owen (reowen) Date: 2012-11-07 08:19 Message: On unix the width parameter specifies characters, not pixels, and the displayed widget shows that many characters whether indicatoron is true or false. I believe that is the standard, expected behavior, though I did not find the documentation for tk_optionMenu very enlightening. (Most of my coding is in python Tkinter, so I tend to rely on the Tkinter documentation. But that's no help when reporting bugs in tcl/tk). Thus I am confused when you talk about width being in pixels. It may be so on aqua, but surely that is a bug? ---------------------------------------------------------------------- Comment By: Kevin Walzer (wordtech) Date: 2012-11-07 08:08 Message: "Thus the correct fix (I believe) is to compute the width to send to the underlying widget differently on aqua than other platforms." I don't understand this. Three pixels is three pixels. The following code implements the "width" parameter: Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, mbPtr->normalBorder, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); How should this be changed? There are limits to how we can manipulate a native widget. If you set a more narrow width than the button's customary metrics, it will happily draw that width, and clip the text in doing so. Can you post a screenshot of how this looks on other platforms, particularly Windows? Linux is also OK, but there we're not using a native widget. ---------------------------------------------------------------------- Comment By: Russell Owen (reowen) Date: 2012-11-07 07:56 Message: Note that it is not an issue of 3 being intrinsically too narrow for Mac, but that any specified width is always too narrow for that many characters of text. Thus the correct fix (I believe) is to compute the width to send to the underlying widget differently on aqua than other platforms. Sometimes it is important to specify a width: for example if the user may choose options of varying width and the overall size of the parent window should remain the same. ---------------------------------------------------------------------- Comment By: Kevin Walzer (wordtech) Date: 2012-11-07 06:57 Message: This issue is easily avoided by not specifying a width and letting Tk draw the menubutton with default metrics, cf. omit the ".m configure -width 3" command. Under Aqua, the menubutton is drawn with a native widget, and a width of three pixels simply may not be compatible with those metrics. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=3580194&group_id=12997 |