views:

68

answers:

1

When I extends this button in my XBL:

<binding id="myFancyButton" extends="chrome://global/content/bindings/button.xml#button">

how do I make it a focusable button?

A: 

As I am not sure what you have in your button.xml,

I can only really provide this link and ask you to make sure your button follows the guidelines here : https://wiki.mozilla.org/XUL:Focus_Behaviour

Especially the bit about the -moz-user-focus property is important.

T.

Edited : this is a simple hello world example, the button is focusable.

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="main" title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
  <button label="Hello World" oncommand="alert('You pressed me')" style="max-width: 100px"/>
</window>
tomdemuyt
The [button.xml](http://mxr.mozilla.org/mozilla/source/toolkit/content/widgets/button.xml) is built in. And *"The -moz-user-focus CSS property is obsolete and does nothing (or for compatibility, the value 'ignore' is treated as focusable='false' and the value 'normal' is treated as focusable='auto')"*. Still I tested, with no success.
Tom Brito
IF this the default button, it should be focusable by default.
tomdemuyt
What are you trying to achieve with that binding ? Why would you not just use the regular button tag ?
tomdemuyt
I'm just would like to understand the extends mechanism and how the button works. My button still has no focus capability, I may be doing something wrong..
Tom Brito
Added an example with a button. You can use 'style' to change the button anyway you want.
tomdemuyt