[racket] message-box too small to display title

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Apr 25 19:15:02 EDT 2012

Sorry that it's taken me so long to jump into this thread...

The `racket/gui' library indeed makes no effort to ensure that frames
are wide enough to display the frame's title, whether the frame is
created by instantiating `frame%' or `dialog%' or by calling
`message-box'.

I see that adding that functionality to `message-box' for Windows might
make sense, on the grounds that the Win32 MessageBox() function makes a
frame big enough to show the message-box title (up to a point). Along
similar lines, it would be good to modernize `message-box' for Mac OS X
and Gtk, which includes moving the title to the window content instead
of the title bar on those platforms. I'll add those changes to my to-do
list.


A related but different issue is whether `message%' instances are made
wide enough. They should be, and `auto-resize' mode even makes them
resize as needed when the message text is changed. But I don't think
that was the original question.


As for the big icon within the `message-box' dialog, that a common
convention, although you have to specify something like
MB_ICONEXCLAMATION for MessageBox() to enable it on Windows. The Racket
`message-box' dialog defaults to an application-specific icon, which I
guess is a Mac OS X convention, but you can override it with a 'caution
or 'stop style. There's no icon in the title bar for `message-box'
because it's a dialog, and Windows dialogs normally do not have an
title-bar icon.


At Wed, 25 Apr 2012 12:53:13 -0400, Harry Spier wrote:
> Its Windows Vista.
> 
> Also I don't know if this is also another bug.  When the message-box
> displays, the Racket logo displays not in the title bar but in the
> message area beside the text and it is about double the size as it
> appears in a top-level window frame title bar.
> 
>  (I haven't yet tried Patrick suggested solution of setting
> auto-resize to #t as I did a work around of increasing the message
> size to be longer than the title).
> Thanks,
> Harry
> 
> On Wed, Apr 25, 2012 at 12:01 PM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
> >
> > Strange. Works okay on my Mac. What platform?
> >
> >
> > On Apr 25, 2012, at 11:47 AM, Harry Spier wrote:
> >
> >> That displays OK
> >>
> >> but:
> >> #lang racket/gui
> >> (message-box "goodbye Fred" "hello world")
> >>
> >> displays the message box title as "goodby..." because the message box
> >> width is only wide enough to hold the message and the Racket logo
> >>
> >> Thanks,
> >> Harry
> >>
> >> On Wed, Apr 25, 2012 at 9:38 AM, Matthias Felleisen
> >> <matthias at ccs.neu.edu> wrote:
> >>>
> >>> Do you mean something like this:
> >>>
> >>>> #lang racket/gui
> >>>>
> >>>> (message-box "good bye" "hello world")
> >>>
> >>>
> >>>
> >>>
> >>> On Apr 20, 2012, at 10:30 AM, Harry Spier wrote:
> >>>
> >>>> I've created a simple message-box.  It expands in width to display the
> >>>> message, but if the title is longer than the message, then the title
> >>>> is cut-off.  Is there any way to have the message-box expand enough to
> >>>> display the title in that case.
> >>>>
> >>>> Thanks,
> >>>> Harry Spier
> >>>> ____________________
> >>>>  Racket Users list:
> >>>>  http://lists.racket-lang.org/users
> >>>
> >
> 
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.