I have spent most of the day getting my brain around this and think I have netted it down to the attached zip.
If you:
(1) compile the code in debug mode WITH A BREAKPOINT AT THE INDICATED LINE IN LAST MODULE
(2) F8 until a red button appears on phone
(3) tap the red button
(4) F8 repeatedly
everything works as you would expect - you end up with CLICK in the log.
If you delete the Bug icon on the phone (DO NOT SKIP THIS STEP) and then repeat the exercise with no breakpoints - when you tap on the red button nothing happens.
This is the primary module:
Which creates an instance of this class:
Which in turn creates an instance of this class:
This is a real showstopper for me - any help appreciated...
If you:
(1) compile the code in debug mode WITH A BREAKPOINT AT THE INDICATED LINE IN LAST MODULE
(2) F8 until a red button appears on phone
(3) tap the red button
(4) F8 repeatedly
everything works as you would expect - you end up with CLICK in the log.
If you delete the Bug icon on the phone (DO NOT SKIP THIS STEP) and then repeat the exercise with no breakpoints - when you tap on the red button nothing happens.
This is the primary module:
B4X:
#Region Project Attributes
#ApplicationLabel: Bug
#Version: 1.0
'This will allow running on iPhones (a la naturale) and iPads (in "iPhone" mode)
#Target: iPhone
'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
#iPhoneOrientations: Portrait
#iPadOrientations: Portrait
#End Region
Private Sub Process_Globals
Public App As Application
Public NavControl As NavigationController
Public Page1 As Page
End Sub
Private Sub Application_Start(Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
NavControl.ShowPage(Page1)
End Sub
Private Sub Page1_Resize(Width As Float, Height As Float)
Page1.RootPanel.Color = Colors.White
Private wrk_dialog As XDialog
wrk_dialog.Initialize(Me, Page1.RootPanel)
End Sub
Public Sub garbage_Click
Log("CLICK")
End Sub
Which creates an instance of this class:
B4X:
Private Sub Class_Globals
End Sub
Public Sub Initialize(in_host_parent1 As Object, in_host_panel1 As Panel)
Private wrk_button As XSingleButton
wrk_button.Initialize(in_host_parent1, in_host_panel1)
End Sub
Which in turn creates an instance of this class:
B4X:
Private Sub Class_Globals
Private host_parent2 As Object
Private host_panel2 As Panel
End Sub
Public Sub Initialize(in_host_parent2 As Object, in_host_panel2 As Panel)
Private singlebutton As Button
host_parent2 = in_host_parent2 '<<<<<<<<<<<<< put breakpoint on this line BEFORE compiling
host_panel2 = in_host_panel2
singlebutton.Initialize("Event_Button", singlebutton.STYLE_SYSTEM)
host_panel2.AddView(singlebutton, host_panel2.Width/4, host_panel2.Height/4,host_panel2.Width/2, host_panel2.Height/2)
singlebutton.Color = Colors.Red
End Sub
Private Sub Event_Button_Click
If SubExists(host_parent2, "garbage_Click", 0) Then
CallSub(host_parent2, "garbage_Click")
End If
End Sub
This is a real showstopper for me - any help appreciated...
Attachments
Last edited: