Class Inscription
- All Implemented Interfaces:
Accessible,AccessibleText,Buildable,ConstraintTarget,Proxy
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 org.gnome.gtk.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 org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.Accessible$Impl, Accessible.AccessibleInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.AccessibleText
AccessibleText.AccessibleText$Impl, AccessibleText.AccessibleTextInterfaceNested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.Buildable$Impl, Buildable.BuildableIfaceNested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTarget$Impl, ConstraintTarget.ConstraintTargetInterface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Inscription.Inscription(@Nullable String text) Creates a newGtkInscriptionwith the given text.Inscription(MemorySegment address) Create a Inscription proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected InscriptionasParent()Returns 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.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 classReturns 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 org.gnome.gtk.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, getMemoryLayout, 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 org.gnome.gobject.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 org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateStateMethods inherited from interface org.gnome.gtk.AccessibleText
updateCaretPosition, updateContents, updateSelectionBoundMethods inherited from interface org.gnome.gtk.Buildable
getBuildableId
-
Constructor Details
-
Inscription
Create a Inscription proxy 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()Creates a new Inscription.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getAttributes
Gets the inscription's attribute list.- Returns:
- the attribute list
- Since:
- 4.8
-
getMinChars
public int getMinChars()Gets themin-charsof the inscription.See the
Gtk.Inscription:min-charsproperty.- Returns:
- the min-chars property
- Since:
- 4.8
-
getMinLines
public int getMinLines()Gets themin-linesof the inscription.See the
Gtk.Inscription:min-linesproperty.- Returns:
- the min-lines property
- Since:
- 4.8
-
getNatChars
public int getNatChars()Gets thenat-charsof the inscription.See the
Gtk.Inscription:nat-charsproperty.- Returns:
- the nat-chars property
- Since:
- 4.8
-
getNatLines
public int getNatLines()Gets thenat-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 thexalignof the inscription.See the
Gtk.Inscription:xalignproperty.- Returns:
- the xalign property
- Since:
- 4.8
-
getYalign
public float getYalign()Gets theyalignof 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 themin-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 themin-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 thenat-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 thenat-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 thexalignof 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 theyalignof 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
-