summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkentry.sgml
blob: 9d2c262ac5c0d48e4d014521ee891c72a8e43af1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
<!-- ##### SECTION Title ##### -->
GtkEntry

<!-- ##### SECTION Short_Description ##### -->
A single line text entry field

<!-- ##### SECTION Long_Description ##### -->
<para>
The #GtkEntry widget is a single line text entry
widget. A fairly large set of key bindings are supported
by default. If the entered text is longer than the allocation
of the widget, the widget will scroll so that the cursor
position is visible. 
</para>
<para>
When using an entry for passwords and other sensitive information,
it can be put into "password mode" using gtk_entry_set_visibility(). 
In this mode, entered text is displayed using a 'invisible' character.
By default, GTK+ picks the best invisible character that is available
in the current font, but it can be changed with 
gtk_entry_set_invisible_char(). Since 2.16, GTK+ displays a warning
when Caps Lock or input methods might interfere with entering text in
a password entry. The warning can be turned off with the 
#GtkEntry::caps-lock-warning property.
</para>
<para>
Since 2.16, GtkEntry has the ability to display progress or activity 
information behind the text. To make an entry display such information, 
use gtk_entry_set_progress_fraction() or gtk_entry_set_progress_pulse_step().
</para>
<para>
Additionally, GtkEntry can show icons at either side of the entry. These
icons can be activatable by clicking, can be set up as drag source and
can have tooltips. To add an icon, use gtk_entry_set_icon_from_gicon() or
one of the various other functions that set an icon from a stock id, an
icon name or a pixbuf. To trigger an action when the user clicks an icon,
connect to the #GtkEntry::icon-press signal. To allow DND operations
from an icon, use gtk_entry_set_icon_drag_source(). To set a tooltip on 
an icon, use gtk_entry_set_icon_tooltip_text() or the corresponding function
for markup.
</para>
<para>
Note that functionality or information that is only available by clicking 
on an icon in an entry may not be accessible at all to users which are not 
able to use a mouse or other pointing device. It is therefore recommended 
that any such functionality should also be available by other means, e.g. 
via the context menu of the entry.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
<variablelist>

<varlistentry>
<term>#GtkTextView</term>
<listitem><para>a widget for handling multi-line text entry.</para></listitem>
</varlistentry>

<varlistentry>
<term>#GtkEntryCompletion</term>
<listitem><para>adds completion functionality to GtkEntry.</para></listitem>
</varlistentry>

</variablelist>
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GtkEntry ##### -->
<para>
The #GtkEntry-struct struct contains only private data.
</para>


<!-- ##### SIGNAL GtkEntry::activate ##### -->
<para>

</para>

@entry: the object which received the signal.

<!-- ##### SIGNAL GtkEntry::backspace ##### -->
<para>

</para>

@entry: the object which received the signal.

<!-- ##### SIGNAL GtkEntry::copy-clipboard ##### -->
<para>

</para>

@entry: the object which received the signal.

<!-- ##### SIGNAL GtkEntry::cut-clipboard ##### -->
<para>

</para>

@entry: the object which received the signal.

<!-- ##### SIGNAL GtkEntry::delete-from-cursor ##### -->
<para>

</para>

@entry: the object which received the signal.
@arg1: 
@arg2: 

<!-- ##### SIGNAL GtkEntry::icon-press ##### -->
<para>

</para>

@entry: the object which received the signal.
@arg1: 
@event: 

<!-- ##### SIGNAL GtkEntry::icon-release ##### -->
<para>

</para>

@entry: the object which received the signal.
@arg1: 
@event: 

<!-- ##### SIGNAL GtkEntry::insert-at-cursor ##### -->
<para>

</para>

@entry: the object which received the signal.
@arg1: 

<!-- ##### SIGNAL GtkEntry::move-cursor ##### -->
<para>

</para>

@entry: the object which received the signal.
@arg1: 
@arg2: 
@arg3: 

<!-- ##### SIGNAL GtkEntry::paste-clipboard ##### -->
<para>

</para>

@entry: the object which received the signal.

<!-- ##### SIGNAL GtkEntry::populate-popup ##### -->
<para>

</para>

@entry: the object which received the signal.
@arg1: 

<!-- ##### SIGNAL GtkEntry::toggle-overwrite ##### -->
<para>

</para>

@entry: the object which received the signal.

<!-- ##### ARG GtkEntry:activatable-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:activatable-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:activates-default ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:caps-lock-warning ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:cursor-position ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:editable ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:gicon-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:gicon-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:has-frame ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:icon-name-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:icon-name-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:inner-border ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:invisible-char ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:invisible-char-set ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:max-length ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:overwrite-mode ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:pixbuf-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:pixbuf-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:progress-fraction ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:progress-pulse-step ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:scroll-offset ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:selection-bound ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:sensitive-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:sensitive-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:shadow-type ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:stock-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:stock-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:storage-type-primary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:storage-type-secondary ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:text ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:text-length ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:truncate-multiline ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:visibility ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:width-chars ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:xalign ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:inner-border ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:prelight ##### -->
<para>

</para>

<!-- ##### ARG GtkEntry:state-hint ##### -->
<para>

</para>

