Class Widget
- Namespace
- Gtk
- Assembly
- Gtk-4.0.dll
public class Widget : InitiallyUnowned, IObject, INotifyPropertyChanged, IDisposable, Accessible, Buildable, ConstraintTarget, IHandle, GTypeProvider
- Inheritance
-
Widget
- Implements
- Derived
- Inherited Members
Constructors
Widget()
public Widget()
Widget(params ConstructArgument[])
protected Widget(params ConstructArgument[] constructArguments)
Parameters
constructArguments
ConstructArgument[]
Widget(IntPtr, bool)
protected Widget(IntPtr ptr, bool ownedRef)
Parameters
Fields
CanFocusPropertyDefinition
public static readonly Property<bool, Widget> CanFocusPropertyDefinition
Field Value
CanTargetPropertyDefinition
public static readonly Property<bool, Widget> CanTargetPropertyDefinition
Field Value
CssClassesPropertyDefinition
public static readonly Property<string[], Widget> CssClassesPropertyDefinition
Field Value
CssNamePropertyDefinition
public static readonly Property<string?, Widget> CssNamePropertyDefinition
Field Value
CursorPropertyDefinition
public static readonly Property<Cursor?, Widget> CursorPropertyDefinition
Field Value
DestroySignal
Signal Descriptor for OnDestroy.
public static readonly Signal<Widget> DestroySignal
Field Value
DirectionChangedSignal
Signal Descriptor for OnDirectionChanged.
public static readonly Signal<Widget, Widget.DirectionChangedSignalArgs> DirectionChangedSignal
Field Value
FocusOnClickPropertyDefinition
public static readonly Property<bool, Widget> FocusOnClickPropertyDefinition
Field Value
FocusablePropertyDefinition
public static readonly Property<bool, Widget> FocusablePropertyDefinition
Field Value
HalignPropertyDefinition
public static readonly Property<Align, Widget> HalignPropertyDefinition
Field Value
HasDefaultPropertyDefinition
public static readonly Property<bool, Widget> HasDefaultPropertyDefinition
Field Value
HasFocusPropertyDefinition
public static readonly Property<bool, Widget> HasFocusPropertyDefinition
Field Value
HasTooltipPropertyDefinition
public static readonly Property<bool, Widget> HasTooltipPropertyDefinition
Field Value
HeightRequestPropertyDefinition
public static readonly Property<int, Widget> HeightRequestPropertyDefinition
Field Value
HexpandPropertyDefinition
public static readonly Property<bool, Widget> HexpandPropertyDefinition
Field Value
HexpandSetPropertyDefinition
public static readonly Property<bool, Widget> HexpandSetPropertyDefinition
Field Value
HideSignal
Signal Descriptor for OnHide.
public static readonly Signal<Widget> HideSignal
Field Value
KeynavFailedSignal
Signal Descriptor for OnKeynavFailed.
public static readonly ReturningSignal<Widget, Widget.KeynavFailedSignalArgs, bool> KeynavFailedSignal
Field Value
LayoutManagerPropertyDefinition
public static readonly Property<LayoutManager?, Widget> LayoutManagerPropertyDefinition
Field Value
MapSignal
Signal Descriptor for OnMap.
public static readonly Signal<Widget> MapSignal
Field Value
MarginBottomPropertyDefinition
public static readonly Property<int, Widget> MarginBottomPropertyDefinition
Field Value
MarginEndPropertyDefinition
public static readonly Property<int, Widget> MarginEndPropertyDefinition
Field Value
MarginStartPropertyDefinition
public static readonly Property<int, Widget> MarginStartPropertyDefinition
Field Value
MarginTopPropertyDefinition
public static readonly Property<int, Widget> MarginTopPropertyDefinition
Field Value
MnemonicActivateSignal
Signal Descriptor for OnMnemonicActivate.
public static readonly ReturningSignal<Widget, Widget.MnemonicActivateSignalArgs, bool> MnemonicActivateSignal
Field Value
MoveFocusSignal
Signal Descriptor for OnMoveFocus.
public static readonly Signal<Widget, Widget.MoveFocusSignalArgs> MoveFocusSignal
Field Value
NamePropertyDefinition
public static readonly Property<string?, Widget> NamePropertyDefinition
Field Value
OpacityPropertyDefinition
public static readonly Property<double, Widget> OpacityPropertyDefinition
Field Value
OverflowPropertyDefinition
public static readonly Property<Overflow, Widget> OverflowPropertyDefinition
Field Value
ParentPropertyDefinition
public static readonly Property<Widget?, Widget> ParentPropertyDefinition
Field Value
QueryTooltipSignal
Signal Descriptor for OnQueryTooltip.
public static readonly ReturningSignal<Widget, Widget.QueryTooltipSignalArgs, bool> QueryTooltipSignal
Field Value
RealizeSignal
Signal Descriptor for OnRealize.
public static readonly Signal<Widget> RealizeSignal
Field Value
ReceivesDefaultPropertyDefinition
public static readonly Property<bool, Widget> ReceivesDefaultPropertyDefinition
Field Value
RootPropertyDefinition
public static readonly Property<Root, Widget> RootPropertyDefinition
Field Value
ScaleFactorPropertyDefinition
public static readonly Property<int, Widget> ScaleFactorPropertyDefinition
Field Value
SensitivePropertyDefinition
public static readonly Property<bool, Widget> SensitivePropertyDefinition
Field Value
ShowSignal
Signal Descriptor for OnShow.
public static readonly Signal<Widget> ShowSignal
Field Value
StateFlagsChangedSignal
Signal Descriptor for OnStateFlagsChanged.
public static readonly Signal<Widget, Widget.StateFlagsChangedSignalArgs> StateFlagsChangedSignal
Field Value
TooltipMarkupPropertyDefinition
public static readonly Property<string?, Widget> TooltipMarkupPropertyDefinition
Field Value
TooltipTextPropertyDefinition
public static readonly Property<string?, Widget> TooltipTextPropertyDefinition
Field Value
UnmapSignal
Signal Descriptor for OnUnmap.
public static readonly Signal<Widget> UnmapSignal
Field Value
UnrealizeSignal
Signal Descriptor for OnUnrealize.
public static readonly Signal<Widget> UnrealizeSignal
Field Value
ValignPropertyDefinition
public static readonly Property<Align, Widget> ValignPropertyDefinition
Field Value
VexpandPropertyDefinition
public static readonly Property<bool, Widget> VexpandPropertyDefinition
Field Value
VexpandSetPropertyDefinition
public static readonly Property<bool, Widget> VexpandSetPropertyDefinition
Field Value
VisiblePropertyDefinition
public static readonly Property<bool, Widget> VisiblePropertyDefinition
Field Value
WidthRequestPropertyDefinition
public static readonly Property<int, Widget> WidthRequestPropertyDefinition
Field Value
Properties
AccessibleRole
public AccessibleRole AccessibleRole { get; set; }
Property Value
CanFocus
public bool CanFocus { get; set; }
Property Value
CanTarget
public bool CanTarget { get; set; }
Property Value
CssClasses
public string[] CssClasses { get; set; }
Property Value
- string[]
CssName
public string? CssName { get; }
Property Value
Cursor
public Cursor? Cursor { get; set; }
Property Value
FocusOnClick
public bool FocusOnClick { get; set; }
Property Value
Focusable
public bool Focusable { get; set; }
Property Value
Halign
public Align Halign { get; set; }
Property Value
HasDefault
public bool HasDefault { get; }
Property Value
HasFocus
public bool HasFocus { get; }
Property Value
HasTooltip
public bool HasTooltip { get; set; }
Property Value
HeightRequest
public int HeightRequest { get; set; }
Property Value
Hexpand
public bool Hexpand { get; set; }
Property Value
HexpandSet
public bool HexpandSet { get; set; }
Property Value
LayoutManager
public LayoutManager? LayoutManager { get; set; }
Property Value
MarginBottom
public int MarginBottom { get; set; }
Property Value
MarginEnd
public int MarginEnd { get; set; }
Property Value
MarginStart
public int MarginStart { get; set; }
Property Value
MarginTop
public int MarginTop { get; set; }
Property Value
Name
public string? Name { get; set; }
Property Value
Opacity
public double Opacity { get; set; }
Property Value
Overflow
public Overflow Overflow { get; set; }
Property Value
Parent
public Widget? Parent { get; }
Property Value
ReceivesDefault
public bool ReceivesDefault { get; set; }
Property Value
Root
public Root Root { get; }
Property Value
ScaleFactor
public int ScaleFactor { get; }
Property Value
Sensitive
public bool Sensitive { get; set; }
Property Value
TooltipMarkup
public string? TooltipMarkup { get; set; }
Property Value
TooltipText
public string? TooltipText { get; set; }
Property Value
Valign
public Align Valign { get; set; }
Property Value
Vexpand
public bool Vexpand { get; set; }
Property Value
VexpandSet
public bool VexpandSet { get; set; }
Property Value
Visible
public bool Visible { get; set; }
Property Value
WidthRequest
public int WidthRequest { get; set; }
Property Value
Methods
ActionSetEnabled(string, bool)
public void ActionSetEnabled(string actionName, bool enabled)
Parameters
Activate()
public bool Activate()
Returns
ActivateAction(string, Variant?)
public bool ActivateAction(string name, Variant? args)
Parameters
Returns
ActivateDefault()
public void ActivateDefault()
AddController(EventController)
public void AddController(EventController controller)
Parameters
controller
EventController
AddCssClass(string)
public void AddCssClass(string cssClass)
Parameters
cssClass
string
AddMnemonicLabel(Widget)
public void AddMnemonicLabel(Widget label)
Parameters
label
Widget
AddTickCallback(TickCallback)
public uint AddTickCallback(TickCallback callback)
Parameters
callback
TickCallback
Returns
Allocate(int, int, int, Transform?)
public void Allocate(int width, int height, int baseline, Transform? transform)
Parameters
Announce(string, AccessibleAnnouncementPriority)
[Version("4.14")]
public void Announce(string message, AccessibleAnnouncementPriority priority)
Parameters
message
stringpriority
AccessibleAnnouncementPriority
ChildFocus(DirectionType)
public bool ChildFocus(DirectionType direction)
Parameters
direction
DirectionType
Returns
ComputeExpand(Orientation)
public bool ComputeExpand(Orientation orientation)
Parameters
orientation
Orientation
Returns
Contains(double, double)
public bool Contains(double x, double y)
Parameters
Returns
CreatePangoContext()
public Context CreatePangoContext()
Returns
CreatePangoLayout(string?)
public Layout CreatePangoLayout(string? text)
Parameters
text
string
Returns
DisposeTemplate(Type)
[Version("4.8")]
public void DisposeTemplate(Type widgetType)
Parameters
widgetType
Type
DragCheckThreshold(int, int, int, int)
public bool DragCheckThreshold(int startX, int startY, int currentX, int currentY)
Parameters
Returns
ErrorBell()
public void ErrorBell()
GetAccessibleParent()
[Version("4.10")]
public Accessible? GetAccessibleParent()
Returns
GetAccessibleRole()
public AccessibleRole GetAccessibleRole()
Returns
GetAllocatedBaseline()
public int GetAllocatedBaseline()
Returns
GetAllocatedHeight()
public int GetAllocatedHeight()
Returns
GetAllocatedWidth()
public int GetAllocatedWidth()
Returns
GetAncestor(Type)
public Widget? GetAncestor(Type widgetType)
Parameters
widgetType
Type
Returns
GetAtContext()
[Version("4.10")]
public ATContext GetAtContext()
Returns
GetBaseline()
[Version("4.12")]
public int GetBaseline()
Returns
GetBounds(out int, out int, out int, out int)
[Version("4.10")]
public bool GetBounds(out int x, out int y, out int width, out int height)
Parameters
Returns
GetBuildableId()
public string? GetBuildableId()
Returns
GetCanFocus()
public bool GetCanFocus()
Returns
GetCanTarget()
public bool GetCanTarget()
Returns
GetChildVisible()
public bool GetChildVisible()
Returns
GetClipboard()
public Clipboard GetClipboard()
Returns
GetCssClasses()
public string[] GetCssClasses()
Returns
- string[]
GetCssName()
public string GetCssName()
Returns
GetCursor()
public Cursor? GetCursor()
Returns
GetDefaultDirection()
public static TextDirection GetDefaultDirection()
Returns
GetDirection()
public TextDirection GetDirection()
Returns
GetDisplay()
public Display GetDisplay()
Returns
GetFirstAccessibleChild()
[Version("4.10")]
public Accessible? GetFirstAccessibleChild()
Returns
GetFirstChild()
public Widget? GetFirstChild()
Returns
GetFocusChild()
public Widget? GetFocusChild()
Returns
GetFocusOnClick()
public bool GetFocusOnClick()
Returns
GetFocusable()
public bool GetFocusable()
Returns
GetFontMap()
public FontMap? GetFontMap()
Returns
GetFontOptions()
public FontOptions? GetFontOptions()
Returns
GetFrameClock()
public FrameClock? GetFrameClock()
Returns
GetGType()
public static Type GetGType()
Returns
GetHalign()
public Align GetHalign()
Returns
GetHasDefault()
public bool GetHasDefault()
Returns
GetHasFocus()
public bool GetHasFocus()
Returns
GetHasTooltip()
public bool GetHasTooltip()
Returns
GetHeight()
public int GetHeight()
Returns
GetHexpand()
public bool GetHexpand()
Returns
GetHexpandSet()
public bool GetHexpandSet()
Returns
GetLastChild()
public Widget? GetLastChild()
Returns
GetLayoutManager()
public LayoutManager? GetLayoutManager()
Returns
GetMapped()
public bool GetMapped()
Returns
GetMarginBottom()
public int GetMarginBottom()
Returns
GetMarginEnd()
public int GetMarginEnd()
Returns
GetMarginStart()
public int GetMarginStart()
Returns
GetMarginTop()
public int GetMarginTop()
Returns
GetName()
public string GetName()
Returns
GetNative()
public Native? GetNative()
Returns
GetNextAccessibleSibling()
[Version("4.10")]
public Accessible? GetNextAccessibleSibling()
Returns
GetNextSibling()
public Widget? GetNextSibling()
Returns
GetOpacity()
public double GetOpacity()
Returns
GetOverflow()
public Overflow GetOverflow()
Returns
GetPangoContext()
public Context GetPangoContext()
Returns
GetParent()
public Widget? GetParent()
Returns
GetPlatformState(AccessiblePlatformState)
[Version("4.10")]
public bool GetPlatformState(AccessiblePlatformState state)
Parameters
state
AccessiblePlatformState
Returns
GetPrevSibling()
public Widget? GetPrevSibling()
Returns
GetPrimaryClipboard()
public Clipboard GetPrimaryClipboard()
Returns
GetRealized()
public bool GetRealized()
Returns
GetReceivesDefault()
public bool GetReceivesDefault()
Returns
GetRequestMode()
public SizeRequestMode GetRequestMode()
Returns
GetRoot()
public Root? GetRoot()
Returns
GetScaleFactor()
public int GetScaleFactor()
Returns
GetSensitive()
public bool GetSensitive()
Returns
GetSettings()
public Settings GetSettings()
Returns
GetSize(Orientation)
public int GetSize(Orientation orientation)
Parameters
orientation
Orientation
Returns
GetSizeRequest(out int, out int)
public void GetSizeRequest(out int width, out int height)
Parameters
GetStateFlags()
public StateFlags GetStateFlags()
Returns
GetStyleContext()
public StyleContext GetStyleContext()
Returns
GetTemplateChild(Type, string)
public Object GetTemplateChild(Type widgetType, string name)
Parameters
Returns
GetTooltipMarkup()
public string? GetTooltipMarkup()
Returns
GetTooltipText()
public string? GetTooltipText()
Returns
GetValign()
public Align GetValign()
Returns
GetVexpand()
public bool GetVexpand()
Returns
GetVexpandSet()
public bool GetVexpandSet()
Returns
GetVisible()
public bool GetVisible()
Returns
GetWidth()
public int GetWidth()
Returns
GrabFocus()
public bool GrabFocus()
Returns
HasCssClass(string)
public bool HasCssClass(string cssClass)
Parameters
cssClass
string
Returns
HasVisibleFocus()
public bool HasVisibleFocus()
Returns
Hide()
public void Hide()
InDestruction()
public bool InDestruction()
Returns
InitTemplate()
public void InitTemplate()
InsertActionGroup(string, ActionGroup?)
public void InsertActionGroup(string name, ActionGroup? group)
Parameters
name
stringgroup
ActionGroup
InsertAfter(Widget, Widget?)
public void InsertAfter(Widget parent, Widget? previousSibling)
Parameters
InsertBefore(Widget, Widget?)
public void InsertBefore(Widget parent, Widget? nextSibling)
Parameters
IsAncestor(Widget)
public bool IsAncestor(Widget ancestor)
Parameters
ancestor
Widget
Returns
IsDrawable()
public bool IsDrawable()
Returns
IsFocus()
public bool IsFocus()
Returns
IsSensitive()
public bool IsSensitive()
Returns
IsVisible()
public bool IsVisible()
Returns
KeynavFailed(DirectionType)
public bool KeynavFailed(DirectionType direction)
Parameters
direction
DirectionType
Returns
Map()
public void Map()
Measure(Orientation, int, out int, out int, out int, out int)
public void Measure(Orientation orientation, int forSize, out int minimum, out int natural, out int minimumBaseline, out int naturalBaseline)
Parameters
MnemonicActivate(bool)
public bool MnemonicActivate(bool groupCycling)
Parameters
groupCycling
bool
Returns
ObserveChildren()
public ListModel ObserveChildren()
Returns
ObserveControllers()
public ListModel ObserveControllers()
Returns
Pick(double, double, PickFlags)
public Widget? Pick(double x, double y, PickFlags flags)
Parameters
Returns
QueueAllocate()
public void QueueAllocate()
QueueDraw()
public void QueueDraw()
QueueResize()
public void QueueResize()
Realize()
public void Realize()
RemoveController(EventController)
public void RemoveController(EventController controller)
Parameters
controller
EventController
RemoveCssClass(string)
public void RemoveCssClass(string cssClass)
Parameters
cssClass
string
RemoveMnemonicLabel(Widget)
public void RemoveMnemonicLabel(Widget label)
Parameters
label
Widget
RemoveTickCallback(uint)
public void RemoveTickCallback(uint id)
Parameters
id
uint
ResetProperty(AccessibleProperty)
public void ResetProperty(AccessibleProperty property)
Parameters
property
AccessibleProperty
ResetRelation(AccessibleRelation)
public void ResetRelation(AccessibleRelation relation)
Parameters
relation
AccessibleRelation
ResetState(AccessibleState)
public void ResetState(AccessibleState state)
Parameters
state
AccessibleState
SetAccessibleParent(Accessible?, Accessible?)
[Version("4.10")]
public void SetAccessibleParent(Accessible? parent, Accessible? nextSibling)
Parameters
parent
AccessiblenextSibling
Accessible
SetCanFocus(bool)
public void SetCanFocus(bool canFocus)
Parameters
canFocus
bool
SetCanTarget(bool)
public void SetCanTarget(bool canTarget)
Parameters
canTarget
bool
SetChildVisible(bool)
public void SetChildVisible(bool childVisible)
Parameters
childVisible
bool
SetCssClasses(string[])
public void SetCssClasses(string[] classes)
Parameters
classes
string[]
SetCursor(Cursor?)
public void SetCursor(Cursor? cursor)
Parameters
cursor
Cursor
SetCursorFromName(string?)
public void SetCursorFromName(string? name)
Parameters
name
string
SetDefaultDirection(TextDirection)
public static void SetDefaultDirection(TextDirection dir)
Parameters
dir
TextDirection
SetDirection(TextDirection)
public void SetDirection(TextDirection dir)
Parameters
dir
TextDirection
SetFocusChild(Widget?)
public void SetFocusChild(Widget? child)
Parameters
child
Widget
SetFocusOnClick(bool)
public void SetFocusOnClick(bool focusOnClick)
Parameters
focusOnClick
bool
SetFocusable(bool)
public void SetFocusable(bool focusable)
Parameters
focusable
bool
SetFontMap(FontMap?)
public void SetFontMap(FontMap? fontMap)
Parameters
fontMap
FontMap
SetFontOptions(FontOptions?)
public void SetFontOptions(FontOptions? options)
Parameters
options
FontOptions
SetHalign(Align)
public void SetHalign(Align align)
Parameters
align
Align
SetHasTooltip(bool)
public void SetHasTooltip(bool hasTooltip)
Parameters
hasTooltip
bool
SetHexpand(bool)
public void SetHexpand(bool expand)
Parameters
expand
bool
SetHexpandSet(bool)
public void SetHexpandSet(bool set)
Parameters
set
bool
SetLayoutManager(LayoutManager?)
public void SetLayoutManager(LayoutManager? layoutManager)
Parameters
layoutManager
LayoutManager
SetMarginBottom(int)
public void SetMarginBottom(int margin)
Parameters
margin
int
SetMarginEnd(int)
public void SetMarginEnd(int margin)
Parameters
margin
int
SetMarginStart(int)
public void SetMarginStart(int margin)
Parameters
margin
int
SetMarginTop(int)
public void SetMarginTop(int margin)
Parameters
margin
int
SetName(string)
public void SetName(string name)
Parameters
name
string
SetOpacity(double)
public void SetOpacity(double opacity)
Parameters
opacity
double
SetOverflow(Overflow)
public void SetOverflow(Overflow overflow)
Parameters
overflow
Overflow
SetParent(Widget)
public void SetParent(Widget parent)
Parameters
parent
Widget
SetReceivesDefault(bool)
public void SetReceivesDefault(bool receivesDefault)
Parameters
receivesDefault
bool
SetSensitive(bool)
public void SetSensitive(bool sensitive)
Parameters
sensitive
bool
SetSizeRequest(int, int)
public void SetSizeRequest(int width, int height)
Parameters
SetStateFlags(StateFlags, bool)
public void SetStateFlags(StateFlags flags, bool clear)
Parameters
flags
StateFlagsclear
bool
SetTooltipMarkup(string?)
public void SetTooltipMarkup(string? markup)
Parameters
markup
string
SetTooltipText(string?)
public void SetTooltipText(string? text)
Parameters
text
string
SetValign(Align)
public void SetValign(Align align)
Parameters
align
Align
SetVexpand(bool)
public void SetVexpand(bool expand)
Parameters
expand
bool
SetVexpandSet(bool)
public void SetVexpandSet(bool set)
Parameters
set
bool
SetVisible(bool)
public void SetVisible(bool visible)
Parameters
visible
bool
ShouldLayout()
public bool ShouldLayout()
Returns
Show()
public void Show()
SnapshotChild(Widget, Snapshot)
public void SnapshotChild(Widget child, Snapshot snapshot)
Parameters
TranslateCoordinates(Widget, double, double, out double, out double)
public bool TranslateCoordinates(Widget destWidget, double srcX, double srcY, out double destX, out double destY)
Parameters
Returns
TriggerTooltipQuery()
public void TriggerTooltipQuery()
Unmap()
public void Unmap()
Unparent()
public void Unparent()
Unrealize()
public void Unrealize()
UnsetStateFlags(StateFlags)
public void UnsetStateFlags(StateFlags flags)
Parameters
flags
StateFlags
UpdateNextAccessibleSibling(Accessible?)
[Version("4.10")]
public void UpdateNextAccessibleSibling(Accessible? newSibling)
Parameters
newSibling
Accessible
Events
OnDestroy
public event SignalHandler<Widget> OnDestroy
Event Type
OnDirectionChanged
public event SignalHandler<Widget, Widget.DirectionChangedSignalArgs> OnDirectionChanged
Event Type
OnHide
public event SignalHandler<Widget> OnHide
Event Type
OnKeynavFailed
public event ReturningSignalHandler<Widget, Widget.KeynavFailedSignalArgs, bool> OnKeynavFailed
Event Type
OnMap
public event SignalHandler<Widget> OnMap
Event Type
OnMnemonicActivate
public event ReturningSignalHandler<Widget, Widget.MnemonicActivateSignalArgs, bool> OnMnemonicActivate
Event Type
OnMoveFocus
public event SignalHandler<Widget, Widget.MoveFocusSignalArgs> OnMoveFocus
Event Type
OnQueryTooltip
public event ReturningSignalHandler<Widget, Widget.QueryTooltipSignalArgs, bool> OnQueryTooltip
Event Type
OnRealize
public event SignalHandler<Widget> OnRealize
Event Type
OnShow
public event SignalHandler<Widget> OnShow
Event Type
OnStateFlagsChanged
public event SignalHandler<Widget, Widget.StateFlagsChangedSignalArgs> OnStateFlagsChanged
Event Type
OnUnmap
public event SignalHandler<Widget> OnUnmap
Event Type
OnUnrealize
public event SignalHandler<Widget> OnUnrealize