Hi;
I'm new to both Ltk and to this list. I'm working on a prototype application which includes a text widget which I'd like to be able to scroll. It looks like the "scrolled-text" widget should work, but it doesn't behave the same as other widget with regards to various parameters. Here is an example that demonstrates:
(with-ltk () (let* ((textframe (make-instance 'frame)) (textbox (make-instance 'scrolled-text :master textframe))) ;; (textbox (make-instance 'text :master textframe)))
(configure textbox :width 20 :height 30 :background :white) (pack textbox :expand t :fill :both) (pack textframe :expand t :fill :both)))
If you evaluate this with the 'text widget (commented out above) it is initially sized as specified in the configure and has the white background I want.
But if you evaluate it with the 'scrolled-text widget, the size seems to be determined arbitrarily, and the background remains gray. Actually, the tiny lower-right box where the scrollbars don't quite meet turns white, so it's doing something.
Is there a way to get a scrolled-text box with a white background and specified size?
I did google the mailing list without finding any previous discussion of this. Any advice would be appreciated.
--Jeff
Hi Jeff,
the problem lies in the fact that the scrolled-text is only a container around the contained textbox widget. So for configuration, you need to configure that widget rather than the scrolled-textbox. You can access it via its textbox slot. So I would write something like: (let* ((textframe (make-instance 'frame)) (textbox (make-instance 'scrolled-text :master textframe)) (text (textbox textbox)))
(configure text :width 20 :height 30 :background :white)
once you got the scrolled-text widget packet, you are really only interested in its contained textbox.
HTH, Peter