2

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?

The Student
  • 27,520
  • 68
  • 161
  • 264
  • I found the wikipedia link for XBL (http://en.wikipedia.org/wiki/XBL), but I'm a bit unclear what you're working on. Is this for a desktop application? I'm curious, thanks. – calvinf Sep 24 '10 at 20:33
  • @calvinf yes, it's a desktop app in Xul. – The Student Sep 24 '10 at 20:45
  • You might want to tag this as XUL. The XUL category has 315 posts vs. XBL which has 6. More likely to find somebody with an answer that way. – calvinf Sep 24 '10 at 20:56

1 Answers1

0

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.

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">
  <button label="Hello World" oncommand="alert('You pressed me')" style="max-width: 100px"/>
</window>
Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
tomdemuyt
  • 4,572
  • 2
  • 31
  • 60
  • 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. – The Student Oct 01 '10 at 19:06
  • IF this the default button, it should be focusable by default. – tomdemuyt Oct 03 '10 at 01:46
  • What are you trying to achieve with that binding ? Why would you not just use the regular button tag ? – tomdemuyt Oct 03 '10 at 01:46
  • 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.. – The Student Oct 04 '10 at 12:48
  • Added an example with a button. You can use 'style' to change the button anyway you want. – tomdemuyt Oct 08 '10 at 18:48