[Gambas-user] Phone center

Rob sourceforge-raindog2 at ...94...
Sun Feb 8 19:45:16 CET 2004


I tried to intersperse my code with your own, but it got hard to 
understand.  So here's what I'd do.

First off, unless I'm mistaken, there's no way to find out the 
name of a control on a form in Gambas at runtime, nor is there a 
way to determine that it's a textbox and not a button.  So you 
will have to use a different set of tags for your textboxes than 
you do for your buttons.  Let's say you use 0, 1, 2, 3 for your 
buttons and t0, t1, t2, t3 for your textboxes.  I'm assuming 
this is in the click event of the group of buttons whose 
captions you want assigned to their respective textboxes.

This is actual working code that I just tested in gambas 0.82.  I 
used j instead of i as an iterator because originally I still 
had your for i = 0 to 3 in there but it turned out to be 
unnecessary.

PUBLIC SUB mybuttons_Click()

  DIM j AS Object
  FOR EACH j IN ME.children
    IF j.tag = "t" & LAST.tag THEN j.text = LAST.text
  NEXT

END


Rob





More information about the User mailing list