<!-- ##### FUNCTION gtk_entry_new ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gtk_entry_new_with_max_length ##### -->
<para>
</para>

@max: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_text ##### -->
<para>

</para>

@entry: 
@text: 


<!-- ##### FUNCTION gtk_entry_append_text ##### -->
<para>

</para>

@entry: 
@text: 


<!-- ##### FUNCTION gtk_entry_prepend_text ##### -->
<para>

</para>

@entry: 
@text: 


<!-- ##### FUNCTION gtk_entry_set_position ##### -->
<para>

</para>

@entry: 
@position: 


<!-- ##### FUNCTION gtk_entry_get_text ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_text_length ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_select_region ##### -->
<para>

</para>

@entry: 
@start: 
@end: 


<!-- ##### FUNCTION gtk_entry_set_visibility ##### -->
<para>

</para>

@entry: 
@visible: 


<!-- ##### FUNCTION gtk_entry_set_invisible_char ##### -->
<para>

</para>

@entry: 
@ch: 


<!-- ##### FUNCTION gtk_entry_unset_invisible_char ##### -->
<para>

</para>

@entry: 


<!-- ##### FUNCTION gtk_entry_set_editable ##### -->
<para>

</para>

@entry: 
@editable: 


<!-- ##### FUNCTION gtk_entry_set_max_length ##### -->
<para>
</para>

@entry: 
@max: 


<!-- ##### FUNCTION gtk_entry_get_activates_default ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_has_frame ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_inner_border ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_width_chars ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_activates_default ##### -->
<para>

</para>

@entry: 
@setting: 


<!-- ##### FUNCTION gtk_entry_set_has_frame ##### -->
<para>

</para>

@entry: 
@setting: 


<!-- ##### FUNCTION gtk_entry_set_inner_border ##### -->
<para>

</para>

@entry: 
@border: 


<!-- ##### FUNCTION gtk_entry_set_width_chars ##### -->
<para>

</para>

@entry: 
@n_chars: 


<!-- ##### FUNCTION gtk_entry_get_invisible_char ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_alignment ##### -->
<para>

</para>

@entry: 
@xalign: 


<!-- ##### FUNCTION gtk_entry_get_alignment ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_overwrite_mode ##### -->
<para>

</para>

@entry: 
@overwrite: 


<!-- ##### FUNCTION gtk_entry_get_overwrite_mode ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_layout ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_layout_offsets ##### -->
<para>

</para>

@entry: 
@x: 
@y: 


<!-- ##### FUNCTION gtk_entry_layout_index_to_text_index ##### -->
<para>

</para>

@entry: 
@layout_index: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_text_index_to_layout_index ##### -->
<para>

</para>

@entry: 
@text_index: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_max_length ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_visibility ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_completion ##### -->
<para>

</para>

@entry: 
@completion: 


<!-- ##### FUNCTION gtk_entry_get_completion ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_cursor_hadjustment ##### -->
<para>

</para>

@entry: 
@adjustment: 


<!-- ##### FUNCTION gtk_entry_get_cursor_hadjustment ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_progress_fraction ##### -->
<para>

</para>

@entry: 
@fraction: 


<!-- ##### FUNCTION gtk_entry_get_progress_fraction ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_progress_pulse_step ##### -->
<para>

</para>

@entry: 
@fraction: 


<!-- ##### FUNCTION gtk_entry_get_progress_pulse_step ##### -->
<para>

</para>

@entry: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_progress_pulse ##### -->
<para>

</para>

@entry: 


<!-- ##### ENUM GtkEntryIconPosition ##### -->
<para>
Specifies the side of the entry at which an icon is placed.
</para>

@GTK_ENTRY_ICON_PRIMARY: At the beginning of the entry (depending on the text direction).
@GTK_ENTRY_ICON_SECONDARY: At the end of the entry (depending on the text direction).

<!-- ##### FUNCTION gtk_entry_set_icon_from_pixbuf ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@pixbuf: 


<!-- ##### FUNCTION gtk_entry_set_icon_from_stock ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@stock_id: 


<!-- ##### FUNCTION gtk_entry_set_icon_from_icon_name ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@icon_name: 


<!-- ##### FUNCTION gtk_entry_set_icon_from_gicon ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@icon: 


<!-- ##### FUNCTION gtk_entry_get_storage_type ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_pixbuf ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_stock ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_icon_name ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_gicon ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_icon_activatable ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@activatable: 


<!-- ##### FUNCTION gtk_entry_get_icon_activatable ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_icon_sensitive ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@sensitive: 


<!-- ##### FUNCTION gtk_entry_get_icon_sensitive ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_get_icon_at_pos ##### -->
<para>

</para>

@entry: 
@x: 
@y: 
@Returns: 


<!-- ##### FUNCTION gtk_entry_set_icon_tooltip_text ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@tooltip: 


<!-- ##### FUNCTION gtk_entry_set_icon_tooltip_markup ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@tooltip: 


<!-- ##### FUNCTION gtk_entry_set_icon_drag_source ##### -->
<para>

</para>

@entry: 
@icon_pos: 
@target_list: 
@actions: 


<!-- ##### FUNCTION gtk_entry_get_current_icon_drag_source ##### -->
<para>

</para>

@entry: 
@Returns: