如何在网格中的描述启用Wordwrap(XUL)

时间:2012-11-28 22:48:46

标签: firefox-addon xul dtd

在我的xul文件中,我有一个简单的方案:

<tabpanel>
    <vbox>
        <description>&spat.options.label.text;</description>
        <grid>
            <columns>
                <column/>
                <column flex="2"/>
            </columns>
            <rows>              
                <row>
                    <label.../>
                </row>
            </rows>
        </grid>
    </vbox>
</tabpanel>

dtd实体带来了很长的文本字符串。

我似乎无法对说明中的文字进行任何类型的文字包装。

如果我将描述移出tabpanel,它会很好地包装。但如果它在tabpanel中,它会被截断(截断)。我在网格中没有一个tabpanel尝试相同,但遇到了同样的问题。

如何在描述中获得文字包装?

2 个答案:

答案 0 :(得分:0)

好吧,一个解决方案是为css中的width标记添加<description>属性。

答案 1 :(得分:0)

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<box orient="{*horizontal | vertical}">
<description id="desc" style="width: 300px"></description>
<script type="application/x-javascript">
<![CDATA[
document.getElementById('desc').textContent = "This is a long section of dynamic message text that will word wrap";
]]>
</script>
</box>
</window>

enter image description here /// I don't want to claim this as a solution, just to give an exmaple,i have posted this ////