-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is Tk::Message good for? #33
Comments
It looks very similar to a Label widget. There are a few bundled examples that use Message, e.g. basic_demo: Lines 124 to 131 in 806e6b3
I agree Perl/Tk's documentation of Message is quite sparse, but it states the usual historical differences over Label: it can automatically wrap multiple lines of text and maintain a given aspect ratio. There might be more in Tk for Tcl or other languages' documentation (though I'm not sure it's 1:1 with Perl/Tk's Message). TkDocs even says there's no need for Message anymore since label has a wraplength option and accepts "\n" as a manual line break. |
Ah ok, this is very helpful. Thank you.
Coudn't this be omitted, or maybe replaced by an example? |
I found that confusing as as well, I didn't know what it meant by creating a new window and how that applies to a Message widget—for a moment I thought maybe it was referring to MessageBox. But it turns out that verbiage was probably lifted from https://www.tcl.tk/man/tcl/TkCmd/message.htm#M9, and just wasn't adapted very well to Perl/Tk syntax since it sounds like it still refers to Tcl syntax (other widgets have the same verbiage in their Tcl docs). So it probably doesn't belong. As far as what does belong, I would've suggested checking 3rd party docs, but there's little mention of Message anywhere (not even in the comprehensive Mastering Perl/Tk). Maybe suggesting Label as a better-documented alternative is a start. But note, I'm not an official contributor/maintainer, nor very experienced with Perl and/or Tk. |
It seems that the term "window" causes confusion here. This is the X11 heritage shining through: in X11, there's a data type named "Window" which is just a rectangular area on the screen, not necessarily a toplevel window as users would expect nowadays. If you check the other Perl/Tk manpages (Tk::Button, Tk::Label etc.), then you can see that the term "window" is used everywhere. As for the initial question: I think the description is quite clear what it does what a Tk::Label doesn't. However, Tk::Label is not mentioned here, unlike in the new version of the Tcl/Tk counterpart (see https://www.tcl.tk/man/tcl8.6/TkCmd/message.htm#M9 : "... that differentiate it from a label widget ..."). Maybe this should be added here. Otherwise I don't think the doc needs much changing. |
No, it's not. It might be clear for you, but after all. documentation is for the users. As for what needs changing from my point of view, please have a look at the pull request. Everything is fine if it counts as little change for you. |
In the Tk::UserGuide, the standard widget Tk::Message is listed.
However, after reading the POD, I have no idea what Tk::Message should be good for.
What is it good for? Where / How can I use it? How should I use it?
Links:
The text was updated successfully, but these errors were encountered: