v0.2.1 c0399be

gtkpasswordentry.go RawHistoryFolder

1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/gio"
12	"github.com/bnema/puregotk/v4/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17type PasswordEntryClass struct {
18	_ structs.HostLayout
19}
20
21func (x *PasswordEntryClass) GoPointer() uintptr {
22	return uintptr(unsafe.Pointer(x))
23}
24
25// A single-line text entry widget for entering passwords and other secrets.
26//
27// <picture>
28//
29//	<source srcset="password-entry-dark.png" media="(prefers-color-scheme: dark)">
30//	<img alt="An example GtkPasswordEntry" src="password-entry.png">
31//
32// </picture>
33//
34// It does not show its contents in clear text, does not allow to copy it
35// to the clipboard, and it shows a warning when Caps Lock is engaged. If
36// the underlying platform allows it, `GtkPasswordEntry` will also place
37// the text in a non-pageable memory area, to avoid it being written out
38// to disk by the operating system.
39//
40// Optionally, it can offer a way to reveal the contents in clear text.
41//
42// `GtkPasswordEntry` provides only minimal API and should be used with
43// the [iface@Gtk.Editable] API.
44//
45// # CSS Nodes
46//
47// ```
48// entry.password
49// ╰── text
50//
51//	├── image.caps-lock-indicator
52//	┊
53//
54// ```
55//
56// `GtkPasswordEntry` has a single CSS node with name entry that carries
57// a .passwordstyle class. The text Css node below it has a child with
58// name image and style class .caps-lock-indicator for the Caps Lock
59// icon, and possibly other children.
60//
61// # Accessibility
62//
63// `GtkPasswordEntry` uses the [enum@Gtk.AccessibleRole.text_box] role.
64type PasswordEntry struct {
65	Widget
66}
67
68var xPasswordEntryGLibType func() types.GType
69
70func PasswordEntryGLibType() types.GType {
71	return xPasswordEntryGLibType()
72}
73
74func PasswordEntryNewFromInternalPtr(ptr uintptr) *PasswordEntry {
75	cls := &PasswordEntry{}
76	cls.Ptr = ptr
77	return cls
78}
79
80var xNewPasswordEntry func() uintptr
81
82// Creates a `GtkPasswordEntry`.
83func NewPasswordEntry() *PasswordEntry {
84	var cls *PasswordEntry
85
86	cret := xNewPasswordEntry()
87
88	if cret == 0 {
89		return nil
90	}
91	gobject.IncreaseRef(cret)
92	cls = &PasswordEntry{}
93	cls.Ptr = cret
94	return cls
95}
96
97var xPasswordEntryGetExtraMenu func(uintptr) uintptr
98
99// Gets the menu model set with gtk_password_entry_set_extra_menu().
100func (x *PasswordEntry) GetExtraMenu() *gio.MenuModel {
101	var cls *gio.MenuModel
102
103	cret := xPasswordEntryGetExtraMenu(x.GoPointer())
104
105	if cret == 0 {
106		return nil
107	}
108	gobject.IncreaseRef(cret)
109	cls = &gio.MenuModel{}
110	cls.Ptr = cret
111	return cls
112}
113
114var xPasswordEntryGetShowPeekIcon func(uintptr) bool
115
116// Returns whether the entry is showing an icon to
117// reveal the contents.
118func (x *PasswordEntry) GetShowPeekIcon() bool {
119
120	cret := xPasswordEntryGetShowPeekIcon(x.GoPointer())
121	return cret
122}
123
124var xPasswordEntrySetExtraMenu func(uintptr, uintptr)
125
126// Sets a menu model to add when constructing
127// the context menu for @entry.
128func (x *PasswordEntry) SetExtraMenu(ModelVar *gio.MenuModel) {
129
130	xPasswordEntrySetExtraMenu(x.GoPointer(), ModelVar.GoPointer())
131
132}
133
134var xPasswordEntrySetShowPeekIcon func(uintptr, bool)
135
136// Sets whether the entry should have a clickable icon
137// to reveal the contents.
138//
139// Setting this to %FALSE also hides the text again.
140func (x *PasswordEntry) SetShowPeekIcon(ShowPeekIconVar bool) {
141
142	xPasswordEntrySetShowPeekIcon(x.GoPointer(), ShowPeekIconVar)
143
144}
145
146func (c *PasswordEntry) GoPointer() uintptr {
147	if c == nil {
148		return 0
149	}
150	return c.Ptr
151}
152
153func (c *PasswordEntry) SetGoPointer(ptr uintptr) {
154	c.Ptr = ptr
155}
156
157// SetPropertyActivatesDefault sets the "activates-default" property.
158// Whether to activate the default widget when Enter is pressed.
159func (x *PasswordEntry) SetPropertyActivatesDefault(value bool) {
160	var v gobject.Value
161	v.Init(gobject.TypeBooleanVal)
162	v.SetBoolean(value)
163	x.SetProperty("activates-default", &v)
164}
165
166// GetPropertyActivatesDefault gets the "activates-default" property.
167// Whether to activate the default widget when Enter is pressed.
168func (x *PasswordEntry) GetPropertyActivatesDefault() bool {
169	var v gobject.Value
170	x.GetProperty("activates-default", &v)
171	return v.GetBoolean()
172}
173
174// SetPropertyPlaceholderText sets the "placeholder-text" property.
175// The text that will be displayed in the `GtkPasswordEntry`
176// when it is empty and unfocused.
177func (x *PasswordEntry) SetPropertyPlaceholderText(value string) {
178	var v gobject.Value
179	v.Init(gobject.TypeStringVal)
180	v.SetString(&value)
181	x.SetProperty("placeholder-text", &v)
182}
183
184// GetPropertyPlaceholderText gets the "placeholder-text" property.
185// The text that will be displayed in the `GtkPasswordEntry`
186// when it is empty and unfocused.
187func (x *PasswordEntry) GetPropertyPlaceholderText() string {
188	var v gobject.Value
189	x.GetProperty("placeholder-text", &v)
190	return v.GetString()
191}
192
193// SetPropertyShowPeekIcon sets the "show-peek-icon" property.
194// Whether to show an icon for revealing the content.
195func (x *PasswordEntry) SetPropertyShowPeekIcon(value bool) {
196	var v gobject.Value
197	v.Init(gobject.TypeBooleanVal)
198	v.SetBoolean(value)
199	x.SetProperty("show-peek-icon", &v)
200}
201
202// GetPropertyShowPeekIcon gets the "show-peek-icon" property.
203// Whether to show an icon for revealing the content.
204func (x *PasswordEntry) GetPropertyShowPeekIcon() bool {
205	var v gobject.Value
206	x.GetProperty("show-peek-icon", &v)
207	return v.GetBoolean()
208}
209
210// Emitted when the entry is activated.
211//
212// The keybindings for this signal are all forms of the Enter key.
213func (x *PasswordEntry) ConnectActivate(cb *func(PasswordEntry)) uint {
214	cbPtr := uintptr(unsafe.Pointer(cb))
215	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
216		handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
217		glib.SaveHandlerMapping(handlerID, cbPtr)
218		return handlerID
219	}
220
221	fcb := func(clsPtr uintptr) {
222		fa := PasswordEntry{}
223		fa.Ptr = clsPtr
224		cbFn := *cb
225
226		cbFn(fa)
227
228	}
229	cbRefPtr := purego.NewCallback(fcb)
230	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
231	handlerID := gobject.SignalConnect(x.GoPointer(), "activate", cbRefPtr)
232	glib.SaveHandlerMapping(handlerID, cbPtr)
233	return handlerID
234}
235
236// Requests the user's screen reader to announce the given message.
237//
238// This kind of notification is useful for messages that
239// either have only a visual representation or that are not
240// exposed visually at all, e.g. a notification about a
241// successful operation.
242//
243// Also, by using this API, you can ensure that the message
244// does not interrupts the user's current screen reader output.
245func (x *PasswordEntry) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
246
247	XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
248
249}
250
251// Retrieves the accessible parent for an accessible object.
252//
253// This function returns `NULL` for top level widgets.
254func (x *PasswordEntry) GetAccessibleParent() *AccessibleBase {
255	var cls *AccessibleBase
256
257	cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
258
259	if cret == 0 {
260		return nil
261	}
262	cls = &AccessibleBase{}
263	cls.Ptr = cret
264	return cls
265}
266
267// Retrieves the accessible role of an accessible object.
268func (x *PasswordEntry) GetAccessibleRole() AccessibleRole {
269
270	cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
271	return cret
272}
273
274// Retrieves the implementation for the given accessible object.
275func (x *PasswordEntry) GetAtContext() *ATContext {
276	var cls *ATContext
277
278	cret := XGtkAccessibleGetAtContext(x.GoPointer())
279
280	if cret == 0 {
281		return nil
282	}
283	cls = &ATContext{}
284	cls.Ptr = cret
285	return cls
286}
287
288// Queries the coordinates and dimensions of this accessible
289//
290// This functionality can be overridden by `GtkAccessible`
291// implementations, e.g. to get the bounds from an ignored
292// child widget.
293func (x *PasswordEntry) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
294
295	cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
296	return cret
297}
298
299// Retrieves the first accessible child of an accessible object.
300func (x *PasswordEntry) GetFirstAccessibleChild() *AccessibleBase {
301	var cls *AccessibleBase
302
303	cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
304
305	if cret == 0 {
306		return nil
307	}
308	cls = &AccessibleBase{}
309	cls.Ptr = cret
310	return cls
311}
312
313// Retrieves the next accessible sibling of an accessible object
314func (x *PasswordEntry) GetNextAccessibleSibling() *AccessibleBase {
315	var cls *AccessibleBase
316
317	cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
318
319	if cret == 0 {
320		return nil
321	}
322	cls = &AccessibleBase{}
323	cls.Ptr = cret
324	return cls
325}
326
327// Queries a platform state, such as focus.
328//
329// This functionality can be overridden by `GtkAccessible`
330// implementations, e.g. to get platform state from an ignored
331// child widget, as is the case for `GtkText` wrappers.
332func (x *PasswordEntry) GetPlatformState(StateVar AccessiblePlatformState) bool {
333
334	cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
335	return cret
336}
337
338// Resets the accessible property to its default value.
339func (x *PasswordEntry) ResetProperty(PropertyVar AccessibleProperty) {
340
341	XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
342
343}
344
345// Resets the accessible relation to its default value.
346func (x *PasswordEntry) ResetRelation(RelationVar AccessibleRelation) {
347
348	XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
349
350}
351
352// Resets the accessible state to its default value.
353func (x *PasswordEntry) ResetState(StateVar AccessibleState) {
354
355	XGtkAccessibleResetState(x.GoPointer(), StateVar)
356
357}
358
359// Sets the parent and sibling of an accessible object.
360//
361// This function is meant to be used by accessible implementations that are
362// not part of the widget hierarchy, and but act as a logical bridge between
363// widgets. For instance, if a widget creates an object that holds metadata
364// for each child, and you want that object to implement the `GtkAccessible`
365// interface, you will use this function to ensure that the parent of each
366// child widget is the metadata object, and the parent of each metadata
367// object is the container widget.
368func (x *PasswordEntry) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
369
370	XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
371
372}
373
374// Updates the next accessible sibling.
375//
376// That might be useful when a new child of a custom accessible
377// is created, and it needs to be linked to a previous child.
378func (x *PasswordEntry) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
379
380	XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
381
382}
383
384// Informs ATs that the platform state has changed.
385//
386// This function should be used by `GtkAccessible` implementations that
387// have a platform state but are not widgets. Widgets handle platform
388// states automatically.
389func (x *PasswordEntry) UpdatePlatformState(StateVar AccessiblePlatformState) {
390
391	XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
392
393}
394
395// Updates a list of accessible properties.
396//
397// See the [enum@Gtk.AccessibleProperty] documentation for the
398// value types of accessible properties.
399//
400// This function should be called by `GtkWidget` types whenever
401// an accessible property change must be communicated to assistive
402// technologies.
403//
404// Example:
405// ```c
406// value = gtk_adjustment_get_value (adjustment);
407// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
408//
409//	GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
410//	-1);
411//
412// ```
413func (x *PasswordEntry) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
414
415	XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
416
417}
418
419// Updates an array of accessible properties.
420//
421// This function should be called by `GtkWidget` types whenever an accessible
422// property change must be communicated to assistive technologies.
423//
424// This function is meant to be used by language bindings.
425func (x *PasswordEntry) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
426
427	XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
428
429}
430
431// Updates a list of accessible relations.
432//
433// This function should be called by `GtkWidget` types whenever an accessible
434// relation change must be communicated to assistive technologies.
435//
436// If the [enum@Gtk.AccessibleRelation] requires a list of references,
437// you should pass each reference individually, followed by `NULL`, e.g.
438//
439// ```c
440// gtk_accessible_update_relation (accessible,
441//
442//	GTK_ACCESSIBLE_RELATION_CONTROLS,
443//	  ref1, NULL,
444//	GTK_ACCESSIBLE_RELATION_LABELLED_BY,
445//	  ref1, ref2, ref3, NULL,
446//	-1);
447//
448// ```
449func (x *PasswordEntry) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
450
451	XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
452
453}
454
455// Updates an array of accessible relations.
456//
457// This function should be called by `GtkWidget` types whenever an accessible
458// relation change must be communicated to assistive technologies.
459//
460// This function is meant to be used by language bindings.
461func (x *PasswordEntry) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
462
463	XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
464
465}
466
467// Updates a list of accessible states.
468//
469// See the [enum@Gtk.AccessibleState] documentation for the
470// value types of accessible states.
471//
472// This function should be called by `GtkWidget` types whenever
473// an accessible state change must be communicated to assistive
474// technologies.
475//
476// Example:
477//
478// ```c
479// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
480// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
481//
482//	GTK_ACCESSIBLE_STATE_CHECKED, value,
483//	-1);
484//
485// ```
486func (x *PasswordEntry) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
487
488	XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
489
490}
491
492// Updates an array of accessible states.
493//
494// This function should be called by `GtkWidget` types whenever an accessible
495// state change must be communicated to assistive technologies.
496//
497// This function is meant to be used by language bindings.
498func (x *PasswordEntry) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
499
500	XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
501
502}
503
504// Gets the ID of the @buildable object.
505//
506// `GtkBuilder` sets the name based on the ID attribute
507// of the `<object>` tag used to construct the @buildable.
508func (x *PasswordEntry) GetBuildableId() string {
509
510	cret := XGtkBuildableGetBuildableId(x.GoPointer())
511	return cret
512}
513
514// Retrieves the accessible platform state from the editable delegate.
515//
516// This is an helper function to retrieve the accessible state for
517// `GtkEditable` interface implementations using a delegate pattern.
518//
519// You should call this function in your editable widget implementation
520// of the [vfunc@Gtk.Accessible.get_platform_state] virtual function, for
521// instance:
522//
523// ```c
524// static void
525// accessible_interface_init (GtkAccessibleInterface *iface)
526//
527//	{
528//	  iface->get_platform_state = your_editable_get_accessible_platform_state;
529//	}
530//
531// static gboolean
532// your_editable_get_accessible_platform_state (GtkAccessible *accessible,
533//
534//	GtkAccessiblePlatformState state)
535//
536//	{
537//	  return gtk_editable_delegate_get_accessible_platform_state (GTK_EDITABLE (accessible), state);
538//	}
539//
540// ```
541//
542// Note that the widget which is the delegate *must* be a direct child of
543// this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state]
544// might not even be called, as the platform change will originate from
545// the parent of the delegate, and, as a result, will not work properly.
546//
547// So, if you can't ensure the direct child condition, you should give the
548// delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can
549// change your tree to allow this function to work.
550func (x *PasswordEntry) DelegateGetAccessiblePlatformState(StateVar AccessiblePlatformState) bool {
551
552	cret := XGtkEditableDelegateGetAccessiblePlatformState(x.GoPointer(), StateVar)
553	return cret
554}
555
556// Deletes the currently selected text of the editable.
557//
558// This call doesn’t do anything if there is no selected text.
559func (x *PasswordEntry) DeleteSelection() {
560
561	XGtkEditableDeleteSelection(x.GoPointer())
562
563}
564
565// Deletes a sequence of characters.
566//
567// The characters that are deleted are those characters at positions
568// from @start_pos up to, but not including @end_pos. If @end_pos is
569// negative, then the characters deleted are those from @start_pos to
570// the end of the text.
571//
572// Note that the positions are specified in characters, not bytes.
573func (x *PasswordEntry) DeleteText(StartPosVar int, EndPosVar int) {
574
575	XGtkEditableDeleteText(x.GoPointer(), StartPosVar, EndPosVar)
576
577}
578
579// Undoes the setup done by [method@Gtk.Editable.init_delegate].
580//
581// This is a helper function that should be called from dispose,
582// before removing the delegate object.
583func (x *PasswordEntry) FinishDelegate() {
584
585	XGtkEditableFinishDelegate(x.GoPointer())
586
587}
588
589// Gets the alignment of the editable.
590func (x *PasswordEntry) GetAlignment() float32 {
591
592	cret := XGtkEditableGetAlignment(x.GoPointer())
593	return cret
594}
595
596// Retrieves a sequence of characters.
597//
598// The characters that are retrieved are those characters at positions
599// from @start_pos up to, but not including @end_pos. If @end_pos is negative,
600// then the characters retrieved are those characters from @start_pos to
601// the end of the text.
602//
603// Note that positions are specified in characters, not bytes.
604func (x *PasswordEntry) GetChars(StartPosVar int, EndPosVar int) string {
605
606	cret := XGtkEditableGetChars(x.GoPointer(), StartPosVar, EndPosVar)
607	return cret
608}
609
610// Gets the `GtkEditable` that @editable is delegating its
611// implementation to.
612//
613// Typically, the delegate is a [class@Gtk.Text] widget.
614func (x *PasswordEntry) GetDelegate() *EditableBase {
615	var cls *EditableBase
616
617	cret := XGtkEditableGetDelegate(x.GoPointer())
618
619	if cret == 0 {
620		return nil
621	}
622	gobject.IncreaseRef(cret)
623	cls = &EditableBase{}
624	cls.Ptr = cret
625	return cls
626}
627
628// Retrieves whether @editable is editable.
629func (x *PasswordEntry) GetEditable() bool {
630
631	cret := XGtkEditableGetEditable(x.GoPointer())
632	return cret
633}
634
635// Gets if undo/redo actions are enabled for @editable
636func (x *PasswordEntry) GetEnableUndo() bool {
637
638	cret := XGtkEditableGetEnableUndo(x.GoPointer())
639	return cret
640}
641
642// Retrieves the desired maximum width of @editable, in characters.
643func (x *PasswordEntry) GetMaxWidthChars() int {
644
645	cret := XGtkEditableGetMaxWidthChars(x.GoPointer())
646	return cret
647}
648
649// Retrieves the current position of the cursor relative
650// to the start of the content of the editable.
651//
652// Note that this position is in characters, not in bytes.
653func (x *PasswordEntry) GetPosition() int {
654
655	cret := XGtkEditableGetPosition(x.GoPointer())
656	return cret
657}
658
659// Retrieves the selection bound of the editable.
660//
661// @start_pos will be filled with the start of the selection and
662// @end_pos with end. If no text was selected both will be identical
663// and %FALSE will be returned.
664//
665// Note that positions are specified in characters, not bytes.
666func (x *PasswordEntry) GetSelectionBounds(StartPosVar *int, EndPosVar *int) bool {
667
668	cret := XGtkEditableGetSelectionBounds(x.GoPointer(), StartPosVar, EndPosVar)
669	return cret
670}
671
672// Retrieves the contents of @editable.
673//
674// The returned string is owned by GTK and must not be modified or freed.
675func (x *PasswordEntry) GetText() string {
676
677	cret := XGtkEditableGetText(x.GoPointer())
678	return cret
679}
680
681// Gets the number of characters of space reserved
682// for the contents of the editable.
683func (x *PasswordEntry) GetWidthChars() int {
684
685	cret := XGtkEditableGetWidthChars(x.GoPointer())
686	return cret
687}
688
689// Sets up a delegate for `GtkEditable`.
690//
691// This is assuming that the get_delegate vfunc in the `GtkEditable`
692// interface has been set up for the @editable's type.
693//
694// This is a helper function that should be called in instance init,
695// after creating the delegate object.
696func (x *PasswordEntry) InitDelegate() {
697
698	XGtkEditableInitDelegate(x.GoPointer())
699
700}
701
702// Inserts @length bytes of @text into the contents of the
703// widget, at position @position.
704//
705// Note that the position is in characters, not in bytes.
706// The function updates @position to point after the newly
707// inserted text.
708func (x *PasswordEntry) InsertText(TextVar string, LengthVar int, PositionVar int) {
709
710	XGtkEditableInsertText(x.GoPointer(), TextVar, LengthVar, PositionVar)
711
712}
713
714// Selects a region of text.
715//
716// The characters that are selected are those characters at positions
717// from @start_pos up to, but not including @end_pos. If @end_pos is
718// negative, then the characters selected are those characters from
719// @start_pos to  the end of the text.
720//
721// Note that positions are specified in characters, not bytes.
722func (x *PasswordEntry) SelectRegion(StartPosVar int, EndPosVar int) {
723
724	XGtkEditableSelectRegion(x.GoPointer(), StartPosVar, EndPosVar)
725
726}
727
728// Sets the alignment for the contents of the editable.
729//
730// This controls the horizontal positioning of the contents when
731// the displayed text is shorter than the width of the editable.
732func (x *PasswordEntry) SetAlignment(XalignVar float32) {
733
734	XGtkEditableSetAlignment(x.GoPointer(), XalignVar)
735
736}
737
738// Determines if the user can edit the text in the editable widget.
739func (x *PasswordEntry) SetEditable(IsEditableVar bool) {
740
741	XGtkEditableSetEditable(x.GoPointer(), IsEditableVar)
742
743}
744
745// If enabled, changes to @editable will be saved for undo/redo
746// actions.
747//
748// This results in an additional copy of text changes and are not
749// stored in secure memory. As such, undo is forcefully disabled
750// when [property@Gtk.Text:visibility] is set to %FALSE.
751func (x *PasswordEntry) SetEnableUndo(EnableUndoVar bool) {
752
753	XGtkEditableSetEnableUndo(x.GoPointer(), EnableUndoVar)
754
755}
756
757// Sets the desired maximum width in characters of @editable.
758func (x *PasswordEntry) SetMaxWidthChars(NCharsVar int) {
759
760	XGtkEditableSetMaxWidthChars(x.GoPointer(), NCharsVar)
761
762}
763
764// Sets the cursor position in the editable to the given value.
765//
766// The cursor is displayed before the character with the given (base 0)
767// index in the contents of the editable. The value must be less than
768// or equal to the number of characters in the editable. A value of -1
769// indicates that the position should be set after the last character
770// of the editable. Note that @position is in characters, not in bytes.
771func (x *PasswordEntry) SetPosition(PositionVar int) {
772
773	XGtkEditableSetPosition(x.GoPointer(), PositionVar)
774
775}
776
777// Sets the text in the editable to the given value.
778//
779// This is replacing the current contents.
780func (x *PasswordEntry) SetText(TextVar string) {
781
782	XGtkEditableSetText(x.GoPointer(), TextVar)
783
784}
785
786// Changes the size request of the editable to be about the
787// right size for @n_chars characters.
788//
789// Note that it changes the size request, the size can still
790// be affected by how you pack the widget into containers.
791// If @n_chars is -1, the size reverts to the default size.
792func (x *PasswordEntry) SetWidthChars(NCharsVar int) {
793
794	XGtkEditableSetWidthChars(x.GoPointer(), NCharsVar)
795
796}
797
798func init() {
799	core.SetPackageName("GTK", "gtk4")
800	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
801	var libs []uintptr
802	for _, libPath := range core.GetPaths("GTK") {
803		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
804		if err != nil {
805			panic(err)
806		}
807		libs = append(libs, lib)
808	}
809
810	core.PuregoSafeRegister(&xPasswordEntryGLibType, libs, "gtk_password_entry_get_type")
811
812	core.PuregoSafeRegister(&xNewPasswordEntry, libs, "gtk_password_entry_new")
813
814	core.PuregoSafeRegister(&xPasswordEntryGetExtraMenu, libs, "gtk_password_entry_get_extra_menu")
815	core.PuregoSafeRegister(&xPasswordEntryGetShowPeekIcon, libs, "gtk_password_entry_get_show_peek_icon")
816	core.PuregoSafeRegister(&xPasswordEntrySetExtraMenu, libs, "gtk_password_entry_set_extra_menu")
817	core.PuregoSafeRegister(&xPasswordEntrySetShowPeekIcon, libs, "gtk_password_entry_set_show_peek_icon")
818
819}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close