Hello Mr. Spier, <br><br>I ran into this issue recently-are you using
racket on Windows out of curiosity? In short, I think you need to set
auto-resize to #t explicitly upon init'ing your message. <br><br>I submitted problem report 12714 to track this. <br>
<br>#|Setting up the first frame and parent.|#<br>(define parent1 (new frame% <br> [label "Parent1"]<br> [width 200]<br> [height 200]<br>
[enabled #t]))<br><br>#|Not working -
messages sent to this frame appear to truncate past the first digit.
Adjusting the label below to a string longer than the string sent to the
messages% set-label method avoids the issue as well.|#<br>
<br>(define x-pos (new message% <br> [parent parent1]<br> [label "0"]))<br><br>#|This variant of x-pos works, resizing with new set-label requests and thus avoiding the truncation. |#<br>
#;(define x-pos (new message% <br> [parent parent1]<br> [label "0"]#|Setting the label to say, "Long label!" avoids the behavior as well.|#<br> [auto-resize #t]))<br>
<br>(send parent1 show #t)<br><br>#|The second frame*pos combo-|#<br>(define parent2 (new frame% <br> [label "Parent2"]<br> [width 200]<br> [height 200]<br>
[enabled #t]))<br><br>#|Here comes the
canvas subclass-I'm looking to override on-event method to grab the
x-component of the mouse pos, and I want to have that constantly
updating the x-pos message%. |#<br>
(define my-canvas% (class canvas%<br> <br> (inherit get-dc)<br> <br> (define/override (on-event mouse-event)<br> (define x (send mouse-event get-x))<br> (send x-pos set-label (number->string x)))<br>
(super-new)))<br><br>(define canvas (new my-canvas% [parent parent2]<br> [label "Nothing yet."])) <div id=":wk"> <br><br>(send parent2 show #t)</div><br><br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote">
On 20 April 2012 10:30, Harry Spier <span dir="ltr"><<a href="mailto:vasishtha.spier@gmail.com" target="_blank">vasishtha.spier@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've created a simple message-box. It expands in width to display the<br>
message, but if the title is longer than the message, then the title<br>
is cut-off. Is there any way to have the message-box expand enough to<br>
display the title in that case.<br>
<br>
Thanks,<br>
Harry Spier<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>