StringList

open class StringList(pointer: <Error class: unknown class><<Error class: unknown class>>) : Buildable

GtkStringList is a list model that wraps an array of strings.

The objects in the model are of type class@Gtk.StringObject and have a "string" property that can be used inside expressions.

GtkStringList is well-suited for any place where you would typically use a char*[], but need a list model.

GtkStringList as GtkBuildable

The GtkStringList implementation of the GtkBuildable interface supports adding items directly using the <items> element and specifying <item> elements for each item. Each <item> element supports the regular translation attributes “translatable”, “context” and “comments”.

Here is a UI definition fragment specifying a GtkStringList

<object class="GtkStringList">
<items>
<item translatable="yes">Factory</item>
<item translatable="yes">Home</item>
<item translatable="yes">Subway</item>
</items>
</object>

Skipped during bindings generation

  • method take: C function gtk_string_list_take is ignored

  • method item-type: Property has no getter nor setter

  • method n-items: Property has no getter nor setter

  • method strings: Property has no getter nor setter

Constructors

Link copied to clipboard
constructor(strings: List<String>? = null)

Creates a new GtkStringList with the given @strings.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val gioListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkStringListPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun append(string: String)

Appends @string to @self.

Link copied to clipboard
open fun getBuildableId(): String?

Gets the ID of the @buildable object.

Link copied to clipboard
open fun getString(position: <Error class: unknown class>): String?

Gets the string that is at @position in @self.

Link copied to clipboard
open fun remove(position: <Error class: unknown class>)

Removes the string at @position from @self.

Link copied to clipboard
open fun splice(position: <Error class: unknown class>, nRemovals: <Error class: unknown class>, additions: List<String>? = null)

Changes @self by removing @n_removals strings and adding @additions to it.