[Gambas-user] Draw units

ron ronstk at ...239...
Wed Sep 15 13:59:13 CEST 2004


On Wednesday 15 September 2004 12:38, Hugh Foster wrote:
> Hello, list, and my apologies for the likely long list of hoary old
> questions I will probably be asking here :)
>  
> Two to kick off with
>  
> What units is the Draw command working in please?
General Gambas works only with pixels for x,y,widht,height etc.
Twips as in VB does not exist anyway.
So pixels should be the answer.

Points (Fonts) should be also in pixels now but some have
problems with it. 

>  
> In VB i used list1.itemdata(n) and list1.selected(n) (or .listindex) a lot
> to manipulate items chosen in lists and combos. Is there a GAMBAS
> equivalent?
> 

VB: list1.listindex
GB: ListBox1.key
  The big difference is for GB using a Key as string instead VB a number as long


VB: list1.itemdata(n)
GB: ListBox1
  does not exist the same way
  see the gb.qt.ListBox.Add method in help
  Note: A alternative method is during add to the listbox 
  also add the itemdata to a collection with the same key
  and use that to get it back.

  private LB1data as Collection in head.
  listbox1.add(key,text)
  LBdata.Add(data,key) 
  data = LBdata(key)

VB: list1.selected(n)
GB: ListBox1[key].Selected
  If list1[key].Selected THEN ...

>  
> I love this program! Fifteen years' VB programming and now I can take it
> with me Penguin-wards :)

Welcome in the wonderfull world of GNU/Linux/Gambas
You must forget the VB habits.
Basic idea is the same but be carefull not all the controls
are/behave the same as in VB.
i.e. VB:TreeView and VB:ListView are in GB:ColumnView





More information about the User mailing list