[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WidthHint (was Re: (Aucun))




In article <34340@sophia.inria.fr>, Jean-Michel.Hufflen@loria.fr (Jean-Michel Hufflen) writes:
=> That is, when they click the "Editor" button of the Centaur menu, I wish they
=> can obtain wider window.
=>    If I consult the "User Interface Manual" about the function "make-ctview", I
=> read:
=> 	The introduction of resources renders this function slightly obsolete,
=> 	since virtually all arguments may be determined from ctedit resources.

This is true especially for the resources regarding the formatting, i.e.,
page width and print level.  Also the mouse-event-list can be handled this way.

=>    OK. I look over the "Centaur Resource Manual" and put
=> 	Centaur.Editor.WidthHint: 550
=> in my ".centaur.rdb" file.  I was very disappointed: no effect.  In fact, it
=> seems to me that the only way to do that is to put:
=> 	({ctedit-parameters}:width {ctedit}:parameters 550)
=> in my ".centaur" file.  This solution works fine, but I consider that it is
=> somewhat dirty.

If you consider it only "somewhat dirty", you are very kind. :-)

Unfortunately, WidthHint falls through a nasty crack.  Looking at the Ctedit
manual (volume 3), you'll find that {ctedit}:create takes two arguments w and h
and using these, sets the WidthHint and HeightHint properties.  As you might
suspect, the make-ctview function somewhere along the line calls this function
after getting w and h values from the {ctedit}:parameters structure.  This is why
your solution works.  

=>    Is there a nice solution, when we wish to change the width of a window
=> (editor-view) which constains an editor.  In other words, how to change the
=> default property "WidthHint" for any editor?

Basically, the problem is one of backward compatibility where in going from 
centaur 1.1 to centaur 1.2, we had the {ctedit}:parameters and the resource 
system as possibly supplying default values.  We chose to take the values from
the resources when possible.  However, due to an old problem (about creating
ctedit's of size 0,0) and since the WidthHint was added as an afterthought for
a completely different problem ... well the code was written to take the default
from the parameters structure.  Arrrgh.  

This will, of course, be fixed in the next version.   Sorry about that.

	--janet bertot