Re: [Factor-talk] directly writing to pref-dim slot of gadget

2019-07-25 Thread Alexander Ilin
See the documentation for the `pref-dim` word.If you read/write the `pref-dim` slot for random gadgets, you will mess up the caching of the value and possibly the layout logic of the `ui.gadgets` vocab.It's OK to set the initial value if you don't want to override the `pref-dim*` method for that

Re: [Factor-talk] directly writing to pref-dim slot of gadget

2019-07-25 Thread John Benediktsson
It's probably to set the default / initial size of the gadget. Some gadgets do it by overriding the ``pref-dim*`` word like so: ./extra/tetris/tetris.factor:M: tetris-gadget pref-dim* drop { 200 400 } ; And a few do it by setting it like that... I think the ``pref-dim*`` approach was the

[Factor-talk] directly writing to pref-dim slot of gadget

2019-07-25 Thread Georg Simon
https://docs.factorcode.org/content/word-gadget,ui.gadgets.html says "pref-dim - a cached value for pref-dim; do not read or write this slot directly." But in extra/gesture-logger/gesture-logger.factor and extra/rosetta-code/animate-pendulum/animate-pendulum.factor I find { 450 500 } >>pref-dim