@set
Description:
Changes the data for the item pointed to by iter
to be data
.
If the sequence has a data destroy function associated with it, that function is called on the existing data that iter
pointed
to.
Example: Set the item at the specified position:
public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
seq.append ("Lorem");
seq.append ("ipsum");
seq.append ("XXXXX");
seq.append ("sit");
seq.append ("amet");
SequenceIter<string> iter = seq.get_iter_at_pos (2);
iter.set ("dolor");
// Output:
// ``Lorem``
// ``ipsum``
// ``dolor``
// ``sit``
// ``amet``
seq.foreach ((item) => {
print ("%s\n", item);
});
return 0;
}
valac --pkg glib-2.0 GLib.SequenceIter.set.vala
Parameters:
data |
new data for the item |
iter |