rs.MessageBox title bug

Hi there,

is there a way to remove the “Rhino 8” text in the title of a rs.MessageBox ?

the code used in above image looks like this:

rc = rs.MessageBox("Message query text", 4+32, "Replace object ?")

imho it should not show if a user defines the title of the message box himself, or ?

thanks,
c.

Hi

import clr
clr.AddReference('System.Windows.Forms')
from System.Windows.Forms import MessageBox, MessageBoxButtons, MessageBoxIcon

result = MessageBox.Show(
    "Message query text",
    "Fruko",
    MessageBoxButtons.YesNo,
    MessageBoxIcon.Question
)

Rhinoscripsyntax forces the application name on top
Hope this helps,
Farouk

1 Like

This seems to be a step in the wrong direction.

thanks @clement for reporting,

RH-85103 Rhino 8 forces itself into the MessageBox title

thanks @Gijs for the YT item. Btw. i have nothing against the icon…it’s just the title text…

_
c.

I mentioned it because I think it should not be there.

Hi @Gijs, isn’t it better than having no icon at all ? Imho it makes rs.MessageBox (and other similar user interface dialogs in rs) look more professional by default, which is welcome as there is no overload to define a custom icon…at least yet.

thanks,
c.

@clement - the change is intentional. Perhaps we can provide a way of exposing some generic message box for scripters to use. Or, you could do this:

#! python3
import Rhino
import ctypes

##  Styles:
##  0 : OK
##  1 : OK | Cancel
##  2 : Abort | Retry | Ignore
##  3 : Yes | No | Cancel
##  4 : Yes | No
##  5 : Retry | Cancel 
##  6 : Cancel | Try Again | Continue
def MyMessageBox(title, text, style):
    hwnd = Rhino.RhinoApp.MainWindowHandle().ToInt32()
    return ctypes.windll.user32.MessageBoxW(hwnd, text, title, style)

MyMessageBox('Your title', 'Your text', 0)

– Dale

Thanks you @dale.

I’m confused now, isn’t rs.MessageBox exactly that ? I’ve been using it with IronPython and Python3 on Win and Mac in the past but the “Rhino 8” pre-text makes no sense to me. If a scripter wants to show this for his dialogs he can simply type it on his own, no ?

Since the title argument is optional, it would be logical if the “Rhino 8” text is used instead, when no title is provided. But if the title is defined with a custom text, i expected that it is actually used, without any prefix.

thanks,
c.

3 Likes