[Gambas-user] Could someone give me a brief explanation of parents and kids in this example
Jb Skaggs
jbskaggs42 at ...626...
Wed May 14 22:27:33 CEST 2014
So a child is a subcategory of a parent in treeview then?
On Wed, May 14, 2014 at 11:35 AM, Rolf-Werner Eilert
<eilert-sprachen at ...221...> wrote:
>
>
> Am 14.05.2014 17:57, schrieb Jb Skaggs:
>> In the treeview example I would like to understand the parent and kids aspects:
>>
>> Public Sub Button1_Click()
>>
>> Dim sIcon As String
>> Dim sParent As String
>>
>> If Textbox1.Text <> Null Then
>> If RadioButton1.Value Then
>> sIcon = "Male.png"
>> Else
>> sIcon = "Female.png"
>> End If
>> 'Gets the parent item: the current item, or nothing is the treeview is void
>> sParent = TreeView1.Key
>> 'Now we will add a new entry with a key and a name of what was in
>> the text box
>> 'We will place it as a child of the currently selected entry
>> TreeView1.Add(Textbox1.Text, Textbox1.Text, Picture[sIcon],
>> sParent).EnsureVisible
>> TreeView1.Item.EnsureVisible 'This will make sure that the item we
>> just added to the list is in the visable area of the control.
>> (Scrolling if necessary)
>> TextBox1.Text = "" 'This empties out textbox
>> RefreshInfo ' This will update our label and reflect the new number of kids
>> End If
>> End
>>
>>
>> My understanding was that a kid or child was a copy or instant of the
>> parent but I don't know if this is true in Gambas- so I would like to
>> understand what actually happens when something is a parent and child.
>> Thank you. Jb Skaggs
>>
>
>
> Errr - this is the TreeView, not inheriting (OOP):
>
> Parent1
> |--Child1 to Parent1
> |--Child2 to Parent1
> Parent2
> |--Child1 to Parent2
> |--Child1 to (Child1 to Parent2)*
> |--Child2 to Parent2
>
> * = Parent to it
>
> Or did I get you completely wrong? ;)
>
> Regards
> Rolf
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list