Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Issues on focus with composites and their child widgets  RSS feed

Jack Wanes
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys:

I have been trying this for days and cannot figure out how I can achieve what I want. I have two composites, every one of them has a button inside.

What I want to do is: when user switches from one button to another, I want to detect focus events concerning their parent composites, so I can can take appropriate actions.

The problem is: once I click on button1 in composite1, composite1 gains focus and then lost it, and button1 gains focus. This is good, at least composite1 can detect focus events. Now if I click on button2 in composite2, button1 lost focus, button2 gains focus, composite2 cannot detect any focus events. After this, neither of composites can detect focus events. How can I make composites instead of their child widgets detect their focus events?


Here is a sample printout:
composite1 focusGained
composite1 focusLost
testButton1 focusGained
testButton1 focusLost
testButton2 focusGained

Here is the sample test program:

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!