Fix regressions introduced in previous commit
[pipeglade.git] / pipeglade.1
blobd912732eb76833ed7c12bf5702bcdcaa00c053be
1 .\" Copyright (c) 2014-2016 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 April 29, 2016
23 .Dt PIPEGLADE 1 PRM
24 .Os BSD
25 .Sh NAME
26 .Nm pipeglade
27 .Nd pipe-driven GTK+ interface
28 .Sh SYNOPSIS
29 .Nm
30 .Oo
31 .Op Fl i Ar in-fifo
32 .Op Fl o Ar out-fifo
33 .Op Fl b
34 .Op Fl u Ar builder-file
35 .Op Fl e Ar parent-xid
36 .Op Fl l Ar log-file
37 .Op Fl O Ar err-file
38 .Op Fl -display Ar X-server
39 .Oc |
40 .Op Fl h | G | V
41 .Sh DESCRIPTION
42 .Nm
43 is a helper program that displays graphical user
44 interfaces for other programs.
45 It renders the GUI definition found in a GtkBuilder XML file
46 (typically created using the
47 .Xr glade 1
48 interface designer), and communicates with the main program solely
49 through plain text messages via pipes or fifos.
50 It provides access to a subset of features of a subset of widgets of
51 GTK+ 3.
52 Simple one-shot dialogs as well as more complex, long-running programs
53 can be built using
54 .Nm ;
55 see
56 .Sx EXAMPLES .
57 .Sh OPTIONS
58 .Bl -tag -width Ds
59 .It Fl i Ar in-fifo
60 Creates a named pipe
61 .Ar in-fifo
62 if necessary, and uses it for command input.
63 .Pp
64 A command is a line of text.
65 Its format is
66 .Qq Ar id Ns Cm \&: Ns Ar action Bq Ar data ,
67 .Ar id
68 being the name of the receiving widget;
69 .Ar data
70 is separated from the rest of the command by a single whitespace
71 character.
72 Commands whose first non-whitespace character is
73 .Cm #
74 are considered comments and ignored silently, as are empty input lines.
75 Any occurences of the two-character sequences
76 .Cm \en
77 and
78 .Cm \er
79 will be converted into newline or carriage return, respectively.
80 Every other character following a backslash will be left unchanged,
81 but the backslash will be removed.
82 Invalid commands are reported on
83 .Va stderr
84 and are otherwise ignored.
85 See
86 .Sx WIDGETS
87 for applicable commands.
88 .Pp
89 It is an error if
90 .Ar in-fifo
91 exists but is not a named pipe.
92 The named pipe
93 .Ar in-fifo
94 is deleted upon successful program termination.
95 .Pp
96 Default command input is
97 .Va stdin .
98 .It Fl o Ar out-fifo
99 Creates a named pipe
100 .Ar out-fifo
101 if necessary, and uses it for output of feedback messages from the
102 graphical user interface.
104 A feedback message is a line of text; its format is
105 .Qq Ar id Ns Cm \&: Ns Ar info Bq Ar data ,
106 .Ar id
107 being the name of the sending widget.
109 .Sx WIDGETS
110 for possible feedback messages.
112 It is an error if
113 .Ar out-fifo
114 exists but is not a named pipe.
115 The named pipe
116 .Ar out-fifo
117 is deleted upon successful program termination.
119 Default feedback-message output is
120 .Va stdout .
121 .It Fl b
122 Runs
124 in the background after printing its process ID to
125 .Va stdout .
127 It is an error if option
128 .Fl b
129 is used and not both
130 .Fl i Ar in-fifo
132 .Fl o Ar out_fifo
133 are specified.
134 .It Fl u Ar builder-file
135 Displays the graphical user interface
136 .Ar builder-file
137 which should be created using the
138 .Xr glade 1
139 user interface designer and saved in GtkBuilder (.ui) format.
140 Widget ids should be alphanumeric, including underscores, and the
141 main window must must be given the id
142 .Cm main .
144 Default is
145 .Pa ./pipeglade.ui .
146 .It Fl e Ar parent-xid
147 Embeds the main window into the XEmbed socket
148 .Ar parent-xid
149 of another process.
150 .It Fl l Ar log-file
151 For each command, append to
152 .Ar log-file
153 a line of
154 .Qq Ar time activity
155 where
156 .Ar time
157 is the number of microseconds elapsed during
158 .Ar activity .
159 .Ar time
161 .Ar activity
162 are separated by a tab character.
164 .Ar log-file
165 name of
166 .Ql -
167 means
168 .Va stderr .
169 .It Fl O Ar err-file
170 Redirects
171 .Va stderr
173 .Ar err-file .
174 .It Fl -display Ar X-server
175 Uses the display on
176 .Ar X-server
177 for user interaction.
178 .It Fl h
179 Prints a help message and exits.
180 .It Fl G
181 Prints the versions of the underlying GTK+ and cairo libraries and
182 exits.
183 .It Fl V
184 Prints the
186 version and exits.
188 .Sh WIDGETS
189 The widget classes able to communicate through
192 .Sx GtkButton ,
193 .Sx GtkCalendar ,
194 .Sx GtkCheckButton ,
195 .Sx GtkColorButton ,
196 .Sx GtkComboBoxText ,
197 .Sx GtkDialog ,
198 .Sx GtkDrawingArea ,
199 .Sx GtkEntry ,
200 .Sx GtkEventBox ,
201 .Sx GtkExpander ,
202 .Sx GtkFileChooserButton ,
203 .Sx GtkFileChooserDialog ,
204 .Sx GtkFontButton ,
205 .Sx GtkFrame ,
206 .Sx GtkImage ,
207 .Sx GtkLabel ,
208 .Sx GtkMenuItem, GtkImageMenuItem ,
209 .Sx GtkNotebook ,
210 .Sx GtkPrintUnixDialog ,
211 .Sx GtkProgressBar ,
212 .Sx GtkRadioButton ,
213 .Sx GtkScale ,
214 .Sx GtkScrolledWindow
215 .Sx GtkSocket ,
216 .Sx GtkSpinButton ,
217 .Sx GtkSpinner ,
218 .Sx GtkStatusbar ,
219 .Sx GtkSwitch ,
220 .Sx GtkTextView ,
221 .Sx GtkToggleButton ,
222 .Sx GtkTreeView ,
223 .Sx GtkTreeViewColumn ,
225 .Sx GtkWindow .
228 references a widget by the
229 .Ar id
230 attribute it is given in Glade.
231 In the
232 .Pa .ui
233 file, a
234 .Cm GtkWindow
235 named
236 .Li foo
237 would appear as
238 .Dl <object class="GtkWindow" id="foo"> .
239 .Ss Any Widget (including widgets not mentioned above)
240 .Bl -tag -width "commands "
241 .It Commands
242 .Qq Ar id Ns Cm :set_sensitive Brq Cm 0 | 1
243 makes the widget grayed out
244 .Pq Cm 0
245 or responsive
246 .Pq Cm 1 .
248 .Qq Ar id Ns Cm :set_visible Brq Cm 0 | 1
249 hides
250 .Pq Cm 0
251 the widget, or makes it visible
252 .Pq Cm 1 .
254 .Qq Ar id Ns Cm :grab_focus
255 puts the keyboard focus onto the widget, if possible.
257 .Qq Ar id Ns Cm :set_size_request Bq Ar width height
258 sets the widget's minimum size to
259 .Ar width
261 .Ar height .
262 Default is the widget's natural size.
265 .Ar id Ns Cm :style
266 .Bo Ar prop Ns Cm \&: Ns Ar val Ns Bo Cm \&; Ar prop Ns Cm \&: Ns Ar val ... Bc Bc
268 sets properties
269 .Ar prop
270 of the widget style to
271 .Ar val .
272 Properties not explicitly specified are reset to their default values.
273 Examples:
274 .Bl -dash -offset indent -compact
276 .Ql label1:style font:Bold 11; background-color:green
278 .Ql label1:style font-style:italic; font-weight:bold; color:blue
280 .Ql frame1:style border-color:red yellow; border-width:5px
282 .Ql frame1:style border-radius:10px; transition:10s
284 For a description of possible color notations see
285 .Sx GtkColorButton .
287 .Qq Ar id Ns Cm :set_tooltip_text Bq Ar text
288 sets the widget's tooltip
289 .Ar text .
290 Default is disabling the tooltip.
292 .Qq Ar id Ns Cm :force
293 simulates a click on widget
294 .Ar id ,
295 triggering a response as described with the widgets below.
296 Exceptions:
297 .Bl -dash -offset indent -compact
299 The command is ignored by
300 .Sx GtkComboBoxText
301 (address its child
302 .Sx GtkEntry
303 instead),
304 .Sx GtkEventBox ,
305 .Sx GtkTreeView ,
307 .Sx GtkTreeViewColumn ;
309 .Sx GtkCalendar , GtkEntry , GtkFileChooserButton , GtkScale ,
311 .Sx GtkSpinButton
312 report the currently selected item;
314 .Sx GtkColorButton
316 .Sx GtkFontButton
317 just open their respective dialogs.
320 .Qq Ar id Ns Cm :load Ar file
321 reads arbitrary
323 commands from
324 .Ar file .
325 A non-empty
326 .Ar id
327 is required but ignored.
328 .Cm :load
329 commands may be nested but on attempts to read from the same file, the
330 inner
331 .Cm :load
332 is ignored.
333 There is also a
334 .Cm :save
335 command; see
336 .Sx GtkTextView
338 .Sx GtkTreeView .
340 .Qq Ar id Ns Cm :main_quit
341 kills the user interface.
342 A non-empty
343 .Ar id
344 is required but ignored.
346 .Ss GtkButton
347 .Bl -tag -width "commands "
348 .It Commands
349 .Qq Ar id Ns Cm :set_label Ar string
350 replaces the button text with
351 .Ar string .
352 .It Feedback
353 .Qq Ar id Ns Cm \&:clicked
355 .Cm GtkButton Ns
356 s with ids ending in
357 .Cm _ok , _apply , _cancel , _send_text ,
359 .Cm _send_selection
360 may work differently; see
361 .Sx GtkDialog , GtkFileChooserDialog ,
363 .Sx GtkTextView
364 for details.
366 .Ss GtkCalendar
367 .Bl -tag -width "commands "
368 .It Commands
369 .Qq Ar id Ns Cm :select_date Ar yyyy Ns Cm - Ns Ar mm Ns Cm - Ns Ar dd
370 selects the date on the calendar.
372 .Qq Ar id Ns Cm :mark_day Ar day
373 marks
374 .Ar day Pq 1-31
375 on the calendar.
377 .Qq Ar id Ns Cm :clear_marks
378 unmarks all days on the calendar.
379 .It Feedback
380 .Qq Ar id Ns Cm \&:clicked Ar yyyy Ns Cm - Ns Ar mm Ns Cm - Ns Ar dd
382 .Qq Ar id Ns Cm \&:doubleclicked Ar yyyy Ns Cm - Ns Ar mm Ns Cm - Ns Ar dd
384 .Ss GtkCheckButton
385 .Bl -tag -width "commands "
386 .It Commands
387 .Qq Ar id Ns Cm :set_active Brq Cm 0 | 1
388 switches the check mark off
389 .Pq Cm 0
390 or on
391 .Pq Cm 1 .
393 .Qq Ar id Ns Cm :set_label Ar string
394 replaces the button text with
395 .Ar string .
396 .It Feedback
397 .Qq Ar id Ns Cm \&:1
398 if switched on, or
399 .Qq Ar id Ns Cm \&:0
400 otherwise.
402 .Ss GtkColorButton
403 .Bl -tag -width "commands "
404 .It Commands
405 .Qq Ar id Ns Cm :set_color Ar color
406 preselects the color.
407 .Ar color
408 can be
409 .Bl -dash -offset indent -compact
411 a standard X11 color name, like
412 .Ql Dark Sea Green ,
414 a hexadecimal value in the form
415 .Cm # Ns Ar rgb , Cm # Ns Ar rrggbb , Cm # Ns Ar rrrgggbbb ,
417 .Cm # Ns Ar rrrrggggbbbb ,
419 an RGB color in the form
420 .Cm rgb( Ns Ar red Ns Cm \&, Ns Ar green Ns Cm \&, Ns Ar blue Ns Cm \&) ,
423 an RGBA color in the form
424 .Cm rgba( Ns Ar red Ns Cm \&, Ns Ar green Ns Cm \&, Ns
425 .Ar blue Ns Cm \&, Ns Ar alpha Ns Cm \&) .
427 .It Feedback
428 .Qq Ar id Ns Cm \&:color Cm rgb( Ns Ar red Ns Cm \&, Ns Ar green Ns Cm \&, Ns Ar blue Ns Cm \&)
430 .Qq Ar id Ns Cm \&:color Cm rgba( Ns Ar red Ns Cm \&, Ns Ar green Ns Cm \&, Ns Ar blue Ns Cm \&, Ns Ar alpha Ns Cm \&) .
431 .Ar red , green ,
433 .Ar blue
434 lie between 0 and 255, and
435 .Ar alpha
436 between 0 and 1.
438 .Ss GtkComboBoxText
440 .Cm GtkComboBoxText
441 should contain a
442 .Cm GtkEntry .
443 .Bl -tag -width "commands "
444 .It Commands
445 .Qq Ar id Ns Cm :prepend_text Ar string
447 .Qq Ar id Ns Cm :append_text Ar string
448 prepend/append a new selectable item marked
449 .Ar string .
451 .Qq Ar id Ns Cm :insert_text Ar position string
452 inserts item
453 .Ar string
455 .Ar position .
457 .Qq Ar id Ns Cm :remove Ar position
458 removes the item at
459 .Ar position .
460 .It Feedback
461 .Qq Ar entry_id Ns Cm \&:text Ar text ,
462 .Ar entry_id
463 being the id of the child
464 .Cm GtkEntry .
466 .Ss GtkDialog
468 .Cm GtkDialog
469 with id
470 .Ar foo
471 will be invoked by a
472 .Sx GtkMenuItem
473 or a
474 .Sx GtkImageMenuItem
475 with id
476 .Ar foo Ns Cm _invoke .
479 .Cm GtkDialog
480 should have a
481 .Sq Cancel
482 .Sx GtkButton
483 with id
484 .Ar foo Ns Cm _cancel
485 .Po Cm main_cancel
486 if the dialog is the sole window of the GUI and therefore named
487 .Cm main
488 .Pc .
490 If the
491 .Cm GtkDialog
492 has an
493 .Sq Ok
494 .Sx GtkButton
495 with id
496 .Ar foo Ns Cm _ok ,
497 it will take care of hiding the dialog window.
498 .Bl -tag -width "commands "
499 .It Commands
500 .Qq Ar id Ns Cm :set_title Ar string
501 replaces the text in the title bar with
502 .Ar string .
504 .Qq Ar id Ns Cm :resize Bq Ar width height
505 changes the size of the dialog window to
506 .Ar width
508 .Ar height
509 pixels if specified, or to the default size.
511 .Qq Ar id Ns Cm :move Ar x y
512 moves the dialog window to position
513 .Ar x , y .
515 .Qq Ar id Ns Cm :fullscreen
517 .Qq Ar id Ns Cm :unfullscreen
518 switch fullscreen mode on and off.
519 .It Feedback
520 .Qq Ar id Ns Cm \&:closed
521 if the
522 .Cm GtkDialog
523 window was closed by the window manager.
525 .Ss GtkDrawingArea
526 Drawing commands expect a context parameter
527 .Ar n
528 (an arbitrary non-negative integer) which can be used to
529 reference the command for later removal.
531 The default coordinate system is a left-handed system with its origin
532 in the upper-left corner.
533 Angles increase from the positive X axis towards the positve Y axis
534 .Pq clockwise in the default system .
535 .Bl -tag -width "commands "
536 .It Commands
537 .Qq Ar id Ns Cm :arc Ar n x y radius angle1 angle2
538 adds a circular arc to the current path.
539 The arc is centered at
540 .Pq Ar x , y
541 and proceeds from
542 .Ar angle1
544 .Ar angle2
545 .Pq in degrees .
547 .Qq Ar id Ns Cm :arc_negative Ar n x y radius angle1 angle2
548 adds a circular arc to the current path.
549 The arc is centered at
550 .Pq Ar x , y
551 and proceeds in the direction of decreasing angles from
552 .Ar angle1
554 .Ar angle2
555 .Pq in degrees .
557 .Qq Ar id Ns Cm :close_path Ar n
558 adds a line segment from the current point to the point most recently
559 passed to
560 .Ar id Ns Cm :move_to
562 .Ar id Ns Cm :rel_move_to .
564 .Qq Ar id Ns Cm :curve_to Ar n x1 y1 x2 y2 x3 y3
565 adds a cubic Bezier spline from the current point to
566 .Pq Ar x3 , y3 ,
567 using
568 .Pq Ar x1 , y1
570 .Pq Ar x2 , y2
571 as control points.
572 If there is no current point, the curve will start at
573 .Pq Ar x1 , y1 .
575 .Qq Ar id Ns Cm :fill Ar n
576 fills the current path and clears it.
578 .Qq Ar id Ns Cm :fill_preserve Ar n
579 fills the current path without clearing it.
581 .Qq Ar id Ns Cm :line_to Ar n x y
582 adds a line from the current point to
583 .Pq Ar x , y ,
584 or creates a new current point at
585 .Pq Ar x , y .
587 .Qq Ar id Ns Cm :move_to Ar n x y
588 sets the current point to
589 .Pq Ar x , y .
591 .Qq Ar id Ns Cm :rectangle Ar n x y width height
592 adds a rectangle to the current path.
593 The top left corner is at
594 .Pq Ar x , y .
596 .Qq Ar id Ns Cm :rel_curve_to Ar n dx1 dy1 dx2 dy2 dx3 dy3
597 adds a cubic Bezier spline from the current point to
598 .Pq Ar dx3 , dy3 ,
599 using
600 .Pq Ar dx1 , dy1
602 .Pq Ar dx2 , dy2
603 as control points.
604 All coordinates are offsets relative to the current point.
606 .Qq Ar id Ns Cm :rel_line_to Ar n dx dy
607 adds a line from the current point to a point offset from there by
608 .Pq Ar dx , dy .
610 .Qo Ar id Ns Cm :rel_move_for Ar n Brq Cm c | e | n | ne | nw | s | se | sw | w
611 .Ar text
613 moves the current point such that
614 .Qq Ar id Ns Cm :show_text Ar n text
615 will place the specified reference point of
616 .Ar text
617 on the original current point.
619 .Qq Ar id Ns Cm :rel_move_to Ar n dx dy
620 moves the current point by
621 .Pq Ar dx , dy .
623 .Qq Ar id Ns Cm :remove Ar n
624 removes the elements with context parameter
625 .Ar n
626 from the
627 .Cm GtkDrawingArea Ar id .
629 .Qq Ar id Ns Cm :rotate Ar n Ar angle
630 rotates the user space axes by
631 .Ar angle
632 .Pq in degrees .
634 .Qq Ar id Ns Cm :scale Ar n Ar sx sy
635 scales the user space axes by
636 .Pq Ar sx , sy .
638 .Qq Ar id Ns Cm :set_dash Ar n l
639 sets the dash pattern to
640 .Ar l
642 .Ar l
643 off.
645 .Qq Ar id Ns Cm :set_dash Ar n l1on l1off l2on l2off ...
646 resets the dash pattern to a line with arbitrary on/off portions.
648 .Qq Ar id Ns Cm :set_dash Ar n
649 resets the dash pattern to a solid line.
651 .Qo Ar id Ns Cm :set_font_family Ar n Brq Cm normal | italic | oblique
652 .Brq Cm normal | bold
653 .Bq Cm family
655 sets the font face for subsequent calls of
656 .Ar id Ns Cm :show_text .
658 .Qq Ar id Ns Cm :set_font_size Ar n size
659 sets the font size for subsequent calls of
660 .Ar id Ns Cm :show_text .
662 .Qq Ar id Ns Cm :set_line_cap Ar n Brq Cm butt | round | square
663 sets the line cap style.
664 Default is
665 .Cm butt .
667 .Qq Ar id Ns Cm :set_line_join Ar n Brq Cm miter | round | bevel
668 sets the line junction style.
669 Default is
670 .Cm miter .
672 .Qq Ar id Ns Cm :set_line_width Ar n width
673 sets the line width.
674 Default
675 .Ar width
676 is 2.
678 .Qq Ar id Ns Cm :set_source_rgba Ar n color
679 sets the color.
680 .Ar color
681 is in the format used with
682 .Sx GtkColorButton .
684 .Qq Ar id Ns Cm :show_text Ar n text
685 writes
686 .Ar text ,
687 beginning at the current point.
689 .Qq Ar id Ns Cm :stroke Ar n
690 strokes the current path and clears it.
692 .Qq Ar id Ns Cm :stroke_preserve Ar n
693 strokes the current path without clearing it.
695 .Qq Ar id Ns Cm :transform Ar n Bq Ar xx yx xy yy x0 y0
696 modifies the current transformation matrix such that
698 .Dl Va x' Li = Ar xx Va x Li + Ar xy Va y Li + Ar x0 ,
699 .Dl Va y' Li = Ar yx Va y Li + Ar yy Va y Li + Ar y0 .
701 Default is resetting the current transformation matrix.
703 .Qq Ar id Ns Cm :translate Ar n Ar tx ty
704 translates the user space origin by
705 .Pq Ar tx , ty .
706 .It Feedback
707 none
709 .Ss GtkEntry
710 .Bl -tag -width "commands "
711 .It Commands
712 .Qq Ar id Ns Cm :set_text Ar string
713 replaces the user-editable text with
714 .Ar string .
716 .Qq Ar id Ns Cm :set_placeholder_text Ar string
717 sets the
718 .Ar string
719 that is displayed when the entry is empty and unfocused.
720 .It Feedback
721 .Qq Ar id Ns Cm \&:text Ar text ,
722 once for each change of
723 .Ar text .
725 .Ss GtkEventBox
726 .Ar x , y
727 are mouse pointer coordinates relative to the
728 .Cm GtkEventBox .
729 .Bl -tag -width "commands "
730 .It Commands
731 none
732 .It Feedback
733 .Qq Ar id Ns Cm \&:button_press Ar b x y ,
734 .Qq Ar id Ns Cm \&:button_release Ar b x y
735 where
736 .Ar b
737 is the mouse button (normally 1, 2, or 3 for the left, middle, and
738 right button; others may exist).
740 .Qq Ar id Ns Cm \&:motion Ar x y
741 is reported repeatedly while the mouse is being moved with a button
742 pressed.
744 .Qq Ar id Ns Cm \&:key_press Ar key ,
745 .Ar key
746 being the key's name
747 .Po e.g.
748 .Ql Control_L ,
749 .Ql Tab ,
750 .Ql a
751 .Pc .
753 .Ss GtkExpander
754 .Bl -tag -width "commands "
755 .It Commands
756 .Qq Ar id Ns Cm :set_label Ar string
757 replaces the expander label text with
758 .Ar string .
760 .Qq Ar id Ns Cm :set_expanded Brq Cm 0 |  1
761 hides
762 .Pq Cm 0
763 the child widget, or makes it visible
764 .Pq Cm 1 .
765 .It Feedback
766 none
768 .Ss GtkFileChooserButton
769 .Bl -tag -width "commands "
770 .It Commands
771 .Qq Ar id Ns Cm :set_filename Ar path
772 preselects
773 .Ar path
774 to the extent it exists.
775 .It Feedback
776 .Qq Ar id Ns Cm \&:file Ar pathname
777 if the selection has changed.
779 .Ss GtkFileChooserDialog
781 .Cm GtkFileChooserDialog
782 with id
783 .Ar foo
784 will be invoked by a
785 .Sx GtkMenuItem
786 or a
787 .Sx GtkImageMenuItem
788 with id
789 .Ar foo Ns Cm _invoke .
792 .Cm GtkFileChooserDialog
793 should have an
794 .Sq OK
795 .Sx GtkButton
796 with id
797 .Ar foo Ns Cm _ok
798 .Po Cm main_ok
799 if the dialog is the sole window of the GUI and therefore named
800 .Cm main
801 .Pc .
804 .Cm GtkFileChooserDialog
805 may have a
806 .Sq Cancel
807 .Sx GtkButton
808 with id
809 .Ar foo Ns Cm _cancel
810 .Po Cm main_cancel
811 if the dialog is the sole window of the GUI and therefore named
812 .Cm main
813 .Pc .
816 .Cm GtkFileChooserDialog
817 may have an
818 .Sq Apply
819 .Sx GtkButton
820 with id
821 .Ar foo Ns Cm _apply
822 .Po Cm main_apply
823 if the dialog is the sole window of the GUI and therefore named
824 .Cm main
825 .Pc .
826 .Bl -tag -width "commands "
827 .It Commands
828 .Qq Ar id Ns Cm :set_filename Ar path
829 preselects
830 .Ar path
831 to the extent it exists.
833 .Qq Ar id Ns Cm :set_current_name Ar string
834 makes
835 .Ar string
836 the suggested filename, which may not yet exist.
837 .Ar string
838 should either resemble an absolute path, or the
839 .Ar directory
840 must be set separately by
841 .Ar id Ns Cm :set_filename Ar directory .
843 .Qq Ar id Ns Cm :set_title Ar string
844 replaces the text in the title bar with
845 .Ar string .
847 .Qq Ar id Ns Cm :resize Bq Ar width height
848 changes the size of the dialog window to
849 .Ar width
851 .Ar height
852 pixels if specified, or to the default size.
854 .Qq Ar id Ns Cm :move Ar x y
855 moves the dialog window to position
856 .Ar x , y .
858 .Qq Ar id Ns Cm :fullscreen
860 .Qq Ar id Ns Cm :unfullscreen
861 switch fullscreen mode on and off.
862 .It Feedback
863 .Qq Ar id Ns Cm :file Ar pathname
864 and/or
865 .Qq Ar id Ns Cm :folder Ar pathname
867 .Qq Ar id Ns Cm \&:closed
868 if the
869 .Cm GtkFileChooserDialog
870 window was closed by the window manager.
872 .Ss GtkFontButton
873 .Bl -tag -width "commands "
874 .It Commands
875 .Qq Ar id Ns Cm :set_font_name Ar fontname
876 preselects the font.
877 .It Feedback
878 .Qq Ar id Ns Cm \&:font Ar fontname
880 .Ss GtkFrame
881 .Bl -tag -width "commands "
882 .It Commands
883 .Qq Ar id Ns Cm :set_label Ar text
884 replaces the frame label text with
885 .Ar string .
886 .It Feedback
887 none
889 .Ss GtkImage
890 .Bl -tag -width "commands "
891 .It Commands
892 .Qq Ar id Ns Cm :set_from_icon_name Ar icon-name
893 replaces the image with one of the standard icons.
895 .Qq Ar id Ns Cm :set_from_file Ar path
896 replaces the image by the one found at
897 .Ar path Ns .
898 .It Feedback
899 none
901 .Ss GtkLabel
902 .Bl -tag -width "commands "
903 .It Commands
904 .Qq Ar id Ns Cm :set_text Ar string
905 replaces the label text with
906 .Ar string .
907 .It Feedback
908 none
910 .Ss GtkMenuItem, GtkImageMenuItem
911 .Bl -tag -width "commands "
912 .It Commands
913 none
914 .It Feedback
916 .Cm GtkMenuItem
918 .Cm GtkImageMenuItem
919 with id
920 .Ar foo Ns Cm _invoke
921 will invoke the
922 .Sx GtkDialog
924 .Sx GtkFileChooserDialog
925 with id
926 .Ar foo
927 if it exists.
928 If there isn't any dialog attached to the
929 .Cm GtkMenuItem ,
930 it reports
931 .Qq Ar id Ns Cm \&:active Ar label .
933 .Ss GtkNotebook
934 .Bl -tag -width "commands "
935 .It Commands
936 .Qq Ar id Ns Cm :set_current_page Ar n
937 switches to zero-based page number
938 .Ar n .
939 .It Feedback
940 none
942 .Ss GtkPrintUnixDialog
943 .Bl -tag -width "commands "
944 .It Commands
945 .Qq Ar id Ns Cm :print Ar file.ps
946 opens the print dialog.
947 Pressing the
948 .Ql Print
949 button sends
950 .Ar file.ps
951 to the printer the user selected in the dialog.
952 .It Feedback
953 .Qq Ar id Ns Cm \&:closed
954 if the
955 .Cm GtkPrintUnixDialog
956 window was closed by the window manager.
958 .Ss GtkProgressBar
959 .Bl -tag -width "commands "
960 .It Commands
961 .Qq Ar id Ns Cm :set_fraction Ar x
962 moves the progress bar to
963 .Ar x
964 .Pq between 0 and 1 .
966 .Qq Ar id Ns Cm :set_text Bq Ar string
967 replaces the text of the progress bar with
968 .Ar string .
969 Default is the progress percentage.
970 .It Feedback
971 none
973 .Ss GtkRadioButton
974 .Bl -tag -width "commands "
975 .It Commands
976 .Qq Ar id Ns Cm :set_active 1
977 switches the button on.
978 All other buttons of the same group will go off automatically.
980 .Qq Ar id Ns Cm :set_label Ar string
981 replaces the button text with
982 .Ar string .
983 .It Feedback
984 .Qq Ar id Ns Cm \&:1
985 if switched on, or
986 .Qq Ar id Ns Cm \&:0
987 otherwise.
989 .Ss GtkScale
990 .Bl -tag -width "commands "
991 .It Commands
992 .Qq Ar id Ns Cm :set_value Ar x
993 moves the slider to value
994 .Ar x .
995 .It Feedback
996 .Qq Ar id Ns Cm \&:value Ar floating_point_text
998 .Ss GtkScrolledWindow
999 .Bl -tag -width "commands "
1000 .It Commands
1001 .Qq Ar id Ns Cm :hscroll Ar position
1003 .Qq Ar id Ns Cm :vscroll Ar position
1004 scroll
1005 .Ar position
1006 to the left or top edge of the
1007 .Cm GtkScrolledWindow ,
1008 respectively.
1010 .Qq Ar id Ns Cm :hscroll_to_range Ar pos_0 pos_1
1012 .Qq Ar id Ns Cm :vscroll_to_range Ar pos_0 pos_1
1013 scroll, if necessary, the range between
1014 .Ar pos_0
1016 .Ar pos_1
1017 into the
1018 .Cm GtkScrolledWindow .
1019 If the range is greater than the window, the initial part of the range
1020 will be visible.
1021 .It Feedback
1022 none
1024 .Ss GtkSocket
1025 .Cm GtkSocket
1026 may be unsupported by Glade, but its definition can be inserted
1027 manually into the GtkBuilder
1028 .Pq Pa .ui
1029 file:
1030 .Bd -literal -offset indent
1031 <child>
1032   <object class="GtkSocket" id="socket1">
1033     <property name="visible">True</property>
1034     <property name="can_focus">True</property>
1035   </object>
1036   <packing>
1037     <property name="expand">True</property>
1038     <property name="fill">True</property>
1039     <property name="position">1</property>
1040   </packing>
1041 </child>
1043 .Bl -tag -width "commands "
1044 .It Commands
1045 .Qq Ar id Ns Cm :id
1046 requests a feedback message containing the socket
1047 .Ar xid .
1048 .It Feedback
1049 .Qq Ar id Ns Cm :id Ar xid
1050 can be used by another process to XEmbed its widgets into the
1051 .Cm GtkSocket .
1053 .Qq Ar id Ns Cm :plug-added ,
1055 .Ar id Ns
1056 .Cm :plug-removed
1057 .Qc .
1058 Notification that the other process has inserted its widgets into or
1059 removed them from the
1060 .Cm GtkSocket .
1062 .Ss GtkSpinButton
1063 .Bl -tag -width "commands "
1064 .It Commands
1065 .Qq Ar id Ns Cm :set_text Ar string
1066 sets the selected value to
1067 .Ar string .
1068 .It Feedback
1069 .Qq Ar id Ns Cm \&:text Ar text
1071 .Ss GtkSpinner
1072 .Bl -tag -width "commands "
1073 .It Commands
1074 .Qq Ar id Ns Cm :start
1076 .Qq Ar id Ns Cm :stop
1077 start and stop the spinner.
1078 .It Feedback
1079 none
1081 .Ss GtkStatusbar
1082 The context parameter
1083 .Ar c
1084 is an arbitrary non-whitespace string.
1085 .Bl -tag -width "commands "
1086 .It Commands
1087 .Qq Ar id Ns Cm :push_id Ar c string ,
1088 .Qq Ar id Ns Cm :push Ar string
1089 associate
1090 .Ar string
1091 with context parameter
1092 .Ar c
1094 .Ql 0 ,
1095 respectively, and display it in the statusbar.
1097 .Qq Ar id Ns Cm :pop_id Ar c ,
1098 .Qq Ar id Ns Cm :pop
1099 remove the latest entry associated with context parameter
1100 .Ar c
1102 .Ql 0 ,
1103 respectively, from the statusbar.
1105 .Qq Ar id Ns Cm :remove_all_id Ar c ,
1106 .Qq Ar id Ns Cm :remove_all
1107 remove the entries associated with context parameter
1108 .Ar c
1110 .Ql 0 ,
1111 respectively, from the statusbar.
1112 .It Feedback
1113 none
1115 .Ss GtkSwitch
1116 .Bl -tag -width "commands "
1117 .It Commands
1118 .Qq Ar id Ns Cm :set_active Brq Cm 0 | 1
1119 turns the switch off
1120 .Pq Cm 0
1121 or on
1122 .Pq Cm 1 .
1123 .It Feedback
1124 .Qq Ar id Ns Cm \&:1
1125 if switched on, or
1126 .Qq Ar id Ns Cm \&:0
1127 otherwise.
1129 .Ss GtkTextView
1130 There should be a dedicated
1131 .Sx GtkButton
1132 for sending (parts of) the text.
1133 If the id of the
1134 .Cm GtkTextView
1136 .Ar foo ,
1138 .Sx GtkButton
1139 with id
1140 .Ar foo Ns Cm _send_text
1141 will send the content of the
1142 .Cm GtkTextView ;
1144 .Sx GtkButton
1145 with id
1146 .Ar foo Ns Cm _send_selection
1147 will send the highlighted part the
1148 .Cm GtkTextView .
1149 .Bl -tag -width "commands "
1150 .It Commands
1151 .Qq Ar id Ns Cm :set_text Ar string
1152 replaces the user-editable text with (potentially empty)
1153 .Ar string Ns .
1155 .Qq Ar id Ns Cm :delete
1156 deletes the text.
1158 .Qq Ar id Ns Cm :insert_at_cursor Ar string
1159 inserts
1160 .Ar string
1161 at cursor position.
1163 .Qq Ar id Ns Cm :place_cursor Brq Ar position | Cm end
1164 places the text cursor at
1165 .Ar position
1166 or at the end of the text.
1168 .Qq Ar id Ns Cm :place_cursor_at_line Ar line
1169 places the text cursor at the beginning of
1170 .Ar line .
1172 .Qq Ar id Ns Cm :scroll_to_cursor
1173 scrolls to the cursor position if necessary.
1175 .Qq Ar id Ns Cm :save Ar file
1176 stores in
1177 .Ar file
1180 command containing the text.
1181 .It Feedback
1182 .Qq Ar button_id Ns Cm :text Ar text ,
1183 .Ar button_id
1184 being the id of the
1185 .Sx GtkButton .
1186 Line endings in
1187 .Ar text
1188 are replaced by
1189 .Cm \en ,
1190 and backslashes are replaced by
1191 .Cm \e\e .
1193 .Ss GtkToggleButton
1194 .Bl -tag -width "commands "
1195 .It Commands
1196 .Qq Ar id Ns Cm :set_active Brq Cm 0 | 1
1197 switches the button off
1198 .Pq Cm 0
1199 or on
1200 .Pq Cm 1 .
1202 .Qq Ar id Ns Cm :set_label Ar string
1203 replaces the button text with
1204 .Ar string .
1205 .It Feedback
1206 .Qq Ar id Ns Cm \&:1
1207 if switched on, or
1208 .Qq Ar id Ns Cm \&:0
1209 otherwise.
1211 .Ss GtkTreeView
1213 can deal with columns of type
1214 .Cm gboolean , gint , guint , glong , gulong , gint64 , guint64 , gfloat , gdouble ,
1216 .Cm gchararray .
1218 .Ar row
1220 .Ar column
1221 refer to the underlying model
1222 .Cm ( GtkListStore
1224 .Cm GtkTreeStore ) .
1225 .Ar row
1226 is a sequence of one or more colon-separated integers, e.g.
1227 .Ql 3
1229 .Ql 0:0:1 .
1230 .Bl -tag -width "commands "
1231 .It Commands
1232 .Qq Ar id Ns Cm :set Ar row column data
1233 replaces the content at
1234 .Pq Ar row , column
1235 with
1236 .Ar data
1237 (which should be compatible with the type of
1238 .Ar column ) .
1239 If necessary, new tree nodes are created to obtain the minimal tree
1240 structure needed to support
1241 .Ar row .
1243 .Qq Ar id Ns Cm :insert_row Brq Ar row Bo Cm as_child Bc | Cm end
1244 inserts a new, empty row; either as a sibling of
1245 .Ar row
1246 at position
1247 .Ar row ,
1248 or as a child of
1249 .Ar row ,
1250 or at the end of the list, respectively.
1252 .Qq Ar id Ns Cm :move_row Ar origin Brq Ar destination | Cm end
1253 moves the row at
1254 .Ar origin
1255 within its current level to
1256 .Ar destination
1257 or to the end.
1259 .Qq Ar id Ns Cm :remove_row Ar row
1260 removes the row at position
1261 .Ar row .
1263 .Qq Ar id Ns Cm :clear
1264 removes all rows.
1266 .Qq Ar id Ns Cm :expand Ar row
1267 expands one level of the subtree below
1268 .Ar row .
1270 .Qq Ar id Ns Cm :expand_all Bq Ar row
1271 expands the subtree below
1272 .Ar row ,
1273 or the whole tree.
1275 .Qq Ar id Ns Cm :collapse Bq Ar row
1276 collapses the subtree below
1277 .Ar row ,
1278 or the whole tree.
1280 .Qq Ar id Ns Cm :set_cursor Bq Ar row
1281 sets the cursor to
1282 .Ar row ,
1283 or unsets it.
1285 .Qq Ar id Ns Cm :scroll Ar row column
1286 scrolls the cell at
1287 .Pq Ar row , column
1288 into view.
1290 .Qq Ar id Ns Cm :save Ar file
1291 stores the content of the underlying model as a sequence of
1293 commands into
1294 .Ar file .
1295 .It Feedback
1296 .Qq Ar id Ns Cm \&:clicked
1298 .Qq Ar id Ns Cm \&: Ns Ar column_type row column value ,
1299 one message per cell in the underlying model for each selected row; or
1301 .Qq Ar id Ns Cm \&: Ns Ar column_type row column new_value ,
1302 if the cell at
1303 .Pq Ar row , column
1304 has been edited.
1306 .Ss GtkTreeViewColumn
1307 .Bl -tag -width "commands "
1308 .It Commands
1309 none
1310 .It Feedback
1311 .Qq Ar id Ns Cm \&:clicked
1313 .Ss GtkWindow
1314 .Bl -tag -width "commands "
1315 .It Commands
1316 .Qq Ar id Ns Cm :set_title Ar string
1317 replaces the text in the title bar with
1318 .Ar string .
1320 .Qq Ar id Ns Cm :resize Bq Ar width height
1321 changes the window size to
1322 .Ar width
1324 .Ar height
1325 pixels if specified, or to the default size.
1327 .Qq Ar id Ns Cm :move Ar x y
1328 moves the window to position
1329 .Ar x , y .
1331 .Qq Ar id Ns Cm :fullscreen
1333 .Qq Ar id Ns Cm :unfullscreen
1334 switch fullscreen mode on and off.
1335 .It Feedback
1336 .Qq Ar id Ns Cm \&:closed
1337 if the
1338 .Cm GtkWindow
1339 was closed by the window manager.
1341 .Sh EXIT STATUS
1342 .Ex -std
1343 .Sh EXAMPLES
1344 .Ss Discovering Pipeglade Interactively
1345 Suppose the interface in
1346 .Pa ./pipeglade.ui
1347 has a
1348 .Sx GtkLabel Ql label1
1349 and a
1350 .Sx GtkButton Ql button1 .
1351 After invoking
1353 .Dl pipeglade
1355 and clicking the
1356 .Sx GtkButton , Ql button1:clicked
1357 will be reported on the terminal.
1358 Typing
1360 .Dl label1:set_text Button Label
1362 will change the text shown on the label into
1363 .Ql Button Label .
1364 .Ss One-Shot File Dialog
1365 Suppose the interface in
1366 .Pa ./simple_open.ui
1367 contains a
1368 .Sx GtkFileChooserDialog
1369 with an
1370 .Sq OK
1371 .Sx GtkButton
1372 whose id is
1373 .Ql main_ok .
1374 Invoking
1376 .Dl pipeglade -u simple_open.ui
1378 will open the dialog; pressing
1379 .Sq OK
1380 will close it after sending the selected filename to
1381 .Va stdout .
1382 .Ss One-Shot User Notification
1383 If the interface in
1384 .Pa ./simple_dialog.ui
1385 contains a
1386 .Sx GtkLabel Ql label1 ,
1387 then
1388 .Bd -literal -offset indent
1389 pipeglade -u simple_dialog.ui <<< \e
1390     "label1:set_text NOW READ THIS!"
1392 will set the label text accordingly and wait for user input.
1393 .Ss Continuous Input
1394 The following shell command displays a running clock:
1395 .Bd -literal -offset indent
1396 while true; do
1397     echo "label1:set_text `date`";
1398     sleep 1;
1399 done | pipeglade -u simple_dialog.ui
1401 .Ss Continuous Input and Output
1402 The following shell script fragment sets up
1404 for continuous communication with another program,
1405 .Pa main_prog :
1406 .Bd -literal -offset indent
1407 pipeglade -i in.fifo -o out.fifo &
1408 # wait for in.fifo and out.fifo to appear
1409 while test ! \e( -e in.fifo -a -e out.fifo \e); do :; done
1410 main_prog <out.fifo >in.fifo
1412 .Sh SEE ALSO
1413 .Xr dialog 1 ,
1414 .Xr glade 1 ,
1415 .Xr gxmessage 1 ,
1416 .Xr kdialog 1 ,
1417 .Xr whiptail 1 ,
1418 .Xr xmessage 1 ,
1419 .Xr zenity 1
1420 .Sh AUTHOR
1422 was written by
1423 .An Bert Burgemeister
1424 .Aq Mt trebbu@googlemail.com .
1425 .Sh BUGS
1426 Due to what appears to be a bug in cairo v1.14.0,
1428 used with this library version occasionally crashes on
1429 .Cm GtkDrawingArea
1430 commands.