[Cuis-dev] UI Bug - Incorrect dialog width in StringRequestMorph

Matías Lang spam at matiaslang.me
Mon Apr 28 12:34:24 PDT 2025


Hey folks,

I've noticed an annoying bug that occurs when the user edits a
definition in the class browser, with a resulting source code
referencing an invalid class name. If the user decides to define a new
class, the widget asking the user for the code of the new class is
smaller than it should be (see the attached screenshot demonstrating the
problem). This dialog can't be easily resized, so working with it can
become cumbersome.

This dialog width problem can be replicated by running the following
code:

text := 'Object subclass: #SomeClass
		instanceVariableNames:
		classVariableNames:
		poolDictionaries:
		category: Testing'.
		
StringRequestMorph request: 'title' initialAnswer: text do: []

The problem seems to be caused by the following line:

extraWidth := (6 * FontFamily defaultPointSize). "Some extra room for 
edition plus accept/cancel buttons." ].

in the StringRequestMorph -> setQuery:initialAnswer: method.

Changing the hardcoded constant from 6 to 10, which is the same value
used for single line strings, seems to fix this issue.

Hope this can be fixed, either by changing the constant as I did, or by
using some other technique.

Greetings,
Matías
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.png
Type: image/png
Size: 46079 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250428/70847576/attachment-0001.png>


More information about the Cuis-dev mailing list