[Gambas-user] Problems compiling under RH9 (still)

Benoit Minisini gambas at ...2...
Fri May 9 11:48:32 CEST 2003


Le Vendredi 9 Mai 2003 01:27, Andrew Morrison a écrit :
> Benoit,
> 	So, what your telling me is that a listbox is something i shouldn't use
> well I'm a newbie at programming and just out of curiosity what exactly
> is a widget. Do you have anything on the site that could explain this to
> me maybe?  I figured a listbox would work cause it seems simple but now
> you got me thinking with this scroll view I'll try to modify my chat
> program a little bit so I don't need a listbox but do you have any
> web-sites that i could possibly learn about these widgets it would be
> much appreciated.
>
> Andrew
>

You have two ways of doing that in Gambas:

1) You can create what you do in a form, and use the form as any control in 
your code.

Let's suppose your form is named FMyListBox.

In your FMyChat main form, you do:

PRIVATE $hMyListBox AS FMyListBox

PUBLIC SUB _new()

  $hMyListBox = NEW FMyListBox(ME)
  $hMyListBox.Move(10, 10, 100, 100)

END

You have an example of that in the IDE source code: the FSelector form is used 
as a control in many other forms, like FOpenProject

2) You can create a class that manage your list box.

Let's suppose this class is named CMyListBox. Its code is:

PRIVATE $hScrollView AS ScrollView

PUBLIC SUB _new(hParent AS Container)

  $hScrollView = NEW ScrollView(hParent)
  ...

END

You have an example of that in the IDE source code: there is a class named 
CCoolButton that implements the buttons of the welcome dialog, those who 
become blue when the mouse is over them.

I can't help you more, except by writing the code for you :-)

Maybe anyone more advance than you could write an example of that ?

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list