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

Re: <text-field>, size, GDI context...



Chris Double wrote:
> 
> I think you probably want to specialize do-compose-space for your
> gadget...
> 
> The bad news is that do-compose-space is sealed on the various
> <text-editor> subclasses for the Win32 backend...

Worse than that, I can't even figure out how to usably subclass them!
Subclassing <text-field> does not work, as it is not a subclass of
<sheet> and does not have the needed behavior. And I can't figure out
how to subclass <win32-text-field>. I use every library and module I can
find, yet <win32-text-field> is always an undefined binding when I try
to:

define class <my-text-field> (<win32-text-field>)
...

> Another option is to handle the <frame-mapped-event> for your
> frame. From here your controls have been created and you can do
> whatever you like...

This "works" in the sense that the GDI exists and I can calculate size
and set the size of a widget successfully. But there are 2 problems.
First, the text fields have already been displayed, so you get a "blink"
effect. Second, and worse, the layouts were calculated before this
point, so the new widths do not fit. And calling layout-frame just
reverts the sizes back!

> I think it may be difficult to get the functionality you want by
> subclassing existing DUIM classes - most of the generics that you
> would want to override seem to be sealed. I'd love to be corrected on
> this one.

That sux ;-) I'd rather not drop to the Win32 API and do my own!

> Note to Functional Objects, is there any consideration to changing some
> of these protocols for the win32-* classes to be open? Is there much
> of a performance/size impact?

Another note, developers really need sources to ALL libraries for just
these kinds of reasons. Dylan offers the ability to define libraries
such that we should really not need source, but only in theory. In
reality performance decisions, too-fat methods (and flat-out mistakes)
often result in a situation where we can't cleanly subclass to the
functionality we want. The only 2 ways to work around this are to
recreate entire classes from scratch, or tweak the originals to allow
more flexibility.



Follow-Ups: References: