[Gambas-user] ComboBox Error when ComboBox.Remove("1") / possible bug in gb.gtk?

Nicolas Koch nkoch22 at ...626...
Thu Nov 27 00:37:36 CET 2008


Hello Gambas Users,

Ok an interesting problem I've noticed in gb.gtk or with gb.gui.  If
you have a ComboBox with items in it and you try to hide one of the
items from listing invoking ComboBox1.Remove("1") you'll get this
error.

(test 26729): Gtk-WARNING **: gtktreemodel.c:429: Negative numbers in
path -1 passed to gtk_tree_path_new_from_string

The reason why I am trying to hide the hidden folders beginning with .
but show the non hidden folders in the ComboBox1

Although the console spits out this error it does what it is supposed
to and removes the hidden folder.

There is no error on gb.QT and works with the same code.

Without ComboBox1.Remove("1") the error disappears and shows hidden
folders like the following

.data
save
pictures
tmp

With ComboBox1.Remove("1") the error shows, but works

save
pictures
tmp

Here is the code:

PUBLIC $DIR AS String
PUBLIC sPath AS String
'PRIVATE SHOW_HIDDEN_FILES AS Boolean

PUBLIC SUB sPath($FILE AS String)
  sPath = "~/src/test"

  ComboBox11.Clear
  FOR EACH $DIR IN Dir(sPath, "*")
    ComboBox1.Add($DIR)
  NEXT
  ComboBox1.Remove("1")

END


Is there a better way of doing this?

Thanks in advance,

Nick




More information about the User mailing list