Discussion:
[Java-gnome-developer] gtk_combo_box_set_entry_text_column??
Hector Miuler Malpica Gallegos
2012-07-02 03:40:19 UTC
Permalink
I'm making an example with java-gnome, but I have a problem,

how I can do to setting column?

gtk_combo_box_set_entry_text_column() ??
(
http://developer.gnome.org/gtk3/stable/GtkComboBox.html#gtk-combo-box-set-entry-text-column
)



(Example in *Scala*)
(
https://bitbucket.org/Miuler/miuler-blacknote/src/f1c6e770c3b1/src/main/scala/com/miuler/blacknote/BlackNote.scala#cl-67
)

private def initComboBox() {
val hBox = new HBox(false, 20)
hBox.setBorderWidth(5)
hBox.add(new Label("Buscar :"))
vBox.add(hBox)
add(vBox)

// ------------------------------------------------------------------------
val firstColumnString = new DataColumnString()
val secondsColumnString = new DataColumnString()
val arrayColumns = Array[DataColumn](firstColumnString, secondsColumnString)
val model = new ListStore(arrayColumns)
val comboBox = new ComboBox(model, new Entry())
hBox.add(comboBox)
// ------------------------------------------------------------------------
val cellRendererText = new CellRendererText(comboBox)
cellRendererText.setText(firstColumnString)
val cellRendererText2 = new CellRendererText(comboBox)
cellRendererText2.setText(secondsColumnString)
// ------------------------------------------------------------------------
var row = model.appendRow()
model.setValue(row, firstColumnString, "Hector")
model.setValue(row, secondsColumnString, "Miuler")
row = model.appendRow()
model.setValue(row, firstColumnString, "Hector2")
model.setValue(row, secondsColumnString, "Miuler2")

}





*

Hector Miuler Malpica Gallegos <http://www.miuler.com>
*
*
*
Andrew Cowie
2012-07-02 05:26:12 UTC
Permalink
Post by Hector Miuler Malpica Gallegos
how I can do to setting column?
Can you show us the Java code you tried?

The documentation of both ComboBox and ComboBoxText might help you
along. Also, the screenshots there are generated by code in the
java-gnome source tree; you could try looking in
tests/screenshot/org/gnome/gtk/SnapshotComboBox* for further ideas.

http://java-gnome.sourceforge.net/doc/api/4.1/org/gnome/gtk/ComboBox.html
http://java-gnome.sourceforge.net/doc/api/4.1/org/gnome/gtk/ComboBoxText.html

AfC
Sydney

Loading...