----boundary-LibPST-iamunique-489011397_-_-
Content-type: text/plain
Rene,
Containers.Controller.Resize requests the controller of a container view to
resize a contained view. The interface documentation says that the view
provided as the first argument must be embedded in the controller's model.
In your program this is obviously not the case since you are passing the
container view itself as the first argument. TRAP 22 signals this
precondition violation.
In general, a better way to change a given view's size is the method
Models.Context.SetSize. This procedure requests the container to adapt the
size of the view to the given width and height. In your example this would
result in a call like the following one:
v.context.SetSize(200 * Ports.mm, 200 * Ports.mm)
Note however that the container may or may not grant this request. In our
case where a text view is opened via Views.OpenView in its own window this
request will not be fulfilled. The reason for this is that documents are by
default adjusted to the surrounding window. So the question arises whether
you actually want to change the document's size or the size of the window.
Can you describe your problem at hand in a little more detail?
All these questions are somewhat at the bounds of what can and should be
controlled in BlackBox through the documented parts of the framework. So
please understand, that it is much easier for us to answer specific
questions. Maybe you will also find some background information on these
topics in chapter 2 "Compound Documents" of the BlackBox online
documentation.
Cheers,
Marc
Oberon microsystems, Inc.
-----Original Message-----
From: Rene Dorta [mailto:rene{([at]})nowhere.xy
Sent: Freitag, 25. April 2003 23:11
To: BlackBox
Subject: Resizing a View
MODULE Resize; (* ...got an (undocumented) TRAP 22 when trying to resize
textview "v".
... I am not willing to use HandlePropMsg for that!, because I am not
extending Views.View *)
IMPORT Views, TextViews, TextModels, Ports;
VAR v: TextViews.View;
PROCEDURE Open*;
BEGIN
v:= TextViews.dir.New (TextModels.dir.New());
Views.OpenView (v)
END Open;
PROCEDURE Resize*;
BEGIN
v.ThisController().Resize (v, 0, 0, 200*Ports.mm, 200*Ports.mm)
END Resize;
END Resize. (!)Resize.Open (!)Resize.Resize
Cheers,
Rene Dorta. Universidad de Carabobo. Valencia. Venezuela.
-------------------------------------------- To unsubscribe from this
mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
instructions on their usage, send a message containing the word "help" to
the above address. Send any problem reports or questions related to this
email list to the list owner at owner-blackbox{([at]})nowhere.xy
policy: a) To post you should use the same address by which you are
subscribed to the mailing list. That way, the list server will recognize you
as subscriber and forward your posting immediately, without creating any
overhead. b) If, for some reason, you cannot post from the address, by which
you are subscribed, your message will be moderated to avoid spam. Please
understand that moderation will often cause some delay, in particular over
weekends or holydays.
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-489011397_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFJlbmUsXHBhcg0KXHBhcg0KQ29udGFpbmVycy5D
b250cm9sbGVyLlJlc2l6ZSByZXF1ZXN0cyB0aGUgY29udHJvbGxlciBvZiBhIGNvbnRhaW5lciB2
aWV3IHRvXHBhcg0KcmVzaXplIGEgY29udGFpbmVkIHZpZXcuIFRoZSBpbnRlcmZhY2UgZG9jdW1l
bnRhdGlvbiBzYXlzIHRoYXQgdGhlIHZpZXdccG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