Re: [xul-interop] Updating window title

"Christophe Charron" <[email protected]> Thu, 1 Mar 2007 19:27:41 +0100
Newsgroups gmane.comp.lang.xul.general
Message-ID <[email protected]>
--===============0432977736==
Content-Type: multipart/alternative; 
	boundary="----=_Part_75220_18509292.1172773661086"

------=_Part_75220_18509292.1172773661086
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

2007/3/1, Alexandre Giuseppe de Fuccio Pereira <[email protected]
>:
>
> Hi folks,
>
> I'm trying to build my first XUL application and I can't find how to
> update a window title.
>
> I've tried:
>
> document.title = "new title";
>
> element = document.getElementById ("window");
> element.title = "new title"
>
> How can I do that?



The following code works :
**********************
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" title="old title" xmlns="
http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="text/javascript">
<![CDATA[
function pf_change_title(){
var win=document.getElementById("yourwindow");
win.setAttribute("title","Here is the new title, yeah !!");

}
]]>
</script>
<label value="Put your XUL here!"/>
<button label="change window title" oncommand="pf_change_title();"/>
</window>
***************************


Thanks,
> -- Alexandre Giuseppe de Fuccio Pereira
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> XUL News Wire      - http://xulnews.com
> XUL Job Postings   - http://xuljobs.com
> Open XUL Alliance - http://xulalliance.org
> _______________________________________________
> xul-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xul-talk
>
>
-- 
Cordially,
Christophe Charron

------=_Part_75220_18509292.1172773661086
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,<br><br><div><span class="gmail_quote">2007/3/1, Alexandre Giuseppe de Fuccio Pereira &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi folks,<br><br>I&#39;m trying to build my first XUL application and I can&#39;t find how to update a window title. <br><br>I&#39;ve tried:<br><br>document.title = &quot;new title&quot;;<br><br>element = document.getElementById

(&quot;window&quot;); <br>element.title = &quot;new title&quot;<br><br>How can I do that?</blockquote><div><br><br>The following code works :<br>**********************<br>&lt;?xml version=&quot;1.0&quot;?&gt;<br>&lt;?xml-stylesheet href=&quot;chrome://global/skin/&quot; type=&quot;text/css&quot;?&gt;
<br>&lt;window id=&quot;yourwindow&quot; title=&quot;old title&quot; xmlns=&quot;<a href="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</a>&quot;&gt;
<br>&lt;script type=&quot;text/javascript&quot;&gt;<br>&lt;![CDATA[<br>function pf_change_title(){<br>var win=document.getElementById(&quot;yourwindow&quot;);<br>win.setAttribute(&quot;title&quot;,&quot;Here is the new title, yeah !!&quot;);
<br><br>}<br>]]&gt;<br>&lt;/script&gt;<br>&lt;label value=&quot;Put your XUL here!&quot;/&gt;<br>&lt;button label=&quot;change window title&quot; oncommand=&quot;pf_change_title();&quot;/&gt;<br>&lt;/window&gt;<br>***************************
<br>&nbsp;</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks,<br><span class="sg">-- Alexandre Giuseppe de Fuccio Pereira<br>
</span><br>-------------------------------------------------------------------------<br>Take Surveys. Earn Cash. Influence the Future of IT<br>Join SourceForge.net&#39;s Techsay panel and you&#39;ll get the chance to share your
<br>opinions on IT &amp; business topics through brief surveys-and earn cash<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV" target="_blank">
http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV</a><br>_______________________________________________<br>XUL News Wire &nbsp; &nbsp; &nbsp;- <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xulnews.com" target="_blank">
http://xulnews.com</a><br>XUL Job Postings &nbsp; - <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xuljobs.com" target="_blank">http://xuljobs.com</a><br>Open XUL Alliance - <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://xulalliance.org" target="_blank">
http://xulalliance.org</a><br>_______________________________________________<br>xul-talk mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:[email protected]">[email protected]
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.sourceforge.net/lists/listinfo/xul-talk" target="_blank">https://lists.sourceforge.net/lists/listinfo/xul-talk</a><br><br></blockquote>
</div><br>-- <br>Cordially,<br>Christophe Charron

------=_Part_75220_18509292.1172773661086--


--===============0432977736==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--===============0432977736==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
XUL News Wire      - http://xulnews.com
XUL Job Postings   - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org  
_______________________________________________
xul-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xul-talk

--===============0432977736==--