Class Inscription
- All Implemented Interfaces:
Proxy
,Accessible
,AccessibleText
,Buildable
,ConstraintTarget
GtkInscription
is a widget to show 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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inscription.Builder<B extends Inscription.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested 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.WidgetClass, Widget.WidgetImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gtk.Accessible
Accessible.AccessibleImpl, Accessible.AccessibleInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.AccessibleText
AccessibleText.AccessibleTextImpl, AccessibleText.AccessibleTextInterface
Nested classes/interfaces inherited from interface org.gnome.gtk.Buildable
Buildable.BuildableIface, Buildable.BuildableImpl
Nested classes/interfaces inherited from interface org.gnome.gtk.ConstraintTarget
ConstraintTarget.ConstraintTargetImpl, ConstraintTarget.ConstraintTargetInterface
-
Constructor Summary
ConstructorDescriptionCallsInscription(java.lang.String)
with text =null
Inscription
(@Nullable String text) Creates a newGtkInscription
with the given text.Inscription
(MemorySegment address) Create a Inscription proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected Inscription
asParent()
Returns this instance as if it were its parent type.static Inscription.Builder
<? extends Inscription.Builder> builder()
AInscription.Builder
object constructs aInscription
with the specified properties.Gets the inscription's attribute list.int
Gets themin-chars
of the inscription.int
Gets themin-lines
of the inscription.int
Gets thenat-chars
of the inscription.int
Gets thenat-lines
of the inscription.getText()
Gets the text that is displayed.Gets the inscription's overflow method.static Type
getType()
Get the GType of the Inscription classReturns line wrap mode used by the inscription.float
Gets thexalign
of the inscription.float
Gets theyalign
of the inscription.void
setAttributes
(@Nullable AttrList attrs) Apply attributes to the inscription text.void
Utility function to set the text and attributes to be displayed.void
setMinChars
(int minChars) Sets themin-chars
of the inscription.void
setMinLines
(int minLines) Sets themin-lines
of the inscription.void
setNatChars
(int natChars) Sets thenat-chars
of the inscription.void
setNatLines
(int natLines) Sets thenat-lines
of the inscription.void
Sets the text to be displayed.void
setTextOverflow
(InscriptionOverflow overflow) Sets what to do when the text doesn't fit.void
setWrapMode
(WrapMode wrapMode) Controls how line wrapping is done.void
setXalign
(float xalign) Sets thexalign
of the inscription.void
setYalign
(float yalign) Sets theyalign
of 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, 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, 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, unsetStateFlags
Methods 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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gtk.Accessible
announce, getAccessibleParent, getAccessibleRole, getAtContext, getBounds, getFirstAccessibleChild, getNextAccessibleSibling, getPlatformState, resetProperty, resetRelation, resetState, setAccessibleParent, updateNextAccessibleSibling, updateProperty, updateRelation, updateState
Methods inherited from interface org.gnome.gtk.AccessibleText
updateCaretPosition, updateContents, updateSelectionBound
Methods 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 newGtkInscription
with the given text.- Parameters:
text
- The text to display.
-
Inscription
public Inscription()CallsInscription(java.lang.String)
with text =null
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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
-
getMinChars
public int getMinChars()Gets themin-chars
of the inscription.See the
Gtk.Inscription:min-chars
property.- Returns:
- the min-chars property
-
getMinLines
public int getMinLines()Gets themin-lines
of the inscription.See the
Gtk.Inscription:min-lines
property.- Returns:
- the min-lines property
-
getNatChars
public int getNatChars()Gets thenat-chars
of the inscription.See the
Gtk.Inscription:nat-chars
property.- Returns:
- the nat-chars property
-
getNatLines
public int getNatLines()Gets thenat-lines
of the inscription.See the
Gtk.Inscription:nat-lines
property.- Returns:
- the nat-lines property
-
getText
-
getTextOverflow
Gets the inscription's overflow method.- Returns:
- the overflow method
-
getWrapMode
Returns line wrap mode used by the inscription.- Returns:
- the line wrap mode
-
getXalign
public float getXalign()Gets thexalign
of the inscription.See the
Gtk.Inscription:xalign
property.- Returns:
- the xalign property
-
getYalign
public float getYalign()Gets theyalign
of the inscription.See the
Gtk.Inscription:yalign
property.- Returns:
- the yalign property
-
setAttributes
Apply attributes to the inscription text.These attributes will not be evaluated for sizing the inscription.
- Parameters:
attrs
- aPango.AttrList
-
setMarkup
Utility function to set the text and attributes to be displayed.See the
Gtk.Inscription:markup
property.- Parameters:
markup
- The markup to display
-
setMinChars
public void setMinChars(int minChars) Sets themin-chars
of the inscription.See the
Gtk.Inscription:min-chars
property.- Parameters:
minChars
- the minimum number of characters that should fit, approximately
-
setMinLines
public void setMinLines(int minLines) Sets themin-lines
of the inscription.See the
Gtk.Inscription:min-lines
property.- Parameters:
minLines
- the minimum number of lines that should fit, approximately
-
setNatChars
public void setNatChars(int natChars) Sets thenat-chars
of the inscription.See the
Gtk.Inscription:nat-chars
property.- Parameters:
natChars
- the number of characters that should ideally fit, approximately
-
setNatLines
public void setNatLines(int natLines) Sets thenat-lines
of the inscription.See the
Gtk.Inscription:nat-lines
property.- Parameters:
natLines
- the number of lines that should ideally fit
-
setText
Sets the text to be displayed.- Parameters:
text
- The text to display
-
setTextOverflow
Sets what to do when the text doesn't fit.- Parameters:
overflow
- the overflow method to use
-
setWrapMode
Controls how line wrapping is done.- Parameters:
wrapMode
- the line wrapping mode
-
setXalign
public void setXalign(float xalign) Sets thexalign
of the inscription.See the
Gtk.Inscription:xalign
property.- Parameters:
xalign
- the new xalign value, between 0 and 1
-
setYalign
public void setYalign(float yalign) Sets theyalign
of the inscription.See the
Gtk.Inscription:yalign
property.- Parameters:
yalign
- the new yalign value, between 0 and 1
-
builder
AInscription.Builder
object constructs aInscription
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withInscription.Builder.build()
.
-