Add support for GtkSwitch
[pipeglade.git] / pipeglade.1
bloba18425ac93b9b6feef2f7acc71234dd6fa009222
1 .\" Copyright (c) 2014, 2015 Bert Burgemeister <trebbu@googlemail.com>
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be
12 .\" included in all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 .\" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 .\" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 .\" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 .\" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 .\" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 .\"
22 .Dd January 18, 2015
23 .Dt PIPEGLADE 1 CON
24 .Os BSD
25 .Sh NAME
26 .Nm pipeglade
27 .Nd Pipe-Driven GTK+ Interface
28 .Sh SYNOPSIS
29 .Nm
30 .Op Fl h
31 .Op Fl G
32 .Op Fl V
33 .Nm
34 .Op Fl i Ar in-fifo
35 .Op Fl o Ar out-fifo
36 .Op Fl u Ar builder-file
37 .Sh DESCRIPTION
38 .Nm
39 is a helper program that displays graphical user
40 interfaces for other programs.  It renders the GUI definition
41 found in a GtkBuilder XML file (created using the
42 .Xr glade 1
43 interface designer), and communicates with the main program solely
44 through plain text messages via pipes or fifos.  It provides access to
45 a subset of features of a subset of widgets of GTK+ 3.  Simple
46 one-shot dialogs as well as more complex, long-running programs can be
47 built using
48 .Nm ;
49 see
50 .Sx EXAMPLES .
51 .Sh OPTIONS
52 .Bl -tag -width Ds
53 .It Fl h
54 Prints a help message and exits.
55 .It Fl i Ar in-fifo
56 Creates a named pipe
57 .Ar in-fifo
58 if necessary, and uses it for input.  It is an error if
59 .Ar in-fifo
60 exists but is not a named pipe.  The named pipe
61 .Ar in-fifo
62 is deleted upon successful program termination.  Default is
63 .Va stdin .
64 See
65 .Sx GUI MANIPULATION COMMANDS
66 for a list of commands understood by pipeglade.
67 .It Fl o Ar out-fifo
68 Creates a named pipe
69 .Ar out-fifo
70 if necessary, and uses it for output.  It is an error if
71 .Ar out-fifo
72 exists but is not a named pipe.  The named pipe
73 .Ar out-fifo
74 is deleted upon successful program termination.  Default is
75 .Va stdout .
76 See
77 .Sx GUI FEEDBACK MESSAGES
78 for a description of possible output.
79 .It Fl u Ar builder-file
80 Displays the graphical user interface described in
81 .Ar builder-file .
82 Default is
83 .Pa ./pipeglade.ui .
84 .It Fl G
85 Prints the GTK+ version and exits.
86 .It Fl V
87 Prints the
88 .Nm pipeglade
89 version and exits.
90 .El
91 .Sh INTERFACE CREATION (USING GLADE)
92 The interface should be created using the
93 .Xr glade 1
94 user interface designer and saved in GtkBuilder (.ui) format.  Widget
95 names should be alphanumeric, including underscores.  The main window
96 must be named
97 .Ic window ;
98 its
99 .Ic destroy
100 signal should be connected to
101 .Ic gtk_main_quit .
102 Certain signals of the other widgets should be connected to
103 callbacks.  See
104 .Sx GUI FEEDBACK MESSAGES
105 for callback names and which signals of which widgets to connect to
106 them.
107 .Sh GUI MANIPULATION COMMANDS
108 A command is a line of text.  Lines whose first non-whitespace
109 character is
110 .Ic #
111 are considered comments and ignored.
112 Any occurences of the two-character sequences
113 .Ic \en
115 .Ic \er
116 will be converted into newline or carriage return, respectively.
117 Every other character following a backslash will be left unchanged,
118 but the backslash will be removed.
119 The format of the commands is
121 .Fa name Ns
122 .Ic \&: Ns
123 .Fa action
124 .Bq Fa data
126 where
127 .Fa name
128 is the name of the receiving widget.
129 .Fa data
130 is separated from the rest of the command by whitespace.
132 Invalid commands are reported on
133 .Va stderr
134 and are otherwise ignored.
136 Widgets that can be manipulated programmatically, and the relevant
137 commands, are given below.
138 .Ss GtkLabel
140 .Fa name Ns
141 .Ic :set_text
142 .Fa string
144 replaces the label text with
145 .Fa string .
146 .Ss GtkImage
148 .Fa name Ns
149 .Ic :set_from_icon_name
150 .Fa icon-name
152 replaces the image with one of the standard icons.
155 .Fa name Ns
156 .Ic :set_from_file
157 .Fa path
159 replaces the image by the one found at
160 .Fa path Ns .
161 .Ss GtkEntry
163 .Fa name Ns
164 .Ic :set_text
165 .Fa string
167 replaces the user-editable text with
168 .Fa string .
169 .Ss GtkTextView
171 .Fa name Ns
172 .Ic :set_text
173 .Fa string
175 replaces the user-editable text with
176 .Fa string Ns .
179 .Fa name Ns
180 .Ic :delete
182 deletes the text.
185 .Fa name Ns
186 .Ic :insert_at_cursor
187 .Fa string
189 inserts
190 .Fa string
191 at cursor position.
194 .Fa name Ns
195 .Ic :place_cursor Brq Fa position | Ic end
197 places the text cursor at
198 .Fa position
199 or at the end of the text.
202 .Fa name Ns
203 .Ic :place_cursor_at_line
204 .Fa line
206 places the text cursor at the beginning of
207 .Fa line .
210 .Fa name Ns
211 .Ic :scroll_to_cursor
213 scrolls to the cursor position if necessary.
214 .Ss GtkButton
216 .Fa name Ns
217 .Ic :set_label
218 .Fa string
220 replaces the button text with
221 .Fa string .
222 .Ss GtkSwitch
224 .Fa name Ns
225 .Ic :set_active Brq Ic 0 | 1
227 turns the switch off
228 .Pq Ic 0
229 or on
230 .Pq Ic 1 .
231 .Ss GtkToggleButton
233 .Fa name Ns
234 .Ic :set_active Brq Ic 0 | 1
236 switches the button off
237 .Pq Ic 0
238 or on
239 .Pq Ic 1 .
242 .Fa name Ns
243 .Ic :set_label
244 .Fa string
246 replaces the button text with
247 .Fa string .
248 .Ss GtkCheckButton
250 .Fa name Ns
251 .Ic :set_active Brq Ic 0 | 1
253 switches the check mark off
254 .Pq Ic 0
255 or on
256 .Pq Ic 1 .
259 .Fa name Ns
260 .Ic :set_label
261 .Fa string
263 replaces the button text with
264 .Fa string .
265 .Ss GtkRadioButton
267 .Fa name Ns
268 .Ic :set_active 1
270 switches the button on.  All other buttons of the same group will go off
271 automatically.
274 .Fa name Ns
275 .Ic :set_label
276 .Fa string
278 replaces the button text with
279 .Fa string .
280 .Ss GtkSpinButton
282 .Fa name Ns
283 .Ic :set_text
284 .Fa string
286 sets the selected value to
287 .Fa string .
288 .Ss GtkScale
290 .Fa name Ns
291 .Ic :set_value
292 .Fa numeric
294 moves the slider to value
295 .Fa numeric .
296 .Ss GtkProgressBar
298 .Fa name Ns
299 .Ic :set_fraction
300 .Fa numeric
302 moves the progress bar to
303 .Fa numeric
305 between 0 and 1
306 .Pc .
309 .Fa name Ns
310 .Ic :set_text
311 .Fa string
313 replaces the text of the progress bar with
314 .Fa string .
315 .Ss GtkSpinner
317 .Fa name Ns
318 .Ic :start
322 .Fa name Ns
323 .Ic :stop
325 start and stop the spinner.
326 .Ss GtkStatusbar
328 .Fa name Ns
329 .Ic :push
330 .Fa string
332 displays
333 .Fa string
334 in the statusbar.
337 .Fa name Ns
338 .Ic :pop
340 removes the last entry from the statusbar, revealing the penultimate
341 entry.
342 .Ss GtkComboBoxText
344 .Fa name Ns
345 .Ic :prepend_text
346 .Fa string
350 .Fa name Ns
351 .Ic :append_text
352 .Fa string
354 prepend/append
355 .Fa string
356 as a new selectable item.
359 .Fa name Ns
360 .Ic :insert_text
361 .Fa position string
363 inserts item
364 .Fa string
366 .Fa position .
369 .Fa name Ns
370 .Ic :remove
371 .Fa position
373 removes the item at
374 .Fa position .
375 .Ss GtkTreeView
376 .Fa row
378 .Fa column
379 refer to the underlying model (usually a
380 .Ic GtkListStore ) .
383 .Fa name Ns
384 .Ic :set
385 .Fa row column data
387 replaces the content at
388 .Pq Fa row , column
389 with
390 .Fa data
391 (which should be compatible with the type of
392 .Fa column ) .
395 .Fa name Ns
396 .Ic :insert_row Brq Fa position | Ic end
398 inserts a new, empty row at
399 .Fa position
400 or at the end of the list.
403 .Fa name Ns
404 .Ic :move_row
405 .Fa origin Brq Fa destination | Ic end
407 moves the row at
408 .Fa origin
410 .Fa destination
411 or to the end of the list.
414 .Fa name Ns
415 .Ic :remove_row
416 .Fa position
418 removes the row at
419 .Fa position .
422 .Fa name Ns
423 .Ic :scroll
424 .Fa row column
426 scrolls the cell at
427 .Pq Fa row , column
428 into view.
429 .Ss GtkColorButton
431 .Fa name Ns
432 .Ic :set_color
433 .Fa color
435 preselects the color.
436 .Fa color
437 can be given as
438 .Bl -dash -offset indent -compact
440 a standard X11 color name, like
441 .Qq Li Dark Sea Green ,
443 a hexadecimal value in the form
444 .Ic # Ns
445 .Fa rgb ,
446 .Ic # Ns
447 .Fa rrggbb ,
448 .Ic # Ns
449 .Fa rrrgggbbb ,
451 .Ic # Ns
452 .Fa rrrrggggbbbb ,
454 an RGB color in the form
455 .Ic rgb( Ns
456 .Fa r Ns
457 .Ic \&, Ns
458 .Fa g Ns
459 .Ic \&, Ns
460 .Fa b Ns
461 .Ic \&) ,
464 an RGBA color in the form
465 .Ic rgba( Ns
466 .Fa r Ns
467 .Ic \&, Ns
468 .Fa g Ns
469 .Ic \&, Ns
470 .Fa b Ns
471 .Ic \&, Ns
472 .Fa a Ns
473 .Ic \&) .
475 The last two are in the format the widget reports; see
476 .Sx GUI FEEDBACK MESSAGES .
477 .Ss GtkFontButton
479 .Fa name Ns
480 .Ic :set_font_name
481 .Fa fontname
483 preselects the font.
484 .Ss GtkFileChooserButton
486 .Fa name Ns
487 .Ic :set_filename
488 .Fa path
490 preselects
491 .Fa path
492 to the extent it exists.
493 .Ss GtkFileChooserDialog
495 .Fa name Ns
496 .Ic :set_filename
497 .Fa path
499 preselects
500 .Fa path
501 to the extent it exists.
504 .Fa name Ns
505 .Ic :set_current_name
506 .Fa string
508 makes
509 .Fa string
510 the suggested filename, which may not yet exist.
511 .Fa string
512 should either resemble an absolute path, or the
513 .Fa directory
514 must be set
515 separately by
516 .Fa name Ns
517 .Ic :set_filename
518 .Fa directory .
519 .Ss GtkCalendar
521 .Fa name Ns
522 .Ic :select_date
523 .Fa date
525 selects
526 .Fa date
527 .Pq Li yyyy-mm-dd
528 on the calendar.
531 .Fa name Ns
532 .Ic :mark_day
533 .Fa day
535 marks
536 .Fa day
537 .Pq 1-31
538 on the calendar.
541 .Fa name Ns
542 .Ic :clear_marks
544 unmarks all days on the calendar.
545 .Ss Main Window
547 .Fa name Ns
548 .Ic :main_quit
550 kills the user interface.  A non-empty
551 .Fa name
552 is required but ignored.
553 .Ss Any Widget
555 .Fa name Ns
556 .Ic :set_sensitive
557 .Brq Ic 0 |  1
559 makes the widget grayed out
560 .Pq Ic 0
561 or responsive
562 .Pq Ic 1 .
565 .Fa name Ns
566 .Ic :set_visible
567 .Brq Ic 0 |  1
569 hides
570 .Pq Ic 0
571 the widget, or makes it visible
572 .Pq Ic 1 .
575 .Fa name Ns
576 .Ic :force_cb
578 initiates the standard callback.  The
579 .Fa name Ns
580 d widget
581 responds as if
582 .Ic cb_0
583 had been activated, but with a different
584 .Fa section
585 code:
587 .Fa name Ns
588 .Ic :forced
589 .Fa data
590 .Qc .
591 The command doesn't change anything on the GUI.
592 .Sh GUI FEEDBACK MESSAGES
593 A message from the graphical user interface is a line of text.  The
594 message format is 
596 .Fa name Ns
597 .Ic \&: Ns
598 .Fa section data
599 .Qc .
600 Message sending is initiated by callbacks.  Callbacks are connected to
601 certain signals; this has to be done in
602 .Xr glade 1
603 as part of the interface design.
605 provides the following callbacks:
606 .Bl -dash -offset indent -compact
608 .Ic cb_0 , cb_1 , cb_2 ,
610 .Ic cb_3
611 are callbacks for use in various widgets.  Their action depends on the
612 particular widget they are called from.  The callbacks are identical
613 except for the 
614 .Fa section
615 strings they send; the respective messages look like
617 .Fa name Ns
618 .Ic :0
619 .Fa  data
620 .Qc ,
622 .Fa name Ns
623 .Ic :1
624 .Fa  data
625 .Qc ,
627 .Fa name Ns
628 .Ic :2
629 .Fa  data
630 .Qc ,
633 .Fa name Ns
634 .Ic :3
635 .Fa  data
636 .Qc .
638 .Ic cb_hide_toplevel
639 is a callback that hides the window the originator is in.  Its main
640 purpose is hiding of dialog windows.  It doesn't report anything.
642 .Ic cb_send_dialog_selection
643 is a callback that sends the item the user has selected in a dialog.
644 It reports
646 .Fa name Ns
647 .Ic :file
648 .Fa path
650 and/or
652 .Fa name Ns
653 .Ic :folder
654 .Fa path
655 .Qc .
657 .Ic cb_send_text
658 is a callback that sends the content of the GtkTextBuffer that is
659 passed as user data.  It reports
661 .Fa name Ns
662 .Ic :text
663 .Fa buffer_text
664 .Qc .
665 Line endings in
666 .Fa buffer_text
667 are replaced by
668 .Ic \en , 
669 and backslashes are replaced by
670 .Ic \e\e .
672 .Ic cb_send_text_selection
673 is a callback that sends the highlighted part of the GtkTextBuffer
674 that is passed as user data.  It reports
676 .Fa name Ns
677 .Ic :text
678 .Fa highlighted_text
679 .Qc .
680 Line endings in
681 .Fa highlighted_text
682 are replaced by
683 .Ic \en ,
684 and backslashes are replaced by
685 .Ic \e\e .
688 The widgets capable of reporting user activity are:
689 .Ss GtkTextView
690 There should be a dedicated
691 .Ic GtkButton
692 for sending (parts of) the text.
694 .Ic clicked
695 signal of the
696 .Ic GtkButton
697 should be connected to either
698 .Ic cb_send_text
700 .Ic cb_send_text_selection ,
701 specifying the
702 .Ic GtkTextBuffer
703 underlying the
704 .Ic GtkTextView
706 .Ic User Data .
708 .Ic GtkButton
709 reports
711 .Fa name Ns
712 .Ic :text
713 .Fa text
714 .Qc ,
715 .Fa name
716 being the name of the
717 .Ic GtkButton.
718 .Ss GtkButton
720 .Ic clicked
721 signal should be connected to one of
722 .Ic cb_0 , cb_1 , cb_2 ,
724 .Ic cb_3 .
725 The widget reports
727 .Fa name Ns
728 .Ic \&: Ns
729 .Fa section
730 .Ic clicked
731 .Qc .
732 .Ss GtkSwitch
734 .Ic state-set
735 signal should be connected to one of
736 .Ic cb_0 , cb_1 , cb_2 ,
738 .Ic cb_3 .
739 The widget reports
741 .Fa name Ns
742 .Ic \&: Ns
743 .Fa section
744 .Ic 1
746 if it is switched on, or
748 .Fa name Ns
749 .Ic \&: Ns
750 .Fa section
751 .Ic 0
753 otherwise.
754 .Ss GtkToggleButton, GtkCheckButton, GtkRadioButton
756 .Ic toggled
757 signal should be connected to one of
758 .Ic cb_0 , cb_1 , cb_2 ,
760 .Ic cb_3 .
761 The widgets report
763 .Fa name Ns
764 .Ic \&: Ns
765 .Fa section
766 .Ic 1
768 if they are switched on, or
770 .Fa name Ns
771 .Ic \&: Ns
772 .Fa section
773 .Ic 0
775 otherwise.
776 .Ss GtkEntry, GtkComboBoxText, GtkSpinButton
778 .Ic changed
779 signal should be connected to one of
780 .Ic cb_0 , cb_1 , cb_2 ,
782 .Ic cb_3 .
783 The widgets report
785 .Fa name Ns
786 .Ic \&: Ns
787 .Fa section text
788 .Qc .
789 .Ss GtkScale
791 .Ic value-changed
792 signal should be connected to one of
793 .Ic cb_0 , cb_1 , cb_2 ,
795 .Ic cb_3 .
796 The widget reports
798 .Fa name Ns
799 .Ic \&: Ns
800 .Fa section floating_point_text
801 .Qc .
802 .Ss GtkTreeView
804 .Ic changed
805 signal in the subordinated
806 .Ic GtkTreeSelection
807 should be connected to one of
808 .Ic cb_0 , cb_1 , cb_2 ,
810 .Ic cb_3 .
811 The widget reports
813 .Fa name Ns
814 .Ic \&:clicked
816 and, if the set of selected rows has changed,
818 .Fa name Ns
819 .Ic \&: Ns
820 .Fa section row column value
821 .Qc ,
822 one message per row and column in the underlying model.
824 can deal with columns of type
825 .Ic gboolean , gint , guint , glong , gulong , gint64 , guint64 , gfloat , gdouble ,
827 .Ic gchararray .
828 .Ss GtkTreeViewColumn
830 .Ic clicked
831 signal should be connected to one of
832 .Ic cb_0 , cb_1 , cb_2 ,
834 .Ic cb_3 .
835 The widget reports
837 .Fa name Ns
838 .Ic \&: Ns
839 .Fa section
840 .Ic clicked
841 .Qc .
842 .Ss GtkFileChooserDialog (when subordinated to another window)
844 .Ic delete-event
845 signal should be connected to
846 .Ic cb_0 .
847 The name of the
848 .Ic GtkFileChooserDialog
849 widget should end in
850 .Ic _dialog ,
851 eg.\&
852 .Fa some_name Ns
853 .Ic _dialog .
854 Then, a
855 .Ic GtkMenuItem
857 .Ic GtkImageMenuItem
858 named
859 .Fa some_name
860 will invoke the
861 .Ic GtkFileChooserDialog
862 (see
863 .Sx GtkMenuItem, GtkImageMenuItem
864 for their setup).  The
865 .Ic GtkFileChooserDialog
866 should have an
867 .Sq OK
868 .Ic GtkBbutton
869 that has its
870 .Ic clicked
871 signal connected to both
872 .Ic cb_send_dialog_selection
874 .Ic cb_hide_toplevel .
876 .Sq Cancel
877 .Ic GtkButton
878 should have its
879 .Ic clicked
880 signal connected to
881 .Ic cb_hide_toplevel .
882 The widget reports
884 .Fa name Ns
885 .Ic :file
886 .Fa  pathname
888 and/or
890 .Fa name Ns
891 .Ic :folder
892 .Fa  pathname
893 .Qc .
894 .Ss GtkFileChooserDialog (as the sole window)
895 Both the
896 .Ic delete-event
897 and the
898 .Ic destroy
899 signal should be connected to
900 .Ic gtk_main_quit .
902 .Ic GtkFileChooserDialog
903 should have an
904 .Sq OK
905 .Ic GtkBbutton
906 that has its
907 .Ic clicked
908 signal connected to both
909 .Ic cb_send_dialog_selection
911 .Ic gtk_main_quit .
913 .Sq Cancel
914 .Ic GtkButton
915 should have its
916 .Ic clicked
917 signal connected to
918 .Ic gtk_main_quit .
919 The widget reports
921 .Fa name Ns
922 .Ic :file
923 .Fa  pathname
925 and/or
927 .Fa name Ns
928 .Ic :folder
929 .Fa  pathname
930 .Qc .
931 .Ss GtkDialog (when subordinated to another window)
933 .Ic delete-event
934 signal should be connected to
935 .Ic cb_0 .
936 The name of the
937 .Ic GtkDialog
938 widget should end in
939 .Ic _dialog ,
941 .Fa some_name Ns
942 .Ic _dialog .
943 Then, a
944 .Ic GtkMenuItem
946 .Ic GtkImageMenuItem
947 named
948 .Fa some_name
949 will invoke the
950 .Ic GtkDialog
951 (see
952 .Sx GtkMenuItem, GtkImageMenuItem
953 for their setup).  The
954 .Ic GtkDialog
955 should have a
956 .Sq Cancel
957 .Ic GtkBbutton
958 that has its
959 .Ic clicked
960 signal connected to
961 .Ic cb_hide_toplevel .
962 The widget doesn't report anything.
963 .Ss GtkDialog (as the sole window)
964 Both the
965 .Ic delete-event
966 and the
967 .Ic destroy
968 signal should be connected to
969 .Ic gtk_main_quit .
971 .Ic GtkDialog
972 should have a
973 .Sq Cancel
974 .Ic GtkBbutton
975 that has its
976 .Ic clicked
977 signal connected to
978 .Ic gtk_main_quit .
979 The widget doesn't report anything.
980 .Ss GtkFileChooserButton
982 .Ic file-set
983 signal should be connected to one of
984 .Ic cb_0 , cb_1 , cb_2 ,
986 .Ic cb_3 .
987 The widget reports
989 .Fa name Ns
990 .Ic \&: Ns
991 .Fa section pathname
993 if the user has changed the selection.
994 .Ss GtkColorButton
996 .Ic color-set
997 signal should be connected to one of
998 .Ic cb_0 , cb_1 , cb_2 ,
1000 .Ic cb_3 .
1001 The widget reports
1003 .Fa name Ns
1004 .Ic \&: Ns
1005 .Fa section
1006 .Ic rgb( Ns
1007 .Fa red Ns
1008 .Ic \&, Ns
1009 .Fa green Ns
1010 .Ic \&, Ns
1011 .Fa blue Ns
1012 .Ic \&)
1016 .Fa name Ns
1017 .Ic \&: Ns
1018 .Fa section
1019 .Ic rgb( Ns
1020 .Fa red Ns
1021 .Ic \&, Ns
1022 .Fa green Ns
1023 .Ic \&, Ns
1024 .Fa blue Ns
1025 .Ic \&, Ns
1026 .Fa alpha Ns
1027 .Ic \&)
1028 .Qc ;
1029 .Fa red , green ,
1031 .Fa blue
1032 lie between 0 and 255, and
1033 .Fa alpha
1034 between 0 and 1.
1035 .Ss GtkFontButton
1037 .Ic font-set
1038 signal should be connected to one of
1039 .Ic cb_0 , cb_1 , cb_2 ,
1041 .Ic cb_3 .
1042 The widget reports
1044 .Fa name Ns
1045 .Ic \&: Ns
1046 .Fa section fontname
1047 .Qc .
1048 .Ss GtkMenuItem, GtkImageMenuItem
1050 .Ic activate
1051 signal should be connected to one of
1052 .Ic cb_0 , cb_1 , cb_2 ,
1054 .Ic cb_3 .
1056 .Ic GtkMenuItem
1058 .Ic GtkImageMenuItem
1059 with the name
1060 .Fa some_item
1061 will invoke the
1062 .Ic GtkDialog
1064 .Ic GtkFileChooserDialog
1065 named
1066 .Fa some_item Ns
1067 .Ic _dialog
1068 if it exists.  If there isn't any dialog attached to the
1069 .Ic GtkMenuItem ,
1070 it reports
1072 .Fa name Ns
1073 .Ic \&: Ns
1074 .Fa section label
1075 .Qc .
1076 .Ss GtkCalendar
1077 One or both of the
1078 .Ic day-selected
1080 .Ic day-selected-doubleclick
1081 signals should be connected to one or two of
1082 .Ic cb_0 , cb_1 , cb_2 ,
1084 .Ic cb_3 .
1085 The widget reports
1087 .Fa name Ns
1088 .Ic \&: Ns
1089 .Fa section date
1091 with
1092 .Fa date
1093 formatted
1094 .Li yyyy-mm-dd .
1095 .Sh EXAMPLES
1096 .Ss Discovering Pipeglade Interactively
1097 Suppose the interface in
1098 .Pa ./pipeglade.ui
1099 has a
1100 .Ic GtkLabel
1101 .Li l1
1102 and a
1103 .Ic GtkButton
1104 .Li b1
1105 whose
1106 .Ic clicked
1107 signal is connected to
1108 .Ic cb_0 .
1109 After invoking
1110 .Dl pipeglade
1111 and clicking the
1112 .Ic GtkButton ,
1113 .Qq b1:0 clicked
1114 will be reported on the terminal.  Typing
1115 .Dl l1:set_text Button Label
1116 will change the text shown on the label into
1117 .Qq Button Label .
1118 .Ss One-Shot File Dialog
1119 Suppose the interface in
1120 .Pa ./simple_open.ui
1121 contains a
1122 .Ic GtkFileChooserDialog
1123 with an
1124 .Sq OK
1125 .Ic GtkButton
1126 whose
1127 .Ic clicked
1128 signal is connected to both
1129 .Ic cb_send_dialog_selection
1131 .Ic gtk_main_quit .
1132 Invoking
1133 .Dl pipeglade -u simple_open.ui
1134 will open the dialog; pressing
1135 .Sq OK
1136 will close it after sending the selected filename to
1137 .Va stdout .
1138 .Ss One-Shot User Notification
1139 If the interface in
1140 .Pa ./simple_dialog.ui
1141 contains a
1142 .Ic GtkLabel
1143 .Li label1 ,
1144 then
1145 .Dl pipeglade -u simple_dialog.ui <<< \e
1146 .Dl \ \ \ \ \&"label1:set_text NOW READ THIS!\&"
1147 will set the label text accordingly and wait for user input.
1148 .Ss Continuous Input
1149 The following shell command displays a running clock:
1150 .Dl while true; do
1151 .Dl \ \ \ \ echo \&"label1:set_text `date`\&";
1152 .Dl \ \ \ \ sleep 1;
1153 .Dl done | pipeglade -u simple_dialog.ui
1154 .Ss Continuous Input and Output
1155 The following shell script fragment sets up
1157 for continuous communication with another program,
1158 .Li main_prog :
1159 .Dl pipeglade -i in.fifo -o out.fifo &
1160 .Dl # wait for in.fifo and out.fifo to appear
1161 .Dl while test \& ! \e( -e in.fifo -a -e out.fifo \e); do :; done
1162 .Dl main_prog <out.fifo >in.fifo
1163 .Sh EXIT STATUS
1165 exits 0 on success, and >0 if an error occurs.
1166 .Sh SEE ALSO
1167 .Xr glade 1 ,
1168 .Xr dialog 1 ,
1169 .Xr gmessage 1 ,
1170 .Xr kdialog 1 ,
1171 .Xr whiptail 1 ,
1172 .Xr xmessage 1 ,
1173 .Xr zenity 1
1174 .Sh AUTHOR
1176 was written by
1177 .An Bert Burgemeister Aq trebbu@googlemail.com .
1178 .\" .Sh BUGS