Class Inscription
- All Implemented Interfaces:
Accessible, AccessibleText, Buildable, ConstraintTarget, Proxy
Shows text in a predefined area.
You likely want to use GtkLabel instead as this widget is intended only
for a small subset of use cases. The main scenario envisaged is inside lists
such as GtkColumnView.
While a GtkLabel sizes itself depending on the text that is displayed,
GtkInscription is given a size and inscribes the given text into that
space as well as it can.
Users of this widget should take care to plan behaviour for the common case where the text doesn't fit exactly in the allocated space.
CSS nodes
GtkInscription has a single CSS node with the name label.
- Since:
- 4.8
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInscription.Builder<B extends Inscription.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class Widget
Widget.DestroyCallback, Widget.DirectionChangedCallback, Widget.HideCallback, Widget.KeynavFailedCallback, Widget.MapCallback, Widget.MnemonicActivateCallback, Widget.MoveFocusCallback, Widget.QueryTooltipCallback, Widget.RealizeCallback, Widget.ShowCallback, Widget.StateFlagsChangedCallback, Widget.UnmapCallback, Widget.UnrealizeCallback, Widget.Widget$Impl, Widget.WidgetClassNested classes/interfaces inherited from class InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface AccessibleText
AccessibleText.AccessibleText$Impl, AccessibleText.AccessibleTextInterfaceNested classes/interfaces inherited from interface Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new Inscription.Inscription(@Nullable String text) Creates a newGtkInscriptionwith the given text.Inscription(MemorySegment address) Create a Inscription instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected InscriptionasParent()Return this instance as if it were its parent type.static Inscription.Builder<? extends Inscription.Builder> builder()AInscription.Builderobject constructs aInscriptionwith the specified properties.@Nullable AttrListGets the inscription's attribute list.static MemoryLayoutThe memory layout of the native struct.intGets themin-charsof the inscription.intGets themin-linesof the inscription.intGets thenat-charsof the inscription.intGets thenat-linesof the inscription.@Nullable StringgetText()Gets the text that is displayed.Gets the inscription's overflow method.static @Nullable TypegetType()Get the GType of the Inscription class.Returns line wrap mode used by the inscription.floatGets thexalignof the inscription.floatGets theyalignof the inscription.voidsetAttributes(@Nullable AttrList attrs) Apply attributes to the inscription text.voidUtility function to set the text and attributes to be displayed.voidsetMinChars(int minChars) Sets themin-charsof the inscription.voidsetMinLines(int minLines) Sets themin-linesof the inscription.voidsetNatChars(int natChars) Sets thenat-charsof the inscription.voidsetNatLines(int natLines) Sets thenat-linesof the inscription.voidSets the text to be displayed.voidsetTextOverflow(InscriptionOverflow overflow) Sets what to do when the text doesn't fit.voidsetWrapMode(WrapMode wrapMode) Controls how line wrapping is done.voidsetXalign(float xalign) Sets thexalignof the inscription.voidsetYalign(float yalign) Sets theyalignof the inscription.Methods inherited from class Widget
actionSetEnabled, activateActionIfExists, activateDefault, activateWidget, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, cssChanged, directionChanged, disposeTemplate, dragCheckThreshold, emitDestroy, emitDirectionChanged, emitHide, emitKeynavFailed, emitMap, emitMnemonicActivate, emitMoveFocus, emitQueryTooltip, emitRealize, emitShow, emitStateFlagsChanged, emitUnmap, emitUnrealize, errorBell, focus, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, moveFocus, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, pick, queryTooltip, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, root, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, sizeAllocate, snapshot, snapshotChild, stateFlagsChanged, systemSettingChanged, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unroot, unsetStateFlags, unsetStateFlagsMethods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Accessible
announce, getAccessibleId, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface AccessibleText
updateCaretPosition, updateContents, updateSelectionBoundMethods inherited from interface Buildable
getBuildableId
-
Constructor Details
-
Inscription
Create a Inscription instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Inscription
Creates a newGtkInscriptionwith the given text.- Parameters:
text- The text to display.- Since:
- 4.8
-
Inscription
public Inscription()Create a new Inscription.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
getAttributes
Gets the inscription's attribute list.- Returns:
- the attribute list
- Since:
- 4.8
-
getMinChars
public int getMinChars()Gets the
min-charsof the inscription.See the
Gtk.Inscription:min-charsproperty.- Returns:
- the min-chars property
- Since:
- 4.8
-
getMinLines
public int getMinLines()Gets the
min-linesof the inscription.See the
Gtk.Inscription:min-linesproperty.- Returns:
- the min-lines property
- Since:
- 4.8
-
getNatChars
public int getNatChars()Gets the
nat-charsof the inscription.See the
Gtk.Inscription:nat-charsproperty.- Returns:
- the nat-chars property
- Since:
- 4.8
-
getNatLines
public int getNatLines()Gets the
nat-linesof the inscription.See the
Gtk.Inscription:nat-linesproperty.- Returns:
- the nat-lines property
- Since:
- 4.8
-
getText
Gets the text that is displayed.- Returns:
- The displayed text
- Since:
- 4.8
-
getTextOverflow
Gets the inscription's overflow method.- Returns:
- the overflow method
- Since:
- 4.8
-
getWrapMode
Returns line wrap mode used by the inscription.
- Returns:
- the line wrap mode
- Since:
- 4.8
-
getXalign
public float getXalign()Gets the
xalignof the inscription.See the
Gtk.Inscription:xalignproperty.- Returns:
- the xalign property
- Since:
- 4.8
-
getYalign
public float getYalign()Gets the
yalignof the inscription.See the
Gtk.Inscription:yalignproperty.- Returns:
- the yalign property
- Since:
- 4.8
-
setAttributes
Apply attributes to the inscription text.
These attributes will not be evaluated for sizing the inscription.
- Parameters:
attrs- aPango.AttrList- Since:
- 4.8
-
setMarkup
Utility function to set the text and attributes to be displayed.
See the
Gtk.Inscription:markupproperty.- Parameters:
markup- The markup to display- Since:
- 4.8
-
setMinChars
public void setMinChars(int minChars) Sets the
min-charsof the inscription.See the
Gtk.Inscription:min-charsproperty.- Parameters:
minChars- the minimum number of characters that should fit, approximately- Since:
- 4.8
-
setMinLines
public void setMinLines(int minLines) Sets the
min-linesof the inscription.See the
Gtk.Inscription:min-linesproperty.- Parameters:
minLines- the minimum number of lines that should fit, approximately- Since:
- 4.8
-
setNatChars
public void setNatChars(int natChars) Sets the
nat-charsof the inscription.See the
Gtk.Inscription:nat-charsproperty.- Parameters:
natChars- the number of characters that should ideally fit, approximately- Since:
- 4.8
-
setNatLines
public void setNatLines(int natLines) Sets the
nat-linesof the inscription.See the
Gtk.Inscription:nat-linesproperty.- Parameters:
natLines- the number of lines that should ideally fit- Since:
- 4.8
-
setText
Sets the text to be displayed.- Parameters:
text- The text to display- Since:
- 4.8
-
setTextOverflow
Sets what to do when the text doesn't fit.- Parameters:
overflow- the overflow method to use- Since:
- 4.8
-
setWrapMode
Controls how line wrapping is done.- Parameters:
wrapMode- the line wrapping mode- Since:
- 4.8
-
setXalign
public void setXalign(float xalign) Sets the
xalignof the inscription.See the
Gtk.Inscription:xalignproperty.- Parameters:
xalign- the new xalign value, between 0 and 1- Since:
- 4.8
-
setYalign
public void setYalign(float yalign) Sets the
yalignof the inscription.See the
Gtk.Inscription:yalignproperty.- Parameters:
yalign- the new yalign value, between 0 and 1- Since:
- 4.8
-
builder
AInscription.Builderobject constructs aInscriptionwith the specified properties. Use the variousset...()methods to set properties, and finish construction withInscription.Builder.build().- Returns:
- the builder object
-