Stupid me!
Excuse me, but I did a few mistakes.
Frist, I checked only Tk docs on http://www.tcl.tk/man/tcl8.3/TkCmd/messageBox.htm#M5
but C++/Tk uses a bit different symbols like -messagetype instead of -type.
Second, I didn't check C++/Tk docs where is some example of tk_messageBox() usage.
message box displays correctly, so it works.
exmaple in C++/Tk docs:
(http://cpptk.sourceforge.net/doc.html#commands)
There is following sample command presented:
k_messageBox() -defaultbutton("OK") -icon(question) -messagetext("some text") -messagetype(okcancel);
But it causes error with message:
bad -default value "OK": must be abort, retry, ignore, ok, cancel, no, or yes
So, "OK" symbolic name of default button should be given in lower-case (as in my first command above):
-defaultbutton("ok") but that's obviously a small typo.
So, I'm back to C++/Tk having huge fan!
Cheers
Mateusz Loskot
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, there is the messagetype option instead of type, because is a more general "token" (it is a command of the canvas object) and there would be a naming conflict (if you dig deep enough, you will see that type and messagetype have *slightly* different behaviour).
And yes, there was a typo in the example. The names given to defaultbutton should be lowercase. It's already corrected.
Thanks for spotting this out! :)
Maciej
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
How should I use tk_messageBox() function to display simple info dialog box with title + message + one button?
As I read Tk reference using this function should be
straightforward:
http://www.tcl.tk/man/tcl8.3/TkCmd/messageBox.htm
I suppose its implementation in C++/Tk is not completed. It only displays blank dialog box:
Expr Tk::tk_messageBox()
{
return Expr("tk_messageBox");
}
So, how should I play with tk_messageBox() ?
Thanks in advance
Mateusz Loskot
Stupid me!
Excuse me, but I did a few mistakes.
Frist, I checked only Tk docs on
http://www.tcl.tk/man/tcl8.3/TkCmd/messageBox.htm#M5
but C++/Tk uses a bit different symbols like -messagetype instead of -type.
Second, I didn't check C++/Tk docs where is some example of tk_messageBox() usage.
So, using command like:
Tk::tk_messageBox() -defaultbutton("ok") -icon(Tk::info) -title("Test") -messagetype(ok) -messagetext("some text");
message box displays correctly, so it works.
exmaple in C++/Tk docs:
(http://cpptk.sourceforge.net/doc.html#commands)
There is following sample command presented:
k_messageBox() -defaultbutton("OK") -icon(question) -messagetext("some text") -messagetype(okcancel);
But it causes error with message:
bad -default value "OK": must be abort, retry, ignore, ok, cancel, no, or yes
So, "OK" symbolic name of default button should be given in lower-case (as in my first command above):
-defaultbutton("ok") but that's obviously a small typo.
So, I'm back to C++/Tk having huge fan!
Cheers
Mateusz Loskot
Yes, there is the messagetype option instead of type, because is a more general "token" (it is a command of the canvas object) and there would be a naming conflict (if you dig deep enough, you will see that type and messagetype have *slightly* different behaviour).
And yes, there was a typo in the example. The names given to defaultbutton should be lowercase. It's already corrected.
Thanks for spotting this out! :)
Maciej
Hi,
> Yes, there is the messagetype option
> instead of type, because is a more general "token"
This seems to be a good reason for using messagetype :-)
Mateusz