S skipsy Member Licensed User Longtime User Sep 30, 2012 #1 Hello, Does anyone know what's wrong with this : I have a layout called "Controles" In this layout, I have a panel called "PNL_Controles" this code : Code: Dim PNL_CONTROLES As Panel PNL_CONTROLES.Initialize("") PNL_CONTROLES.LoadLayout("Controles") Activity.AddView(PNL_CONTROLES,0,0,100%x,100%y) Returns error : "The specified child already has a parent.You must call RemoveView() on the child's parent first" on line Activity.AddView. If I try changing the name of the panel : Code: Dim PNL_CONT As Panel PNL_CONT.Initialize("") PNL_CONT.LoadLayout("Controles") Activity.AddView(PNL_CONT,0,0,100%x,100%y) It does nothing... In debugging mode, I can see that PNL_CONT returns "Layout not available)" What did I misunderstood ?????? Thks a lot, WW
Hello, Does anyone know what's wrong with this : I have a layout called "Controles" In this layout, I have a panel called "PNL_Controles" this code : Code: Dim PNL_CONTROLES As Panel PNL_CONTROLES.Initialize("") PNL_CONTROLES.LoadLayout("Controles") Activity.AddView(PNL_CONTROLES,0,0,100%x,100%y) Returns error : "The specified child already has a parent.You must call RemoveView() on the child's parent first" on line Activity.AddView. If I try changing the name of the panel : Code: Dim PNL_CONT As Panel PNL_CONT.Initialize("") PNL_CONT.LoadLayout("Controles") Activity.AddView(PNL_CONT,0,0,100%x,100%y) It does nothing... In debugging mode, I can see that PNL_CONT returns "Layout not available)" What did I misunderstood ?????? Thks a lot, WW
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2012 #2 Make sure that your layout file doesn't include a view named pnl_controls. Upvote 0
S skipsy Member Licensed User Longtime User Sep 30, 2012 #3 Yes I have a panel called PNL_CONTROLES in the layout . I have tried to change its name. In this case Code: PNL_CONTROLES.LoadLayout("Controles") returns "(BALayout):Layout not avalaible" from the debugger. :BangHead: Upvote 0
Yes I have a panel called PNL_CONTROLES in the layout . I have tried to change its name. In this case Code: PNL_CONTROLES.LoadLayout("Controles") returns "(BALayout):Layout not avalaible" from the debugger. :BangHead:
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2012 #4 If the layout includes this panel then you should call: Activity.LoadLayout. If you want to load the layout to a different panel then you should initialize the panel yourself, add to the activity and then call Panel.LoadLayout. Upvote 0
If the layout includes this panel then you should call: Activity.LoadLayout. If you want to load the layout to a different panel then you should initialize the panel yourself, add to the activity and then call Panel.LoadLayout.
S skipsy Member Licensed User Longtime User Sep 30, 2012 #5 Hi understand !!! I mixed up the panel I declare myself in the code and the one created inside the layout. :sign0148: Thk you WW Upvote 0
Hi understand !!! I mixed up the panel I declare myself in the code and the one created inside the layout. :sign0148: Thk you WW