Commit d2aae157c8002cf0937a1fa38fb31a9d4b483f53
1 parent
b0038846
Fix builder.example to work with updated ItemView code.
Change-Id: Id2a566a93648690cd1a308302e0047149c8f2c31
Showing
1 changed file
with
7 additions
and
9 deletions
examples/builder/examples.cpp
| ... | ... | @@ -280,6 +280,9 @@ public: |
| 280 | 280 | { |
| 281 | 281 | Stage stage = Stage::GetCurrent(); |
| 282 | 282 | |
| 283 | + mTapDetector = TapGestureDetector::New(); | |
| 284 | + mTapDetector.DetectedSignal().Connect( this, &ExampleApp::OnTap ); | |
| 285 | + | |
| 283 | 286 | if( mItemView ) |
| 284 | 287 | { |
| 285 | 288 | stage.Remove( mItemView ); |
| ... | ... | @@ -361,15 +364,6 @@ public: |
| 361 | 364 | } |
| 362 | 365 | } |
| 363 | 366 | |
| 364 | - mTapDetector = TapGestureDetector::New(); | |
| 365 | - | |
| 366 | - for( unsigned int i = 0u; i < mItemView.GetChildCount(); ++i ) | |
| 367 | - { | |
| 368 | - mTapDetector.Attach( mItemView.GetChildAt(i) ); | |
| 369 | - } | |
| 370 | - | |
| 371 | - mTapDetector.DetectedSignal().Connect( this, &ExampleApp::OnTap ); | |
| 372 | - | |
| 373 | 367 | // Display item view on the stage |
| 374 | 368 | stage.Add( mItemView ); |
| 375 | 369 | |
| ... | ... | @@ -413,6 +407,10 @@ public: |
| 413 | 407 | t.SetText( fontString.str() ); |
| 414 | 408 | |
| 415 | 409 | t.SetTextAlignment( Alignment::HorizontalLeft ); |
| 410 | + | |
| 411 | + // Hook up tap detector | |
| 412 | + mTapDetector.Attach( t ); | |
| 413 | + | |
| 416 | 414 | return t; |
| 417 | 415 | } |
| 418 | 416 | ... | ... |