2012-11-28 35 views
0

說明在我xul文件啓用自動換行,我有一個簡單的方案:如何在網格(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實體帶來了文本很長的字符串。

我似乎無法得到任何形式的描述文字的wordwrap。

如果我將描述移出tabpanel,它將包裝正常。但如果它在tabpanel中,它會被截斷(截斷)。我試圖在網格沒有 tabpanel,但有同樣的問題。

如何在說明中獲得wordwrap?

+1

我猜,這顯然這裏explainned:HTTPS://developer.mozilla.org/en-US/docs/XUL/description – linguini

+0

好,它*幾乎*清楚。我已經多次重讀該頁面。如果描述包裝不在包裝盒內,則描述包裝可以正常工作。它從來沒有明確說過,如果你把它放在一個「盒子」中,除非你指定了一個寬度,否則它將不會被包裹。 – bgmCoder

回答

0

那麼,一種解決方案是在css中爲<description>標記添加一個width屬性。

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 ////

+0

謝謝你,linguini。 – bgmCoder