8. GTK+ interface
This chapter describes the interface for GTK+
, the Open Source
Free Software GUI Toolkit, primarily developed for use with the X Window
System. The most detailed information about GTK+
may be found at
http://www.gtk.org.
The interface is designed after the popular guile-gtk
analog, the
GTK+
interface for using with guile
scheme
implementation. My intention was to make the interface as compatible
with that of guile-gtk
as possible in order to utilize the
tutorials, examples and other software written for guile-gtk
.
For generation of multiple interfaces to GTK+
functions the
cgen
utility was developed See section 3.11 cgen - bigloo preprocessor, which was used to process
the specification of GTK+
interface found in guile-gtk
.
guile-gtk
may be found at
http://www.ping.de/sites/zagadka/guile-gtk/.
8.1 Testing the GTK interface
Since the main goal of GTK+ is to provide a graphical user interface, it
is practically impossible to test it automatically. Instead, a test
application was derived from analogous program provided with GTK+ (file
gtk/testgtk.c in GTK+ distribution) and guile-gtk.
Also this application may be used as a source of examples how to use
bigloo-gtk.
8.1.1 testgtk program
The testgtk
is port of testgtk.c
provided with GTK+
distribution, to bigloo-gtk
. Initially is was derived from
testgtk.scm
provided with guile-gtk
. Now most of the text
is redesigned, many tests made more up-to-date than the corresponding
guile-gtk
analogs.
All the original tests testgtk.c
from latest GTK+ distribution
are listed in main testgtk
window, labels for whose that are
still unimplemented are grayed.
The simplest way to run the testgtk
is to process its source code
by bigloo-bgtk
driver program:
| bigloo-bgtk ./testgtk.defs
|
but to make all the tests work, you probably have to compile and run binary
executable:
| make testgtk && ./testgtk
|
8.1.2 example programs
Bigloo-gtk
provides a small set of examples, derived from whose
provided in "GTK+ Tutorial". You'll find the examples in
gtk/examples/
subdirectory. All the examples are shell scripts,
though may be compiled. You need to install the package before running
this examples.
8.2 Bigloo-gtk reference
Currently this reference guide of very far from completeness. Only
selected calls are documented. Look at working tests code in
testgtk.defs
for example.
8.2.1 GDK Reference Manual
8.2.1.1 The gdk event object
- procedure: gdk-event-type event::gdk-event => gdk-event-type
- procedure: gdk-event-window event::gdk-event => gdk-window
- procedure: gdk-event-send-event event::gdk-event => bool
- procedure: gdk-event-visibility-state event::gdk-event => gdk-visibility-state
- procedure: gdk-event-time event::gdk-event => int
- procedure: gdk-event-x event::gdk-event => double
- procedure: gdk-event-y event::gdk-event => double
- procedure: gdk-event-pressure event::gdk-event => double
- procedure: gdk-event-xtilt event::gdk-event => double
- procedure: gdk-event-ytilt event::gdk-event => double
- procedure: gdk-event-button event::gdk-event => int
- procedure: gdk-event-button-state event::gdk-event => bool
- procedure: gdk-event-is-hint event::gdk-event => bool
- procedure: gdk-event-source event::gdk-event => gdk-input-source
- procedure: gdk-event-deviceid event::gdk-event => int
- procedure: gdk-event-x-root event::gdk-event => double
- procedure: gdk-event-y-root event::gdk-event => double
- procedure: gdk-event-key-state event::gdk-event => bool
- procedure: gdk-event-keyval event::gdk-event => uint
- procedure: gdk-event-string event::gdk-event => string
- procedure: gdk-event-subwindow event::gdk-event => gdk-window
- procedure: gdk-event-notify-detail event::gdk-event => gdk-notify-type
- procedure: gdk-event-in event::gdk-event => bool
- procedure: gdk-event-configure-x event::gdk-event => int
- procedure: gdk-event-configure-y event::gdk-event => int
- procedure: gdk-event-configure-width event::gdk-event => int
- procedure: gdk-event-configure-height event::gdk-event => int
- procedure: gdk-window-get-id window::gdk-window => int
8.2.1.2 The gdk color object
- procedure: gdk-color-red o::gdk-color => uint
- o
- procedure: gdk-color-green o::gdk-color => uint
- o
- procedure: gdk-color-blue o::gdk-color => uint
- o
- procedure: gdk-color-parse spec::string #!optional color::gdk-color => gdk-color
The gdk-color-parse
procedure looks up the string name of a
color, given in spec argument, with respect to the screen
associated with the default colormap. On return it initializes the
object given in a color argument with the exact color value. Use
of uppercase or lowercase does not matter. If the color is not
specified, the new instance of type gdk-color
is allocated
through gdk-color-alloc
. If the color name is not resolved, an
exception is raised.
| (gdk-color-parse "red") => #<foreign:GDK-COLOR:fe471d10>
|
8.2.1.3 The gdk font object
- procedure: gdk-font-unref font::gdk-font => #unspecified
- font
- procedure: gdk-font-ref font::gdk-font => #unspecified
- font
- procedure: gdk-font-load name::string => gdk-font
- name
8.2.1.4 The gdk drawing procedures
- procedure: gdk-draw-string window::gdk-window font::gdk-font gc::gdk-gc x::int y::int string::string => #unspecified
- window
font
gc
x
y
string
- procedure: gdk-draw-arc window::gdk-window gc::gdk-gc filled::bool x::int y::int width::int height::int angle1::int angle2::int => #unspecified
- window
gc
filled
x
y
width
height
angle1
angle2
- procedure: gdk-draw-rectangle window::gdk-window gc::gdk-gc filled::bool x::int y::int width::int height::int
- window
gc
filled
x
y
width
height
- procedure: gdk-draw-line window::gdk-window gc::gdk-gc x1::int y1::int x2::int y2::int => #unspecified
- window
gc
x1
y1
x2
y2
- procedure: gdk-draw-pixmap drawable::gdk-window gc::gdk-gc src::gdk-window xsrc::int ysrc::int xdest::int ydest::int width::int height::int => #unspecified
- drawable
gc
src
xsrc
ysrc
xdest
ydest
width
height
8.2.1.5 The gdk pixmap object
- procedure: gdk-pixmap-new window width::int height::int #!optional depth => gdk-window
- window
width
height
depth
8.2.1.6 The gdk window object
- procedure: gdk-window-get-parent window::gdk-window => gdk-window
- window
- procedure: gdk-window-clear-area-e window::gdk-window x::int y::int width::int height::int => #unspecified
- window
x
y
width
height
- procedure: gdk-window-clear-area window::gdk-window x::int y::int width::int height::int => #unspecified
- window
x
y
width
height
- procedure: gdk-window-clear window::gdk-window => #unspecified
- window
- procedure: gdk-window-new parent::gdk-window #!key => gdk-window
The procedure gdk-window-new
creates a new gdk-window
object. The main purpose of this procedure is creating new types of
widgets which require its own window.
The following keyed arguments may be passed to this procedure:
- title::string
The title of a new window.
- x::short
- y::short
Upper left corner coordinates of the new window, parent-relative. If
omitted, the values set to zero.
- width::short
- height::short
The dimentions of the new window. If
omitted, the values set to 1.
- cursor::gdk-cursor
The cursor of the new window.
- colormap::gdk-colormap
The colormap of the new window.
- visual::gdk-visual
The visual of the new window. If omitted, this value is set to the
visual returned by gdk_visual_get_system
.
- wmclass-name::string
- wmclass-class::string
Name and class attributes for WM.
- override-redirect::bool
Set the value X-windows CWOverrideRedirect
attribute for a new
window.
- input-only?::bool
Must be set only in special circumstances when events need to be stolen
from another window or windows. Input only windows have no visible
output, so they are handy for placing over top of a group of windows in
order to grab the events (or filter the events) from those windows.
- window-type::gdk-window-type
The new window type. Must be one of:
If omitted, the window type set to child
.
- event-mask::gdk-event-mask
The event mask of a new window. Must be a combination of
exposure
, pointer-motion
, pointer-motion-hint
,
button-motion
, button1-motion
, button2-motion
,
button3-motion
, button-press
, button-release
,
key-press
, key-release
, enter-notify
,
leave-notify
, focus-change
, structure
,
structure
, property-change
, visibility-notify
,
proximity-in
, proximity-out
, substructure
, or just
all-events
to allow any event propagation.
In the following example a new window for a widget is created. The
new window inherites all parent's attributes, excepr the width and
height. Besides, the new window responds on the button-press
event.
| (let((parent(gtk-widget-get-parent-window widget)))
(gdk-window-new parent
title: "MyWindow"
width: 200
height: 200
visual: (gdk-window-get-visual parent)
colormap: (gdk-window-get-colormap parent)
event-mask: (gdk-window-get-events parent)))
=>
|
- procedure: gdk-window-new-from-parent parent::gdk-window #!key
The procedure gdk-window-new-from-parent
is a convenience
substitution of gdk-window-new
. Is accepts same arguments, but by
default inherits th width
, height
, visual
,
colormap
and event-mask
of the parent window.
The example in gdk-window-new
section may be rewritten as follows:
| (let((parent(gtk-widget-get-parent-window widget)))
(gdk-window-new parent
title: "MyWindow"
width: 200
height: 200))
=>
|
8.2.1.7 The gdk GC (graphic context) object
- procedure: gdk-gc-set-line-attributes gc::gdk-gc line_width::int line_style::gdk-line-style cap_style::gdk-cap-style join_style::gdk-join-style => #unspecified
- gc
line_width
line_style
cap_style
join_style
- procedure: gdk-gc-set-exposures gc::gdk-gc exposures::bool => #unspecified
- gc
exposures
- procedure: gdk-gc-set-subwindow gc::gdk-gc mode::gdk-subwindow-mode => #unspecified
- gc
mode
- procedure: gdk-gc-set-clip-origin gc::gdk-gc x::int y::int => #unspecified
- gc
x
y
- procedure: gdk-gc-set-ts-origin gc::gdk-gc x::int y::int => #unspecified
- gc
x
y
- procedure: gdk-gc-set-fill gc::gdk-gc fill::gdk-fill => #unspecified
- gc
fill
- procedure: gdk-gc-set-function gc::gdk-gc function::gdk-function => #unspecified
- gc
function
- procedure: gdk-gc-set-font gc::gdk-gc font::gdk-font => #unspecified
- gc
font
- procedure: gdk-gc-set-background gc::gdk-gc color::gdk-color => #unspecified
- gc
color
- procedure: gdk-gc-set-foreground gc::gdk-gc color::gdk-color => #unspecified
- gc
color
- procedure: gdk-gc-new window::gdk-window => gdk-gc
- window
8.2.1.8 The gdk colormap object
- procedure: gdk-colormap-alloc-color colormap::gdk-colormap color::gdk-color writeable::bool best_match::bool => bool
- colormap
color
writeable
best_match
8.2.1.9 gdk miscellaneous procedures
- procedure: gdk-beep => #unspecified
- procedure: gdk-flush => #unspecified
8.2.2 Types
8.2.2.1 Introduction to the Type System
Every type in GTK+ is given an unique identifier. These identifiers have a type named gtk-type
(they are sequential integers really).
A few numbers are preassigned to built-in GTK+ types (such an integers,
strings, booleans etc.). All other type ids are allocated along with the
first instance of that type.
- procedure: gtk-type-name type::gtk-type => string
- Get the GTK+ name of an existing type.
Note: the name returned is a GTK+ name, not a Bigloo type name, i.e. the
value "GtkButton"
will be returned for buttons, but not
"gtk-button"
.
| (gtk-type-name 2)
=> "gchar"
(gtk-type-name(gtk-object-type(gtk-button-new)))
=> "GtkButton"
|
- procedure: gtk-type-from-name name::string => gtk-type
Given the name of an existing GTK+ type, return its type id.
| (gtk-type-from-name "gint")
=> 5
(gtk-type-from-name "GtkObject")
=> 21
(gtk-button-new) ;; assure the button type is initialized
(gtk-type-from-name "GtkButton")
=> 40469
|
- procedure: gtk-object-type object::gtk-object => gtk-type
- Given an
gtk-object
or any ancestor of gtk-object
, ruturn
the object type identifier
Example: get the type of gtk-button
instance.
| (gtk-object-type(gtk-button-new)) => 40469
|
- procedure: gtk-object-klass o::gtk-object => gtk-object-class
Get GTK+ object class reference by instance. The gtk-object-class
structures may be useful for introspection purposes only (to inspect
object signals etc.).
| (gtk-object-klass(gtk-button-new))
=> #<foreign:GTK-OBJECT-CLASS:84b3078>
|
- procedure: gtk-object-class-type o::gtk-object-class => gtk-type
Get type identifier by GTK+ object class.
o
| (gtk-object-class-type(gtk-object-klass(gtk-button-new)))
=> 40469
|
- procedure: gtk-type-query type::gtk-type => name::string object-size::uint class-size::uint
- type
The procedure gtk-type-query
queries information about the name
and sizes of GTK class object. It returns three values:
- name
the name of the type, by convention closely related to the name of the
underlying C type. For example, the type name of the GtkObject
structure is "GtkObject", and the name of the GtkWindowType
enumeration is "GtkWindowType"
- object-size
the size in bytes of the C structure for types that have such a structure.
- class-size
the size in bytes of the C structure for the class.
For example, to query parameters of the gtk-box
class, do:
| (multiple-value-bind
(name object-size class-size)
(gtk-type-query (gtk-vbox-get-type))
(print "name: "name " object-size: " object-size " class-size: " class-size))
-| name: GtkVBox object-size: 68 class-size: 336
|
This procedure is used internally in gtk-class-new
procedure.
- procedure: gtk-class-new parent-type::gtk-type name::string => gtk-type
The procedure gtk-class-new
registers a new subclass of the
existing gtk object class parent-type, with the named
name. Using this procedure, new widget types may be implemented
entirely in Bigloo Scheme.
For example, to derive a new widget from gtk-vbox
, named MyVBox
do:
| (define my-vbox-class (gtk-class-new (gtk-vbox-get-type) "MyVBox")))
(define my-vbox(gtk-object-new my-vbox-class))
=>
|
For more detailed example see the tictactoe.scm
example.
8.2.2.2 Basic Concepts
8.2.2.3 Simple Types
8.2.2.4 Enumerations and Flags
8.2.2.5 Callbacks
Any Bigloo procedure with matching prototype may be used as signal or
event handler in Bigloo.
8.2.2.6 Composite Types
8.2.3 Objects
- procedure: gtk-object-destroyed object::gtk-object => bool
- Was an object destroyed with
gtk-object-destroy
?
| (define button(gtk-button-new))
(gtk-object-destroyed button)
=> #f
(gtk-object-destroy button)
(gtk-object-destroyed button)
=> #t
|
- procedure: gtk-object-destroy object::gtk-object
- Ask the object's class to destroy the object.
8.2.4 Signals Overview
- procedure: gtk-signal-emit-stop object::gtk-object signal
Stop the emission of the signal on object. signal is
the string signal name or the integer identifier for the signal, which
can be determined using the function
gtk-signal-lookup
. Attempting to stop the emission of a signal
that isn't being emitted does nothing.
- procedure: gtk-signal-disconnect object::gtk-object id::int
Disconnects a signal handler from an object. The signal handler is
identified by the integer id which is returned by the
gtk-signal-connect
function.
Example: disable the button action after the first invocation.
| (letrec((but(gtk-button-new "Hello"))
(signal-id
(gtk-signal-connect
but "clicked"
(lambda args
(print "Hello, World")
(gtk-signal-disconnect but signal-id)))))
...)
|
- procedure: gtk-signal-emit object::gtk-object signal . arguments
Emit the signal specified by the integer or string identifier
signal from object. The signal definition determines the
parameters passed in the arguments list along with the type of
return value.
For example, if the signal is defined as:
| void (* parent_set) (GtkWidget *widget, GtkWidget *parent);
|
Then a call to emit the "parent_set" signal would look like:
| (let((button(gtk-button-new)))
(gtk-signal-emit button "parent_set" *window*))
=> #unspecified
|
Notice that the widget
argument is implicit in that the first
argument to every signal is a type derived from GtkObject
.
Signals may return values. For example see the
gtk-signal-new-generic
section.
- procedure: gtk-signal-connect object::gtk-object name::string function::procedure #!optional after::bool => uint
Connects a signal handling function to a signal emitting
object. function is connected to the signal name emitted by
object. The arguments and returns type of func should match
the arguments and return type of the signal name.
gtk-signal-connect
returns an integer identifier for the
connection which can be used to refer to it in the future. Specifically
it is useful for removing the connection and/or blocking it from being
used.
Example: connect a click handler to a button. Being invoked, handler
prints a message and disconnects itself.
| (letrec((but(gtk-button-new "Hello"))
(signal-id
(gtk-signal-connect
but "clicked"
(lambda(button)
(print "Hello, World")
(gtk-signal-disconnect button signal-id)))))
...)
|
- procedure: gtk-signal-query-params query::gtk-signal-query => pair-nil
Signal introspection.
- procedure: gtk-signal-new-generic name::string run-type::gtk-signal-run-type object-type::gtk-type return-type::gtk-type . params => uint
Create a new signal and give it the character string identifier
name. name needs to be unique in the context of
object-type's branch of the class hierarchy. That is,
object-type cannot create a signal type with the same name as a
signal type created by one of its parent types.
run-type specifies whether the class function should be run before
('first
), after ('last
) or both before and after normal
signal handlers ('both
). Additionally, the 'no-recurse
value can be specified to specify that the signal should not be
recursive. By default, emitting the same signal on the same widget will
cause the signal to be emitted twice. However, if the 'no-recurse
flag is specified, emitting the same signal on the same widget will
cause the current signal emission to be restarted. This allows the
widget programmer to specify the semantics of signal emission on a per
signal basis. (The 'no-recurse
flag is used by the
gtk-adjustment
widget).
The return-val and the remaining arguments specify the return
value and the arguments to the signal handler respectively.
Note: There is an implicit first argument to every signal
handler which is the widget the signal has been emitted from.
The variable argument list params specifies the types of the
arguments (use gtk-type-from-name
to get gtk type
identifiers). It is OK to use (gtk-type-from-name "none")
for
return-val. (This corresponds to not returning a value).
| (define button(gtk-button-new))
button
=> #<foreign:gtk-button:84c7150>
(define guint-type(gtk-type-from-name "guint"))
guint-type => 6
(define button-type(gtk-type-from-name "GtkButton"))
button-type => 40469
(gtk-signal-new-generic "sum2"
'(both)
button-type ;; signal object type
guint-type ;; signal return type
guint-type ;; signal 1st arg type
guint-type ;; signal 2st arg type
)
=> 82
(gtk-signal-connect button
"sum2"
(lambda (button n1 n2) (+ n1 n2))))
=> 4
(gtk-signal-emit button "print-sum" 2 3)
=> 5
|
- procedure: gtk-signal-query-object-type o::gtk-signal-query => gtk-type
Access the object-type of gtk-signal-query
structure. See
gtk-signal-query
procedure description for more detail.
| (gtk-signal-query-object-type
(gtk-signal-query
(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject"))))
=> 21
|
- procedure: gtk-signal-query-signal-id o::gtk-signal-query => uint
Access the signal-id of gtk-signal-query
structure. See
gtk-signal-query
procedure description for more detail.
| (gtk-signal-query-signal-id
(gtk-signal-query
(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject"))))
=> 1
|
- procedure: gtk-signal-query-signal-name o::gtk-signal-query => string
Access the signal-name of gtk-signal-query
structure. See
gtk-signal-query
procedure description for more detail.
| (gtk-signal-query-signal-name
(gtk-signal-query
(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject"))))
=> "destroy"
|
- procedure: gtk-signal-query-is-user-signal o::gtk-signal-query => bool
Access the is-user-signal of gtk-signal-query
structure. See
gtk-signal-query
procedure description for more detail.
| (gtk-signal-query-is-user-signal
(gtk-signal-query
(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject"))))
=> #f
|
- procedure: gtk-signal-query-signal-flags o::gtk-signal-query => gtk-signal-run-type
Access the signal-flags of gtk-signal-query
structure. See
gtk-signal-query
procedure description for more detail.
| (gtk-signal-query-signal-flags
(gtk-signal-query
(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject"))))
=> '(no-hooks both last)
|
- procedure: gtk-signal-query-return-val o::gtk-signal-query => gtk-type
Access the return-val of gtk-signal-query
structure. See
gtk-signal-query
procedure description for more detail.
| (gtk-type-name
(gtk-signal-query-return-val
(gtk-signal-query
(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject")))))
=> "void"
|
- procedure: gtk-signal-lookup name::string type::gtk-type => uint
Returns the integer identifier for the signal referenced by name
and type. If type does not define the signal name,
then the signal is looked for in type's parent type recursively.
| (gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject"))
=> 1
|
- procedure: gtk-signal-name signal-id::uint => string
Lookup a signal by signal identifier signal-id, return signal
name. This procedure is complementary to the gtk-signal-lookup
procedure.
| (gtk-signal-name(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject")))
=> "destroy"
|
- procedure: gtk-signal-query signal-id::uint => gtk-signal-query
Query signal information.
| (let*((signal-id(gtk-signal-lookup "destroy"(gtk-type-from-name "GtkObject")))
(signal(gtk-signal-query signal-id)))
(print "type: " (gtk-signal-query-object-type signal))
(print "signal-id: " (gtk-signal-query-signal-id signal))
(print "signal-name: " (gtk-signal-query-signal-name signal))
(print "is-user-signal: " (gtk-signal-query-is-user-signal signal))
(print "signal-flags: " (gtk-signal-query-signal-flags signal))
(print "return-val: " (gtk-signal-query-return-val signal)))
-|type: 21
-|signal-id: 1
-|signal-name: destroy
-|is-user-signal: #f
-|signal-flags: (NO-HOOKS BOTH LAST)
-|return-val: 1
-|1
|
8.2.5 Widget Overview
8.2.5.1 The accel group object
- procedure: gtk-accel-group-remove accel_group::gtk-accel-group accel_key::uint accel_mods::gdk-modifier-type object::gtk-object => #unspecified
- accel_group
accel_key
accel_mods
object
- procedure: gtk-accel-group-add accel_group::gtk-accel-group accel_key::uint accel_mods::gdk-modifier-type accel_flags::gtk-accel-flags object::gtk-object accel_signal::string => #unspecified
- accel_group
accel_key
accel_mods
accel_flags
object
accel_signal
- procedure: gtk-accel-group-unlock accel_group::gtk-accel-group => #unspecified
- accel_group
- procedure: gtk-accel-group-lock accel_group::gtk-accel-group => #unspecified
- accel_group
- procedure: gtk-accel-group-detach accel_group::gtk-accel-group object::gtk-object => #unspecified
- accel_group
object
- procedure: gtk-accel-group-attach accel_group::gtk-accel-group object::gtk-object => #unspecified
- accel_group
object
- procedure: gtk-accel-group-new => gtk-accel-group
8.2.5.2 The accel label widget
- procedure: gtk-accel-label-set-accel-widget accel_label::gtk-accel-label accel_widget::gtk-widget => #unspecified
- accel_label
accel_widget
- procedure: gtk-accel-label-new label::string => gtk-widget
- label
8.2.5.3 The alignment widget
- procedure: gtk-alignment-set alignment::gtk-alignment xalign::float yalign::float xscale::float yscale::float => #unspecified
- alignment
xalign
yalign
xscale
yscale
- procedure: gtk-alignment-new xalign::float yalign::float xscale::float yscale::float => gtk-widget
- xalign
yalign
xscale
yscale
8.2.5.4 The arg object
- procedure: gtk-arg-type o::gtk-arg => gtk-type
- o
- procedure: gtk-arg-name o::gtk-arg => string
- o
8.2.5.5 The arrow widget
- procedure: gtk-arrow-set arrow::gtk-arrow arrow_type::gtk-arrow-type shadow_type::gtk-shadow-type => #unspecified
- arrow
arrow_type
shadow_type
- procedure: gtk-arrow-new arrow_type::gtk-arrow-type shadow_type::gtk-shadow-type => gtk-widget
- arrow_type
shadow_type
8.2.5.6 The aspect frame widget
- procedure: gtk-aspect-frame-set aspect_frame::gtk-aspect-frame xalign::float yalign::float ratio::float obey_child::bool => #unspecified
- aspect_frame
xalign
yalign
ratio
obey_child
- procedure: gtk-aspect-frame-new label::string xalign::float yalign::float ratio::float obey_child::bool => gtk-widget
- label
xalign
yalign
ratio
obey_child
8.2.5.7 The bin widget
8.2.5.8 The box widget
- procedure: gtk-box-set-child-packing box::gtk-box child::gtk-widget expand::bool fill::bool padding::int pack_type::gtk-pack-type => #unspecified
- box
child
expand
fill
padding
pack_type
- procedure: gtk-box-reorder-child box::gtk-box child::gtk-widget pos::uint => #unspecified
- box
child
pos
- procedure: gtk-box-set-spacing box::gtk-box spacing::int => #unspecified
- box
spacing
- procedure: gtk-box-set-homogeneous box::gtk-box homogenous::bool => #unspecified
- box
homogenous
- procedure: gtk-box-pack-end-defaults box::gtk-box child::gtk-widget => #unspecified
- box
child
- procedure: gtk-box-pack-start-defaults box::gtk-box child::gtk-widget => #unspecified
- box
child
- procedure: gtk-box-pack-end box::gtk-box child::gtk-widget #!optional expand fill padding => #unspecified
- box
child
expand
fill
padding
- procedure: gtk-box-pack-start box::gtk-box child::gtk-widget #!optional expand fill padding => #unspecified
- box
child
expand
fill
padding
8.2.5.9 The handle box widget
- procedure: gtk-handle-box-new => gtk-widget
8.2.5.10 The button box widget
- procedure: gtk-button-box-set-child-ipadding widget::gtk-button-box ipad_x::int ipad_y::int => #unspecified
- widget
ipad_x
ipad_y
- procedure: gtk-button-box-set-child-size widget::gtk-button-box min_width::int min_height::int => #unspecified
- widget
min_width
min_height
- procedure: gtk-button-box-set-layout widget::gtk-button-box layout_style::gtk-button-box-style => #unspecified
- widget
layout_style
- procedure: gtk-button-box-set-spacing widget::gtk-button-box spacing::int => #unspecified
- widget
spacing
- procedure: gtk-button-box-get-layout widget::gtk-button-box => gtk-button-box-style
- widget
- procedure: gtk-button-box-get-spacing widget::gtk-button-box => int
- widget
- procedure: gtk-button-box-set-child-ipadding-default ipad_x::int ipad_y::int => #unspecified
- ipad_x
ipad_y
- procedure: gtk-button-box-set-child-size-default min_width::int min_height::int => #unspecified
- min_width
min_height
8.2.5.11 The button widget
- procedure: gtk-button-leave button::gtk-button => #unspecified
- button
- procedure: gtk-button-enter button::gtk-button => #unspecified
- button
- procedure: gtk-button-clicked button::gtk-button => #unspecified
- button
- procedure: gtk-button-released button::gtk-button => #unspecified
- button
- procedure: gtk-button-pressed button::gtk-button => #unspecified
- button
- procedure: gtk-button-new label::string => gtk-widget
- label
- procedure: gtk-button-child o::gtk-button => gtk-widget
- o
- procedure: gtk-button-in-button o::gtk-button => bool
- o
- procedure: gtk-button-button-down o::gtk-button => bool
- o
8.2.5.12 The calendar widget
- procedure: gtk-calendar-thaw calendar::gtk-calendar => #unspecified
- calendar
- procedure: gtk-calendar-freeze calendar::gtk-calendar => #unspecified
- calendar
- procedure: gtk-calendar-clear-marks calendar::gtk-calendar => #unspecified
- calendar
- procedure: gtk-calendar-unmark-day calendar::gtk-calendar day::int => int
- calendar
day
- procedure: gtk-calendar-mark-day calendar::gtk-calendar day::int => int
- calendar
day
- procedure: gtk-calendar-select-day calendar::gtk-calendar day::int => #unspecified
- calendar
day
- procedure: gtk-calendar-select-month calendar::gtk-calendar month::int year::int => int
- calendar
month
year
- procedure: gtk-calendar-new => gtk-widget
8.2.5.13 The check button widget
- procedure: gtk-check-button-new label::string => gtk-widget
- label
8.2.5.14 The curve widget
- procedure: gtk-curve-set-curve-type curve::gtk-curve type::gtk-curve-type => #unspecified
- curve
type
- procedure: gtk-curve-set-range curve::gtk-curve min_x::float max_x::float min_y::float max_y::float => #unspecified
- curve
min_x
max_x
min_y
max_y
- procedure: gtk-curve-set-gamma curve::gtk-curve gamma::float => #unspecified
- curve
gamma
- procedure: gtk-curve-reset curve::gtk-curve => #unspecified
- curve
- procedure: gtk-curve-new => gtk-widget
8.2.5.15 The spin button widget
- procedure: gtk-spin-button-set-update-policy spin_button::gtk-spin-button policy::gtk-spin-button-update-policy => #unspecified
- spin_button
policy
- procedure: gtk-spin-button-set-value spin_button::gtk-spin-button value::float => #unspecified
- spin_button
value
- procedure: gtk-spin-button-get-value-as-int spin_button::gtk-spin-button => int
- spin_button
- procedure: gtk-spin-button-get-value-as-float spin_button::gtk-spin-button => float
- spin_button
- procedure: gtk-spin-button-set-digits spin_button::gtk-spin-button digits::int => #unspecified
- spin_button
digits
- procedure: gtk-spin-button-get-adjustment spin_button::gtk-spin-button => gtk-adjustment
- spin_button
- procedure: gtk-spin-button-set-adjustment spin_button::gtk-spin-button adjustment::gtk-adjustment => #unspecified
- spin_button
adjustment
- procedure: gtk-spin-button-new adjustment::gtk-adjustment climb_rate::float digits::int => gtk-widget
- adjustment
climb_rate
digits
8.2.5.16 The check menu item widget
- procedure: gtk-check-menu-item-toggled check_menu_item::gtk-check-menu-item => #unspecified
- check_menu_item
- procedure: gtk-check-menu-item-set-show-toggle menu_item::gtk-check-menu-item always::bool => #unspecified
- menu_item
always
- procedure: gtk-check-menu-item-set-state check_menu_item::gtk-check-menu-item state::bool => #unspecified
- check_menu_item
state
- procedure: gtk-check-menu-item-new label::string => gtk-widget
- label
- procedure: gtk-check-menu-item-set-active check_menu_item::gtk-check-menu-item is_active::bool => #unspecified
- check_menu_item
is_active
- procedure: gtk-check-menu-item-active o::gtk-check-menu-item => bool
- o
8.2.5.17 The compound list widget
- procedure: gtk-clist-for-each clist::gtk-clist handle::procedure => #unspecified
The gtk-clist-for-each
calls the handle procedure for each
row in clist with the contents of each row cell as argument. The
type of each argument depends on the type of corresponding cell
contents as follows:
empty
=> #f
text
=> bstring
pixmap
=> (list pixmap::gtk-pixmap mask::gtk-bitmap)
pixtext
=>
(list text::bstring spacing::uint pixmap::gtk-pixmap mask::gtk-bitmap)
widget
=> gtk-widget
The following example prints contents of two-column clist, all the cells
of which are simple text:
| (gtk-clist-for-each clist
(lambda(column1 column2)(print column1 " " column2)))
|
- procedure: gtk-clist-get-text clist::gtk-clist row::int column::int => bstring
- row clist row number, 0-based
column clist column number, 0-based
Returns the cell content string. Signals error if the cell is not of
GtkCellText
type or indices out of bounds.
- procedure: gtk-clist-set-auto-sort clist::gtk-clist auto_sort::bool => #unspecified
- clist
auto_sort
- procedure: gtk-clist-sort clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-set-sort-type clist::gtk-clist sort_type::gtk-sort-type => #unspecified
- clist
sort_type
- procedure: gtk-clist-set-sort-column clist::gtk-clist column::int => #unspecified
- clist
column
- procedure: gtk-clist-swap-rows clist::gtk-clist row1::int row2::int => #unspecified
- clist
row1
row2
- procedure: gtk-clist-unselect-all clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-clear clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-undo-selection clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-unselect-row clist::gtk-clist row::int column::int => #unspecified
- clist
row
column
- procedure: gtk-clist-select-row clist::gtk-clist row::int column::int => #unspecified
- clist
row
column
- procedure: gtk-clist-remove clist::gtk-clist row::int => #unspecified
- clist
row
- procedure: gtk-clist-get-selectable clist::gtk-clist row::int => bool
- clist
row
- procedure: gtk-clist-set-selectable clist::gtk-clist row::int selectable::bool => #unspecified
- clist
row
selectable
- procedure: gtk-clist-set-shift clist::gtk-clist row::int column::int vertical::int horizontal::int => #unspecified
- clist
row
column
vertical
horizontal
- procedure: gtk-clist-get-row-style clist::gtk-clist row::int => gtk-style
- clist
row
- procedure: gtk-clist-set-row-style clist::gtk-clist row::int style::gtk-style => #unspecified
- clist
row
style
- procedure: gtk-clist-get-cell-style clist::gtk-clist row::int column::int => gtk-style
- clist
row
column
- procedure: gtk-clist-set-cell-style clist::gtk-clist row::int column::int style::gtk-style => #unspecified
- clist
row
column
style
- procedure: gtk-clist-set-background clist::gtk-clist row::int color::gdk-color => #unspecified
- clist
row
color
- procedure: gtk-clist-set-foreground clist::gtk-clist row::int color::gdk-color => #unspecified
- clist
row
color
- procedure: gtk-clist-set-text clist::gtk-clist row::int column::int text::string => #unspecified
- clist
row
column
text
- procedure: gtk-clist-get-cell-type clist::gtk-clist row::int column::int => gtk-cell-type
- clist
row
column
- procedure: gtk-clist-row-is-visible clist::gtk-clist row::int => gtk-visibility
- clist
row
- procedure: gtk-clist-moveto clist::gtk-clist row::int column::int row_align::float column_align::float => #unspecified
- clist
row
column
row_align
column_align
- procedure: gtk-clist-set-row-height clist::gtk-clist height::int => #unspecified
- clist
height
- procedure: gtk-clist-set-column-max-width clist::gtk-clist column::int max_width::int => #unspecified
- clist
column
max_width
- procedure: gtk-clist-set-column-min-width clist::gtk-clist column::int min_width::int => #unspecified
- clist
column
min_width
- procedure: gtk-clist-set-column-width clist::gtk-clist column::int width::int => #unspecified
- clist
column
width
- procedure: gtk-clist-optimal-column-width clist::gtk-clist column::int => int
- clist
column
- procedure: gtk-clist-columns-autosize clist::gtk-clist => int
- clist
- procedure: gtk-clist-set-column-auto-resize clist::gtk-clist column::int auto_resize::bool => #unspecified
- clist
column
auto_resize
- procedure: gtk-clist-set-column-resizeable clist::gtk-clist column::int resizeable::bool => #unspecified
- clist
column
resizeable
- procedure: gtk-clist-set-column-visibility clist::gtk-clist column::int visible::bool => #unspecified
- clist
column
visible
- procedure: gtk-clist-set-column-justification clist::gtk-clist column::int justification::gtk-justification => #unspecified
- clist
column
justification
- procedure: gtk-clist-get-column-widget clist::gtk-clist column::int => gtk-widget
- clist
column
- procedure: gtk-clist-set-column-widget clist::gtk-clist column::int widget::gtk-widget => #unspecified
- clist
column
widget
- procedure: gtk-clist-set-column-title clist::gtk-clist column::int title::string => #unspecified
- clist
column
title
- procedure: gtk-clist-column-titles-passive clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-column-titles-active clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-column-title-passive clist::gtk-clist column::int => #unspecified
- clist
column
- procedure: gtk-clist-column-title-active clist::gtk-clist column::int => #unspecified
- clist
column
- procedure: gtk-clist-column-titles-hide clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-column-titles-show clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-thaw clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-freeze clist::gtk-clist => #unspecified
- clist
- procedure: gtk-clist-set-button-actions list::gtk-clist button::uint button_actions::uint => #unspecified
- list
button
button_actions
- procedure: gtk-clist-set-use-drag-icons list::gtk-clist use_icons::bool => #unspecified
- list
use_icons
- procedure: gtk-clist-set-reorderable clist::gtk-clist reorderable::bool => #unspecified
- clist
reorderable
- procedure: gtk-clist-set-selection-mode clist::gtk-clist mode::gtk-selection-mode => #unspecified
- clist
mode
- procedure: gtk-clist-get-vadjustment clist::gtk-clist => gtk-adjustment
- clist
- procedure: gtk-clist-get-hadjustment clist::gtk-clist => gtk-adjustment
- clist
- procedure: gtk-clist-set-vadjustment clist::gtk-clist adjustment::gtk-adjustment => #unspecified
- clist
adjustment
- procedure: gtk-clist-set-hadjustment clist::gtk-clist adjustment::gtk-adjustment => #unspecified
- clist
adjustment
- procedure: gtk-clist-new arg . titles => gtk-widget
Create gtk-clist
type object with optional titles. There are two methods of calling this procedure.
-
with one argument of integer type. The value of this argument is the
number of columns in a new
clist
;
-
with any positive number of arguments of
string
type. In this
case the number of columns in the new clist
is equal to the
number of arguments, and their values used as column titles.
Note: this procedure obsoletes guile-gtk
gtk-clist-new-with-titles
procedure.
Example1: create 3-column gtk-clist
:
Example1: create 2-column gtk-clist
and set the column titles to
"Column1" and "Column2":
| (gtk-clist-new "Column1" "Column2")
|
- procedure: gtk-clist-append clist::gtk-clist #!rest columns => #unspecified
Append a row to clist. The columns parameters should all be
strings forming a new row. The length of columns
should be
equal to the number of columns in clist.
| (gtk-clist-append(gtk-clist-new "Column1" "Column2") "Value1" "Value2")
|
- procedure: gtk-clist-prepend clist::gtk-clist #!rest columns => #unspecified
Prepend a row to clist. The columns parameters should all be
strings forming a new row. The length of columns
should be
equal to the number of columns in clist.
| (gtk-clist-prepend(gtk-clist-new "Column1" "Column2") "Value1" "Value2")
|
8.2.5.18 The color selector widget
- procedure: gtk-color-selection-set-opacity colorsel::gtk-color-selection use_opacity::bool => #unspecified
- colorsel
use_opacity
- procedure: gtk-color-selection-set-update-policy colorsel::gtk-color-selection policy::gtk-update-type => #unspecified
- colorsel
policy
- procedure: gtk-color-selection-new => gtk-widget
- procedure: gtk-color-selection-dialog-new title::string => gtk-widget
- title
- procedure: gtk-color-selection-dialog-colorsel o::gtk-color-selection-dialog => gtk-widget
- o
- procedure: gtk-color-selection-dialog-main-vbox o::gtk-color-selection-dialog => gtk-widget
- o
- procedure: gtk-color-selection-dialog-ok-button o::gtk-color-selection-dialog => gtk-widget
- o
- procedure: gtk-color-selection-dialog-reset-button o::gtk-color-selection-dialog => gtk-widget
- o
- procedure: gtk-color-selection-dialog-cancel-button o::gtk-color-selection-dialog => gtk-widget
- o
- procedure: gtk-color-selection-dialog-help-button o::gtk-color-selection-dialog => gtk-widget
- o
- procedure: gtk-color-selection-get-color selection::gtk-color-selection => pair
Return current color selection as list of four double values (RGB+opacity).
| (let* ((window(gtk-color-selection-dialog-new "color selection dialog"))
(selection(gtk-color-selection-dialog-colorsel window)))
(gtk-color-selection-get-color selection))
=> (1.0 1.0 1.0 1.527836969495e-312)
|
8.2.5.19 The combo widget
- procedure: gtk-combo-disable-activate combo::gtk-combo => #unspecified
- combo
- procedure: gtk-combo-set-item-string combo::gtk-combo item::gtk-item item_value::string => #unspecified
- combo
item
item_value
- procedure: gtk-combo-set-case-sensitive combo::gtk-combo val::bool => #unspecified
- combo
val
- procedure: gtk-combo-set-use-arrows-always combo::gtk-combo val::bool => #unspecified
- combo
val
- procedure: gtk-combo-set-use-arrows combo::gtk-combo val::bool => #unspecified
- combo
val
- procedure: gtk-combo-set-value-in-list combo::gtk-combo val::bool ok_if_empty::bool => #unspecified
- combo
val
ok_if_empty
- procedure: gtk-combo-new => gtk-widget
- procedure: gtk-combo-entry o::gtk-combo => gtk-widget
- o
- procedure: gtk-combo-button o::gtk-combo => gtk-widget
- o
- procedure: gtk-combo-popup o::gtk-combo => gtk-widget
- o
- procedure: gtk-combo-popwin o::gtk-combo => gtk-widget
- o
- procedure: gtk-combo-list o::gtk-combo => gtk-widget
- o
- procedure: gtk-combo-set-popdown-strings combo::gtk-combo strings::pair-nil => #unspecified
- combo
strings
8.2.5.20 The container widget
- procedure: gtk-container-unregister-toplevel container::gtk-container => #unspecified
- container
- procedure: gtk-container-register-toplevel container::gtk-container => #unspecified
- container
- procedure: gtk-container-focus container::gtk-container direction::gtk-direction-type => gtk-direction-type
- container
direction
- procedure: gtk-container-remove container::gtk-container widget::gtk-widget => #unspecified
- container
widget
- procedure: gtk-container-add container::gtk-container widget::gtk-widget => #unspecified
- container
widget
- procedure: gtk-container-border-width container::gtk-container border_width::int => #unspecified
- container
border_width
- procedure: gtk-container-set-focus-hadjustment container::gtk-container adjustment::gtk-adjustment => #unspecified
- container
adjustment
- procedure: gtk-container-set-focus-vadjustment container::gtk-container adjustment::gtk-adjustment => #unspecified
- container
adjustment
- procedure: gtk-container-set-border-width container::gtk-container border_width::uint => #unspecified
- container
border_width
8.2.5.21 The font selector widget
- procedure: gtk-font-selection-dialog-set-preview-text fontsel::gtk-font-selection-dialog text::string => #unspecified
- fontsel
text
- procedure: gtk-font-selection-dialog-set-font-name fontsel::gtk-font-selection-dialog fontname::string => bool
- fontsel
fontname
- procedure: gtk-font-selection-dialog-get-font fontsel::gtk-font-selection-dialog => gdk-font
- fontsel
- procedure: gtk-font-selection-dialog-get-font-name fontsel::gtk-font-selection-dialog => string
- fontsel
- procedure: gtk-font-selection-dialog-new title::string => gtk-widget
- title
- procedure: gtk-font-selection-dialog-main-vbox o::gtk-font-selection-dialog => gtk-widget
- o
- procedure: gtk-font-selection-dialog-action-area o::gtk-font-selection-dialog => gtk-widget
- o
- procedure: gtk-font-selection-dialog-ok-button o::gtk-font-selection-dialog => gtk-widget
- o
- procedure: gtk-font-selection-dialog-apply-button o::gtk-font-selection-dialog => gtk-widget
- o
- procedure: gtk-font-selection-dialog-cancel-button o::gtk-font-selection-dialog => gtk-widget
- o
8.2.5.22 The file selector widget
- procedure: gtk-file-selection-hide-fileop-buttons filesel::gtk-file-selection => #unspecified
- filesel
- procedure: gtk-file-selection-show-fileop-buttons filesel::gtk-file-selection => #unspecified
- filesel
- procedure: gtk-file-selection-get-filename filesel::gtk-file-selection => string
- filesel
- procedure: gtk-file-selection-set-filename filesel::gtk-file-selection filename::string => #unspecified
- filesel
filename
- procedure: gtk-file-selection-new title::string => gtk-widget
- title
- procedure: gtk-file-selection-dir-list o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-file-list o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-selection-entry o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-selection-text o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-main-vbox o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-ok-button o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-cancel-button o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-help-button o::gtk-file-selection => gtk-widget
- o
- procedure: gtk-file-selection-action-area o::gtk-file-selection => gtk-widget
- o
8.2.5.23 The multi-column tree widget
8.2.5.24 The curve widget
8.2.5.25 The gamma curve widget
- procedure: gtk-gamma-curve-new => gtk-widget
- procedure: gtk-gamma-curve-table o::gtk-gamma-curve => gtk-widget
- o
- procedure: gtk-gamma-curve-curve o::gtk-gamma-curve => gtk-widget
- o
- procedure: gtk-gamma-curve-gamma o::gtk-gamma-curve => float
- o
- procedure: gtk-gamma-curve-gamma-dialog o::gtk-gamma-curve => gtk-widget
- o
- procedure: gtk-gamma-curve-gamma-text o::gtk-gamma-curve => gtk-widget
- o
8.2.5.26 The dialog widget
- procedure: gtk-dialog-new => gtk-widget
- procedure: gtk-dialog-vbox o::gtk-dialog => gtk-widget
- o
- procedure: gtk-dialog-action-area o::gtk-dialog => gtk-widget
- o
8.2.5.27 The drawing area widget
- procedure: gtk-drawing-area-size darea::gtk-drawing-area width::int height::int => #unspecified
- darea
width
height
- procedure: gtk-drawing-area-new => gtk-widget
8.2.5.28 The entry widget
- procedure: gtk-entry-set-editable entry::gtk-entry editable::bool => #unspecified
- entry
editable
- procedure: gtk-entry-set-visibility entry::gtk-entry visible::bool => #unspecified
- entry
visible
- procedure: gtk-entry-select-region entry::gtk-entry start::int end::int => #unspecified
- entry
start
end
- procedure: gtk-entry-set-position entry::gtk-entry position::int => #unspecified
- entry
position
- procedure: gtk-entry-prepend-text entry::gtk-entry text::string => #unspecified
- entry
text
- procedure: gtk-entry-append-text entry::gtk-entry text::string => #unspecified
- entry
text
- procedure: gtk-entry-set-text entry::gtk-entry text::string => #unspecified
- entry
text
- procedure: gtk-entry-new-with-max-length max::int => gtk-widget
- max
- procedure: gtk-entry-new => gtk-widget
8.2.5.29 The editable widget
gtk-editable
-- Base class for text-editing widgets.
The gtk-editable
class is a base class for widgets for editing
text, such as gtk-entry
and gtk-text
. It cannot be
instantiated by itself. The editable class contains functions for
generically manipulating an editable widget, a large number of action
signals used for key bindings, and several signals that an application
can connect to to modify the behavior of a widget.
As an example of the latter usage, by connecting the following handler
to insert-text
, an application can convert all entry into a widget
into uppercase.
| (letrec((signal-id
(gtk-signal-connect
entry
"insert_text"
(lambda (entry text position)
(gtk-signal-handler-block entry signal-id)
(gtk-editable-insert-text
entry
(string-upcase text)
position)
(gtk-signal-handler-unblock entry signal-id)
(gtk-signal-emit-stop entry "insert_text")
(+fx 1 position)
)
)))
#unspecified)
|
- procedure: gtk-editable-changed editable::gtk-editable
The call gtk-editable-changed
is effectively equivalent to the
call:
| (gtk-signal-emit editable "changed")
|
- procedure: gtk-editable-copy-clipboard editable::gtk-editable
The call gtk-editable-copy-clipboard
causes the characters in the
current selection to be copied to the clipboard. It is effectively
equivalent to the call:
| (gtk-signal-emit editable "copy-clipboard")
=>
|
- procedure: gtk-editable-cut-clipboard editable::gtk-editable
The call gtk-editable-cut-clipboard
causes the characters in the
current selection to be copied to the clipboard and then deleted from
the widget. It is effectively equivalent to the call:
| (gtk-signal-emit editable "cut-clipboard")
=>
|
- procedure: gtk-editable-delete-selection editable::gtk-editable
The procedure gtk-editable-delete-selection
deletes the selected
text, sets the selection start and end positions to 0 (see
gtk-editable-selection-start-pos
and
gtk-editable-selection-end-pos
, disclaims the selection, and
clears the flag accessible thru gtk-editable-has-selection
.
For example:
| (let((text(gtk-text-new)))
(gtk-editable-insert-text text "The quick brown fox jumps over the lazy dog")
(gtk-container-add <some container> text)
(define(describe-selection)
(print "the text: "(gtk-editable-get-chars text))
(print "gtk-editable-selection-start-pos: "
(gtk-editable-selection-start-pos text))
(print "gtk-editable-selection-end-pos: "
(gtk-editable-selection-end-pos text)))
(gtk-editable-set-editable text #t)
(gtk-editable-select-region text 10 20)
(describe-selection)
(gtk-editable-delete-selection text)
(describe-selection)
)
-| the text: The quick brown fox jumps over the lazy dog
-| gtk-editable-selection-start-pos: 10
-| gtk-editable-selection-end-pos: 20
-| the text: The quick jumps over the lazy dog
-| gtk-editable-selection-start-pos: 0
-| gtk-editable-selection-end-pos: 0
|
- procedure: gtk-editable-delete-text editable::gtk-editable start::int end::int
Delete a sequence of characters. The characters that are deleted are those
characters at positions from start up to, but not including end. If
end is negative, then the the characters deleted will be those
characters from start to the end of the text.
- procedure: gtk-editable-get-chars editable::gtk-editable #!optional (start 0) (end -1) => bstring
The procedure gtk-editable-get-chars
retrieves a sequence of
characters. The characters that are retrieved are those characters at
positions from start up to, but not including end. If
end is negative or omitted, then the the characters retrieved will
be those characters from start to the end of the text.
For example:
| ;; Retrieve the whole text
(gtk-editable-get-chars text)
;; Retrieve the characters at positions from 10 to the end of the text
(gtk-editable-get-chars text 10)
;; Retrieve the characters at positions from 10 to 20
(gtk-editable-get-chars text 10 20)
|
- procedure: gtk-editable-get-position o::gtk-editable => uint
The call gtk-editable-get-position
returns the current_pos
field of gtk-editable
structure. See also gtk-editable-set-position
.
- procedure: gtk-editable-get-type => gtk-type
The procedure gtk-editable-get-type
creates if neccessary, and
returns the type suitable to create the gtk-editable
objects by
gtk-object-new
.
For example:
| (gtk-object-new(gtk-editable-get-type) editable: #t)
=> #<foreign:gtk-editable:84c8278>
|
- procedure: gtk-editable-has-selection editable::gtk-editable => bool
The procedure gtk-editable-has-selection
returns #t
is the
widget editable has a non-empty selection.
- procedure: gtk-editable-insert-text editable::gtk-editable text::bstring #!optional (position 0)
The procedure gtk-editable-insert-text
inserts text at a
given position or at the beginning of the edited text if the
position argument is omitted
- procedure: gtk-editable-paste-clipboard editable::gtk-editable
The procedure gtk-editable-paste-clipboard
causes the contents of
the clipboard to be pasted into the given widget at the current cursor
position. It is effectively equivalent to the call:
| (gtk-signal-emit editable "paste-clipboard")
|
- procedure: gtk-editable-select-region editable::gtk-editable #!optional (start 0) (end 0)
The procedure gtk-editable-select-region
selects a region of
text. The characters that are selected are those characters at positions
from start up to, but not including end. If end is
negative or omitted, then the the characters selected will be those
characters from start to the end of the text. If start is
omitted either then all the characters in a text are selected.
- procedure: gtk-editable-selection-end-pos o::gtk-editable => uint
The procedure gtk-editable-selection-start-pos
returns the
starting position of the selected characters in the widget.
- procedure: gtk-editable-selection-start-pos o::gtk-editable => uint
The procedure gtk-editable-selection-start-pos
returns the
starting position of the selected characters in the widget.
- procedure: gtk-editable-set-editable editable::gtk-editable is-editable::bool
is-editable #t
if the user is allowed to edit the text in the widget.
The procedure gtk-editable-set-editable
determines if the user
can edit the text in the editable widget or not.
- procedure: gtk-editable-set-position editable::gtk-editable #!optional (position 0)
The procedure gtk-editable-set-position
sets the cursor position
to position. The cursor is displayed before the character with the
given (base 0) index in the widget. The value must be less than or
equal to the number of characters in the widget. A value of -1 (default)
indicates that the position should be set after the last character in
the entry. Note that this position is in characters, not in bytes.
- procedure: gtk-editable? obj => bool
The procedure gtk-editable?
returns #t
if the obj
is of gtk-editable
type.
8.2.5.30 The event box widget
- procedure: gtk-event-box-new => gtk-widget
8.2.5.31 The file selection dialog widget
8.2.5.32 The fixed widget
- procedure: gtk-fixed-move fixed::gtk-fixed widget::gtk-widget x::int y::int => #unspecified
- fixed
widget
x
y
- procedure: gtk-fixed-put fixed::gtk-fixed widget::gtk-widget x::int y::int => #unspecified
- fixed
widget
x
y
- procedure: gtk-fixed-new => gtk-widget
8.2.5.33 The frame widget
- procedure: gtk-frame-set-shadow-type frame::gtk-frame type::gtk-shadow-type => #unspecified
- frame
type
- procedure: gtk-frame-set-label-align frame::gtk-frame xalign::float yalign::float => #unspecified
- frame
xalign
yalign
- procedure: gtk-frame-set-label frame::gtk-frame label::string => #unspecified
- frame
label
- procedure: gtk-frame-new #!optional label => gtk-widget
- label
8.2.5.34 The gamma widget
8.2.5.35 The horizontal box widget
- procedure: gtk-hbox-new #!optional homogenous spacing => gtk-widget
- homogenous
spacing
8.2.5.36 The horizontal button box widget
- procedure: gtk-hbutton-box-set-layout-default layout::gtk-button-box-style => #unspecified
- layout
- procedure: gtk-hbutton-box-set-spacing-default spacing::int => #unspecified
- spacing
- procedure: gtk-hbutton-box-get-layout-default => gtk-button-box-style
- procedure: gtk-hbutton-box-get-spacing-default => int
- procedure: gtk-hbutton-box-new => gtk-widget
8.2.5.37 The horizontal paned widget
- procedure: gtk-hpaned-new => gtk-widget
8.2.5.38 The horizontal ruler widget
- procedure: gtk-hruler-new => gtk-widget
8.2.5.39 The horizontal scale widget
- procedure: gtk-hscale-new adjustment::gtk-adjustment => gtk-widget
- adjustment
8.2.5.40 The vertical scale widget
- procedure: gtk-vscale-new adjustment::gtk-adjustment => gtk-widget
- adjustment
8.2.5.41 The horizontal scrollbar widget
- procedure: gtk-hscrollbar-new adjustment::gtk-adjustment => gtk-widget
- adjustment
8.2.5.42 The horizontal separator widget
- procedure: gtk-hseparator-new => gtk-widget
8.2.5.43 The image widget
8.2.5.44 The input dialog widget
- procedure: gtk-input-dialog-new => gtk-widget
- procedure: gtk-input-dialog-close-button o::gtk-input-dialog => gtk-widget
- o
- procedure: gtk-input-dialog-save-button o::gtk-input-dialog => gtk-widget
- o
8.2.5.45 The item widget
- procedure: gtk-item-toggle item::gtk-item => #unspecified
- item
- procedure: gtk-item-deselect item::gtk-item => #unspecified
- item
- procedure: gtk-item-select item::gtk-item => #unspecified
- item
8.2.5.46 The label widget
- procedure: gtk-label-set-pattern label::gtk-label str::string => #unspecified
- label
str
- procedure: gtk-label-set-line-wrap label::gtk-label wrap::bool => #unspecified
- label
wrap
- procedure: gtk-label-set-justify label::gtk-label jtype::gtk-justification => #unspecified
- label
jtype
- procedure: gtk-label-set-text label::gtk-label str::string => #unspecified
- label
str
- procedure: gtk-label-new str::string => gtk-widget
- str
- procedure: gtk-label-parse-uline label::gtk-label name::string => uint
- label
name
8.2.5.47 The list widget
- procedure: gtk-list-remove-items list::gtk-list items::g-list => #unspecified
- list
items
- procedure: gtk-list-children o::gtk-list => g-list
- o
- procedure: gtk-list-selection o::gtk-list => g-list
- o
- procedure: gtk-list-undo-selection o::gtk-list => g-list
- o
- procedure: gtk-list-undo-unselection o::gtk-list => g-list
- o
- procedure: gtk-list-last-focus-child o::gtk-list => gtk-widget
- o
- procedure: gtk-list-undo-focus-child o::gtk-list => gtk-widget
- o
- procedure: gtk-list-htimer o::gtk-list => uint
- o
- procedure: gtk-list-vtimer o::gtk-list => uint
- o
- procedure: gtk-list-anchor o::gtk-list => int
- o
- procedure: gtk-list-drag-pos o::gtk-list => int
- o
- procedure: gtk-list-anchor-state o::gtk-list => gtk-state-type
- o
- procedure: gtk-list-selection-mode o::gtk-list => gtk-selection-mode
- o
- procedure: gtk-list-drag-selection o::gtk-list => bool
- o
- procedure: gtk-list-add-mode o::gtk-list => bool
- o
- procedure: gtk-list-set-selection-mode list::gtk-list mode::gtk-selection-mode => #unspecified
- list
mode
- procedure: gtk-list-child-position list::gtk-list child::gtk-widget => int
- list
child
- procedure: gtk-list-unselect-child list::gtk-list child::gtk-widget => #unspecified
- list
child
- procedure: gtk-list-select-child list::gtk-list child::gtk-widget => #unspecified
- list
child
- procedure: gtk-list-unselect-item list::gtk-list item::int => #unspecified
- list
item
- procedure: gtk-list-select-item list::gtk-list item::int => #unspecified
- list
item
- procedure: gtk-list-clear-items list::gtk-list start::int end::int => #unspecified
- list
start
end
- procedure: gtk-list-new => gtk-widget
8.2.5.48 The list item widget
- procedure: gtk-list-item-deselect list_item::gtk-list-item => #unspecified
- list_item
- procedure: gtk-list-item-select list_item::gtk-list-item => #unspecified
- list_item
- procedure: gtk-list-item-new label::string => gtk-widget
- label
8.2.5.49 The menu widget
- procedure: gtk-menu-detach menu::gtk-menu => #unspecified
- menu
- procedure: gtk-menu-get-attach-widget menu::gtk-menu => gtk-widget
- menu
- procedure: gtk-menu-set-active menu::gtk-menu index::int => #unspecified
- menu
index
- procedure: gtk-menu-get-active menu::gtk-menu => gtk-widget
- menu
- procedure: gtk-menu-popdown menu::gtk-menu => #unspecified
- menu
- procedure: gtk-menu-insert menu::gtk-menu child::gtk-widget position::int => #unspecified
- menu
child
position
- procedure: gtk-menu-prepend menu::gtk-menu child::gtk-widget => #unspecified
- menu
child
- procedure: gtk-menu-append menu::gtk-menu child::gtk-widget => #unspecified
Append a menu item, created by any of gtk-menu-item-new
,
gtk-check-menu-item-new
or gtk-radio-menu-item-new
.
- procedure: gtk-menu-new => gtk-widget
- procedure: gtk-menu-ensure-uline-accel-group menu::gtk-menu => gtk-accel-group
- menu
- procedure: gtk-menu-get-uline-accel-group menu::gtk-menu => gtk-accel-group
- menu
- procedure: gtk-menu-popup menu::gtk-menu #!optional parent-menu-shell parent-menu-item callback button activate-time => #unspecified
Display the menu onscreen.
Arguments:
In the following example a button is created. Pressing the button pops
up the menu menu
. Change the callback value from #f to
menu positioning procedure (commented out in this example), the menu
will appear on screen at X=100, Y=300 position.
| (let((button(gtk-button-new "Press me")))
(gtk-signal-connect
button "event"
(lambda(button event)
(and(eq?(gdk-event-type event) 'button-press)
(gtk-menu-popup
menu #f #f
#f ;;(lambda (menu)(values 100 300))
(gdk-event-button event)
(gdk-event-time event))))))
|
See menu-popup
file in examples
catalog for full example text.
8.2.5.50 The menu bar widget
- procedure: gtk-menu-bar-insert menu_bar::gtk-menu-bar child::gtk-widget position::int => #unspecified
- menu_bar
child
position
- procedure: gtk-menu-bar-prepend menu_bar::gtk-menu-bar child::gtk-widget => #unspecified
- menu_bar
child
- procedure: gtk-menu-bar-append menu_bar::gtk-menu-bar child::gtk-widget => #unspecified
- menu_bar
child
- procedure: gtk-menu-bar-new => gtk-widget
8.2.5.51 The menu shell widget
- procedure: gtk-menu-shell-deactivate menu_shell::gtk-menu-shell => #unspecified
- menu_shell
- procedure: gtk-menu-shell-insert menu_shell::gtk-menu-shell child::gtk-widget position::int => #unspecified
- menu_shell
child
position
- procedure: gtk-menu-shell-prepend menu_shell::gtk-menu-shell child::gtk-widget => #unspecified
- menu_shell
child
- procedure: gtk-menu-shell-append menu_shell::gtk-menu-shell child::gtk-widget => #unspecified
- menu_shell
child
8.2.5.52 The tearoff menu item widget
- procedure: gtk-tearoff-menu-item-new => gtk-widget
8.2.5.53 The menu item widget
- procedure: gtk-menu-item-right-justify menu_item::gtk-menu-item => #unspecified
- menu_item
- procedure: gtk-menu-item-activate menu_item::gtk-menu-item => #unspecified
- menu_item
- procedure: gtk-menu-item-deselect menu_item::gtk-menu-item => #unspecified
- menu_item
- procedure: gtk-menu-item-select menu_item::gtk-menu-item => #unspecified
- menu_item
- procedure: gtk-menu-item-configure menu_item::gtk-menu-item show_toggle_indicator::bool show_submenu_indicator::bool => #unspecified
- menu_item
show_toggle_indicator
show_submenu_indicator
- procedure: gtk-menu-item-set-placement menu_item::gtk-menu-item placement::gtk-submenu-placement => #unspecified
- menu_item
placement
- procedure: gtk-menu-item-remove-submenu menu_item::gtk-menu-item => #unspecified
- menu_item
- procedure: gtk-menu-item-set-submenu menu_item::gtk-menu-item submenu::gtk-widget => #unspecified
- menu_item
submenu
- procedure: gtk-menu-item-new #!optional label => gtk-widget
- Create new menu item with optional label.
- procedure: gtk-radio-menu-item-new . args => gtk-radio-menu-item
Create new gtk-radio-menu-item
. The first optional args arguments may provide the information on item group and label. The rest of optional args are assumed to be keyword arguments and are passed to gtk-object-set
procedure.
Let's illustrate the various creation methods be example. Creates four items in a group:
| (let*((one (gtk-radio-menu-item-new "One")) ;; create new item group implicitly
(two (gtk-radio-menu-item-new one)) ;; attach a new unlabeled item to the same group as item one
(three(gtk-radio-menu-item-new two "Three")) ;; attach a new labeled item to the same group as items one and two
(four(gtk-radio-menu-item-new two "Four" ;; attach a new labeled item to the same group as other items
x: 10)) ;; and set the item X coordinate to 10
)
...)
|
8.2.5.54 The menu shell widget
8.2.5.55 The misc widget
- procedure: gtk-misc-set-padding misc::gtk-misc xpad::int ypad::int => #unspecified
- misc
xpad
ypad
- procedure: gtk-misc-set-alignment misc::gtk-misc xalign::float yalign::float => #unspecified
- misc
xalign
yalign
8.2.5.56 The notebook widget
- procedure: gtk-notebook-tab-pos o::gtk-notebook => gtk-position-type
- o
- procedure: gtk-notebook-reorder-child notebook::gtk-notebook child::gtk-widget position::int => #unspecified
- notebook
child
position
- procedure: gtk-notebook-set-menu-label notebook::gtk-notebook child::gtk-widget menu_label::gtk-widget => #unspecified
- notebook
child
menu_label
- procedure: gtk-notebook-get-menu-label notebook::gtk-notebook child::gtk-widget => gtk-widget
- notebook
child
- procedure: gtk-notebook-set-tab-label notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget => #unspecified
- notebook
child
tab_label
- procedure: gtk-notebook-get-tab-label notebook::gtk-notebook child::gtk-widget => gtk-widget
- notebook
child
- procedure: gtk-notebook-popup-disable notebook::gtk-notebook => #unspecified
- notebook
- procedure: gtk-notebook-popup-enable notebook::gtk-notebook => #unspecified
- notebook
- procedure: gtk-notebook-set-tab-vborder notebook::gtk-notebook tab_vborder::int => #unspecified
- notebook
tab_vborder
- procedure: gtk-notebook-set-tab-hborder notebook::gtk-notebook tab_hborder::int => #unspecified
- notebook
tab_hborder
- procedure: gtk-notebook-set-homogeneous-tabs notebook::gtk-notebook homogenous::bool => #unspecified
- notebook
homogenous
- procedure: gtk-notebook-set-tab-border notebook::gtk-notebook border_width::int => #unspecified
- notebook
border_width
- procedure: gtk-notebook-set-scrollable notebook::gtk-notebook scrollable::bool => #unspecified
- notebook
scrollable
- procedure: gtk-notebook-set-show-border notebook::gtk-notebook show_border::bool => #unspecified
- notebook
show_border
- procedure: gtk-notebook-set-show-tabs notebook::gtk-notebook show_tabs::bool => #unspecified
- notebook
show_tabs
- procedure: gtk-notebook-set-tab-pos notebook::gtk-notebook pos::gtk-position-type => #unspecified
- notebook
pos
- procedure: gtk-notebook-prev-page notebook::gtk-notebook => #unspecified
- notebook
- procedure: gtk-notebook-next-page notebook::gtk-notebook => #unspecified
- notebook
- procedure: gtk-notebook-set-page notebook::gtk-notebook page_num::int => #unspecified
- notebook
page_num
- procedure: gtk-notebook-page-num notebook::gtk-notebook child::gtk-widget => int
- notebook
child
- procedure: gtk-notebook-get-nth-page notebook::gtk-notebook page_num::int => gtk-widget
- notebook
page_num
- procedure: gtk-notebook-get-current-page notebook::gtk-notebook => int
- notebook
- procedure: gtk-notebook-remove-page notebook::gtk-notebook page_num::int => #unspecified
- notebook
page_num
- procedure: gtk-notebook-insert-page-menu notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget menu_label::gtk-widget position::int => #unspecified
- notebook
child
tab_label
menu_label
position
- procedure: gtk-notebook-insert-page notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget position::int => #unspecified
- notebook
child
tab_label
position
- procedure: gtk-notebook-prepend-page-menu notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget menu_label::gtk-widget => #unspecified
- notebook
child
tab_label
menu_label
- procedure: gtk-notebook-prepend-page notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget => #unspecified
- notebook
child
tab_label
- procedure: gtk-notebook-append-page-menu notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget menu_label::gtk-widget => #unspecified
- notebook
child
tab_label
menu_label
- procedure: gtk-notebook-append-page notebook::gtk-notebook child::gtk-widget tab_label::gtk-widget => #unspecified
- notebook
child
tab_label
- procedure: gtk-notebook-new => gtk-widget
8.2.5.57 The option menu widget
- procedure: gtk-option-menu-menu o::gtk-option-menu => gtk-widget
- o
- procedure: gtk-option-menu-menu-item o::gtk-option-menu => gtk-widget
- o
- procedure: gtk-option-menu-width o::gtk-option-menu => uint
- o
- procedure: gtk-option-menu-height o::gtk-option-menu => uint
- o
- procedure: gtk-option-menu-set-history option_menu::gtk-option-menu index::int => #unspecified
- option_menu
index
- procedure: gtk-option-menu-remove-menu option_menu::gtk-option-menu => #unspecified
- option_menu
- procedure: gtk-option-menu-set-menu option_menu::gtk-option-menu menu::gtk-widget => #unspecified
- option_menu
menu
- procedure: gtk-option-menu-get-menu option_menu::gtk-option-menu => gtk-widget
- option_menu
- procedure: gtk-option-menu-new => gtk-widget
8.2.5.58 The paned widget
- procedure: gtk-paned-gutter-size paned::gtk-paned size::int => #unspecified
- paned
size
- procedure: gtk-paned-handle-size paned::gtk-paned size::int => #unspecified
- paned
size
- procedure: gtk-paned-add2 paned::gtk-paned child::gtk-widget => #unspecified
- paned
child
- procedure: gtk-paned-add1 paned::gtk-paned child::gtk-widget => #unspecified
- paned
child
8.2.5.59 The pixmap widget
- procedure: gtk-pixmap-new filename::string w::gtk-widget => gtk-widget
- Read pixmap file filename, widget w must descend from
realized window.
8.2.5.60 The plug widget
- procedure: gtk-plug-new socket_id::int => gtk-widget
- socket_id
- procedure: gtk-plug-socket-window o::gtk-plug => gdk-window
- o
- procedure: gtk-plug-same-app o::gtk-plug => bool
- o
8.2.5.61 The preview widget
- procedure: gtk-preview-get-cmap => gdk-colormap
- procedure: gtk-preview-get-visual => gdk-visual
- procedure: gtk-preview-set-reserved nreserved::int => #unspecified
- nreserved
- procedure: gtk-preview-set-install-cmap install_cmap::bool => #unspecified
- install_cmap
- procedure: gtk-preview-set-color-cube nred_shades::uint ngreen_shades::uint nblue_shades::uint ngray_shades::uint => #unspecified
- nred_shades
ngreen_shades
nblue_shades
ngray_shades
- procedure: gtk-preview-set-expand preview::gtk-preview expand::bool => #unspecified
- preview
expand
- procedure: gtk-preview-size preview::gtk-preview width::int height::int => #unspecified
- preview
width
height
- procedure: gtk-preview-new type::gtk-preview-type => gtk-widget
- type
8.2.5.62 The progress bar widget
- procedure: gtk-progress-get-text-from-value progress::gtk-progress value::float => string
- progress
value
- procedure: gtk-progress-get-current-text progress::gtk-progress => string
- progress
- procedure: gtk-progress-set-activity-mode progress::gtk-progress activity_mode::bool => #unspecified
- progress
activity_mode
- procedure: gtk-progress-get-value progress::gtk-progress => float
- progress
- procedure: gtk-progress-set-value progress::gtk-progress value::float => #unspecified
- progress
value
- procedure: gtk-progress-set-percentage progress::gtk-progress percentage::float => #unspecified
- progress
percentage
- procedure: gtk-progress-configure progress::gtk-progress value::float min::float max::float => #unspecified
- progress
value
min
max
- procedure: gtk-progress-set-adjustment progress::gtk-progress adjustment::gtk-adjustment => #unspecified
- progress
adjustment
- procedure: gtk-progress-set-format-string progress::gtk-progress format::string => #unspecified
- progress
format
- procedure: gtk-progress-set-text-alignment progress::gtk-progress x_align::float y_align::float => #unspecified
- progress
x_align
y_align
- procedure: gtk-progress-set-show-text progress::gtk-progress show_text::bool => #unspecified
- progress
show_text
- procedure: gtk-progress-bar-update progress_bar::gtk-progress-bar percentage::float => #unspecified
- progress_bar
percentage
- procedure: gtk-progress-bar-set-activity-blocks progressbar::gtk-progress-bar blocks::int => #unspecified
- progressbar
blocks
- procedure: gtk-progress-bar-set-activity-step progressbar::gtk-progress-bar step::int => #unspecified
- progressbar
step
- procedure: gtk-progress-bar-set-discrete-blocks progressbar::gtk-progress-bar blocks::int => #unspecified
- progressbar
blocks
- procedure: gtk-progress-bar-new => gtk-widget
8.2.5.63 The radio button widget
- procedure: gtk-radio-button-new-from-widget #!optional samegroup label => gtk-widget
- samegroup
label
8.2.5.64 The range widget
- procedure: gtk-range-set-adjustment range::gtk-range adjustment::gtk-adjustment => #unspecified
- range
adjustment
- procedure: gtk-range-set-update-policy range::gtk-range policy::gtk-update-type => #unspecified
- range
policy
- procedure: gtk-range-get-adjustment range::gtk-range => gtk-adjustment
- range
8.2.5.65 The ruler widget
- procedure: gtk-ruler-draw-pos ruler::gtk-ruler => #unspecified
- ruler
- procedure: gtk-ruler-draw-ticks ruler::gtk-ruler => #unspecified
- ruler
- procedure: gtk-ruler-set-range ruler::gtk-ruler lower::float upper::float position::float max_size::float => #unspecified
- ruler
lower
upper
position
max_size
- procedure: gtk-ruler-set-metric ruler::gtk-ruler metric::gtk-metric-type => #unspecified
- ruler
metric
8.2.5.66 The scale widget
- procedure: gtk-scale-draw-value scale::gtk-scale => #unspecified
- scale
- procedure: gtk-scale-value-width scale::gtk-scale => int
- scale
- procedure: gtk-scale-set-value-pos scale::gtk-scale pos::gtk-position-type => #unspecified
- scale
pos
- procedure: gtk-scale-set-draw-value scale::gtk-scale draw_value::bool => #unspecified
- scale
draw_value
- procedure: gtk-scale-set-digits scale::gtk-scale digits::uint => #unspecified
- scale
digits
8.2.5.67 The scrollbar widget
8.2.5.68 The scrolled window widget
- procedure: gtk-scrolled-window-set-policy scrolled_window::gtk-scrolled-window hscrollbar_policy::gtk-policy-type vscrollbar_policy::gtk-policy-type => #unspecified
- scrolled_window
hscrollbar_policy
vscrollbar_policy
- procedure: gtk-scrolled-window-get-vadjustment scrolled_window::gtk-scrolled-window => gtk-adjustment
- scrolled_window
- procedure: gtk-scrolled-window-get-hadjustment scrolled_window::gtk-scrolled-window => gtk-adjustment
- scrolled_window
- procedure: gtk-scrolled-window-add-with-viewport scrolled_window::gtk-scrolled-window child::gtk-widget => #unspecified
- scrolled_window
child
- procedure: gtk-scrolled-window-new #!optional hadjustment vadjustment => gtk-widget
- hadjustment
vadjustment
8.2.5.69 The separator widget
8.2.5.70 The statusbar widget
- procedure: gtk-statusbar-remove statusbar::gtk-statusbar context_id::uint message_id::uint => #unspecified
- statusbar
context_id
message_id
- procedure: gtk-statusbar-get-context-id statusbar::gtk-statusbar context_description::string => uint
- statusbar
context_description
- procedure: gtk-statusbar-pop statusbar::gtk-statusbar context_id::uint => #unspecified
- statusbar
context_id
- procedure: gtk-statusbar-push statusbar::gtk-statusbar context_id::uint text::string => uint
- statusbar
context_id
text
- procedure: gtk-statusbar-new => gtk-widget
8.2.5.71 The table widget
- procedure: gtk-table-set-col-spacings table::gtk-table spacing::int => #unspecified
- table
spacing
- procedure: gtk-table-set-row-spacings table::gtk-table spacing::int => #unspecified
- table
spacing
- procedure: gtk-table-set-col-spacing table::gtk-table column::int spacing::int => #unspecified
- table
column
spacing
- procedure: gtk-table-set-row-spacing table::gtk-table row::int spacing::int => #unspecified
- table
row
spacing
- procedure: gtk-table-attach-defaults table::gtk-table child::gtk-widget left_attach::int right_attach::int top_attach::int bottom_attach::int => #unspecified
- table
child
left_attach
right_attach
top_attach
bottom_attach
- procedure: gtk-table-attach table::gtk-table child::gtk-widget left_attach::int right_attach::int top_attach::int bottom_attach::int #!optional xoptions yoptions xpadding ypadding => #unspecified
- table
child
left_attach
right_attach
top_attach
bottom_attach
xoptions
yoptions
xpadding
ypadding
- procedure: gtk-table-new rows::int columns::int homogenous::bool => gtk-widget
- rows
columns
homogenous
8.2.5.72 The tips query widget
- procedure: gtk-tips-query-set-labels tips_query::gtk-tips-query label_inactive::string label_no_tip::string => #unspecified
- tips_query
label_inactive
label_no_tip
- procedure: gtk-tips-query-set-caller tips_query::gtk-tips-query caller::gtk-widget => #unspecified
- tips_query
caller
- procedure: gtk-tips-query-stop-query tips_query::gtk-tips-query => #unspecified
- tips_query
- procedure: gtk-tips-query-start-query tips_query::gtk-tips-query => #unspecified
- tips_query
- procedure: gtk-tips-query-new => gtk-widget
8.2.5.73 The text widget
- procedure: gtk-text-forward-delete text::gtk-text nchars::uint => #unspecified
- text
nchars
- procedure: gtk-text-backward-delete text::gtk-text nchars::uint => #unspecified
- text
nchars
- procedure: gtk-text-insert text::gtk-text font fore back chars::string #!optional length => #unspecified
- text
font
fore
back
chars
length
- procedure: gtk-text-thaw text::gtk-text => #unspecified
- text
- procedure: gtk-text-freeze text::gtk-text => #unspecified
- text
- procedure: gtk-text-get-length text::gtk-text => uint
- text
- procedure: gtk-text-get-point text::gtk-text => uint
- text
- procedure: gtk-text-set-point text::gtk-text index::uint => #unspecified
- text
index
- procedure: gtk-text-set-adjustments text::gtk-text hadj::gtk-adjustment vadj::gtk-adjustment => #unspecified
- text
hadj
vadj
- procedure: gtk-text-set-line-wrap text::gtk-text line_wrap::bool => #unspecified
- text
line_wrap
- procedure: gtk-text-set-word-wrap text::gtk-text word_wrap::bool => #unspecified
- text
word_wrap
- procedure: gtk-text-set-editable text::gtk-text editable::bool => #unspecified
- text
editable
- procedure: gtk-text-new #!optional hadj vadj => gtk-widget
- hadj
vadj
- procedure: gtk-text-hadj o::gtk-text => gtk-adjustment
- o
- procedure: gtk-text-vadj o::gtk-text => gtk-adjustment
- o
8.2.5.74 The toggle button widget
- procedure: gtk-toggle-button-new label::string => gtk-widget
- label
- procedure: gtk-toggle-button-get-active toggle_button::gtk-toggle-button => bool
- toggle_button
- procedure: gtk-toggle-button-set-active toggle_button::gtk-toggle-button is_active::bool => #unspecified
- toggle_button
is_active
- procedure: gtk-toggle-button-active o::gtk-toggle-button => bool
- o
- procedure: gtk-toggle-button-draw-indicator o::gtk-toggle-button => bool
- o
8.2.5.75 The tool bar widget
- procedure: gtk-toolbar-set-tooltips toolbar::gtk-toolbar enable::bool => #unspecified
- toolbar
enable
- procedure: gtk-toolbar-set-space-size toolbar::gtk-toolbar space_size::int => #unspecified
- toolbar
space_size
- procedure: gtk-toolbar-set-style toolbar::gtk-toolbar style::gtk-toolbar-style => #unspecified
- toolbar
style
- procedure: gtk-toolbar-set-orientation toolbar::gtk-toolbar orientation::gtk-orientation => #unspecified
- toolbar
orientation
- procedure: gtk-toolbar-insert-widget toolbar::gtk-toolbar widget::gtk-widget tooltip_text::string tooltip_private_text::string position::int => #unspecified
- toolbar
widget
tooltip_text
tooltip_private_text
position
- procedure: gtk-toolbar-prepend-widget toolbar::gtk-toolbar widget::gtk-widget tooltip_text::string tooltip_private_text::string => #unspecified
- toolbar
widget
tooltip_text
tooltip_private_text
- procedure: gtk-toolbar-append-widget toolbar::gtk-toolbar widget::gtk-widget tooltip_text::string tooltip_private_text::string => #unspecified
- toolbar
widget
tooltip_text
tooltip_private_text
- procedure: gtk-toolbar-insert-space toolbar::gtk-toolbar position::int => #unspecified
- toolbar
position
- procedure: gtk-toolbar-prepend-space toolbar::gtk-toolbar => #unspecified
- toolbar
- procedure: gtk-toolbar-append-space toolbar::gtk-toolbar => #unspecified
- toolbar
- procedure: gtk-toolbar-new orientation::gtk-orientation style::gtk-toolbar-style => gtk-widget
- orientation
style
8.2.5.76 The tool tips widget
- procedure: gtk-tooltips-force-window tooltips::gtk-tooltips => #unspecified
- tooltips
- procedure: gtk-tooltips-set-colors tooltips::gtk-tooltips background::gdk-color foreground::gdk-color => #unspecified
- tooltips
background
foreground
- procedure: gtk-tooltips-set-tip tooltips::gtk-tooltips widget::gtk-widget tip_text tip_private::string => #unspecified
- tooltips
widget
tip_text
tip_private
- procedure: gtk-tooltips-set-delay tooltips::gtk-tooltips delay::int => #unspecified
- tooltips
delay
- procedure: gtk-tooltips-disable tooltips::gtk-tooltips => #unspecified
- tooltips
- procedure: gtk-tooltips-enable tooltips::gtk-tooltips => #unspecified
- tooltips
- procedure: gtk-tooltips-new => gtk-tooltips
8.2.5.77 The tree widget
- procedure: gtk-tree-set-view-lines tree::gtk-tree flag::bool => #unspecified
- tree
flag
- procedure: gtk-tree-set-view-mode tree::gtk-tree mode::gtk-tree-view-mode => #unspecified
- tree
mode
- procedure: gtk-tree-set-selection-mode tree::gtk-tree mode::gtk-selection-mode => #unspecified
- tree
mode
- procedure: gtk-tree-child-position tree::gtk-tree child::gtk-widget => int
- tree
child
- procedure: gtk-tree-unselect-child tree::gtk-tree child::gtk-widget => #unspecified
- tree
child
- procedure: gtk-tree-select-child tree::gtk-tree child::gtk-widget => #unspecified
- tree
child
- procedure: gtk-tree-unselect-item tree::gtk-tree item::int => #unspecified
- tree
item
- procedure: gtk-tree-select-item tree::gtk-tree item::int => #unspecified
- tree
item
- procedure: gtk-tree-clear-items tree::gtk-tree start::int end::int => #unspecified
- tree
start
end
- procedure: gtk-tree-remove-item tree::gtk-tree child::gtk-widget => #unspecified
- tree
child
- procedure: gtk-tree-insert tree::gtk-tree child::gtk-widget position::int => #unspecified
- tree
child
position
- procedure: gtk-tree-prepend tree::gtk-tree child::gtk-widget => #unspecified
- tree
child
- procedure: gtk-tree-append tree::gtk-tree child::gtk-widget => #unspecified
- tree
child
- procedure: gtk-tree-new => gtk-widget
- procedure: gtk-tree-item-collapse tree_item::gtk-tree-item => #unspecified
- tree_item
- procedure: gtk-tree-item-expand tree_item::gtk-tree-item => #unspecified
- tree_item
- procedure: gtk-tree-item-deselect tree_item::gtk-tree-item => #unspecified
- tree_item
- procedure: gtk-tree-item-select tree_item::gtk-tree-item => #unspecified
- tree_item
- procedure: gtk-tree-item-remove-subtree tree_item::gtk-tree-item => #unspecified
- tree_item
- procedure: gtk-tree-item-set-subtree tree_item::gtk-tree-item subtree::gtk-widget => #unspecified
- tree_item
subtree
- procedure: gtk-tree-item-new label::string => gtk-widget
- label
8.2.5.78 The tree item widget
8.2.5.79 The vertical box widget
- procedure: gtk-vbox-new #!optional homogenous spacing => gtk-widget
- homogenous
spacing
8.2.5.80 The vertical button box widget
- procedure: gtk-vbutton-box-set-layout-default layout::gtk-button-box-style => #unspecified
- layout
- procedure: gtk-vbutton-box-set-spacing-default spacing::int => #unspecified
- spacing
- procedure: gtk-vbutton-box-get-layout-default => gtk-button-box-style
- procedure: gtk-vbutton-box-get-spacing-default => int
- procedure: gtk-vbutton-box-new => gtk-widget
8.2.5.81 The viewport widget
- procedure: gtk-viewport-set-shadow-type viewport::gtk-viewport type::gtk-shadow-type => #unspecified
- viewport
type
- procedure: gtk-viewport-set-vadjustment viewport::gtk-viewport adjustment::gtk-adjustment => #unspecified
- viewport
adjustment
- procedure: gtk-viewport-set-hadjustment viewport::gtk-viewport adjustment::gtk-adjustment => #unspecified
- viewport
adjustment
- procedure: gtk-viewport-get-vadjustment viewport::gtk-viewport => gtk-adjustment
- viewport
- procedure: gtk-viewport-get-hadjustment viewport::gtk-viewport => gtk-adjustment
- viewport
- procedure: gtk-viewport-new hadjustment::gtk-adjustment vadjustment::gtk-adjustment => gtk-widget
- hadjustment
vadjustment
8.2.5.82 The vertical paned widget
- procedure: gtk-vpaned-new => gtk-widget
8.2.5.83 The vertical ruler widget
- procedure: gtk-vruler-new => gtk-widget
8.2.5.84 The vertical scrollbar widget
- procedure: gtk-vscrollbar-new adjustment::gtk-adjustment => gtk-widget
- adjustment
8.2.5.85 The vertical separator widget
- procedure: gtk-vseparator-new => gtk-widget
8.2.5.86 The base widget
- procedure: gtk-grab-remove widget::gtk-widget => #unspecified
- widget
- procedure: gtk-grab-get-current => gtk-widget
- procedure: gtk-grab-add widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-style o::gtk-widget => gtk-style
- o
- procedure: gtk-widget-window o::gtk-widget => gdk-window
- o
- procedure: gtk-widget-mapped widget::gtk-widget => bool
- widget
- procedure: gtk-widget-get-default-style => gtk-style
- procedure: gtk-widget-get-default-visual => gdk-visual
- procedure: gtk-widget-get-default-colormap => gdk-colormap
- procedure: gtk-widget-set-default-style style::gtk-style => #unspecified
- style
- procedure: gtk-widget-set-default-visual visual::gdk-visual => #unspecified
- visual
- procedure: gtk-widget-set-default-colormap cmap::gdk-colormap => #unspecified
- cmap
- procedure: gtk-widget-pop-style => #unspecified
- procedure: gtk-widget-pop-visual => #unspecified
- procedure: gtk-widget-pop-colormap => #unspecified
- procedure: gtk-widget-push-style style::gtk-style => #unspecified
- style
- procedure: gtk-widget-push-visual visual::gdk-visual => #unspecified
- visual
- procedure: gtk-widget-push-colormap cmap::gdk-colormap => #unspecified
- cmap
- procedure: gtk-widget-is-ancestor widget::gtk-widget ancestor::gtk-widget => bool
- widget
ancestor
- procedure: gtk-widget-get-extension-events widget::gtk-widget => gdk-event-mask
- widget
- procedure: gtk-widget-get-events widget::gtk-widget => gdk-event-mask
- widget
- procedure: gtk-widget-get-style widget::gtk-widget => gtk-style
- widget
- procedure: gtk-widget-get-visual widget::gtk-widget => gdk-visual
- widget
- procedure: gtk-widget-get-colormap widget::gtk-widget => gdk-colormap
- widget
- procedure: gtk-widget-get-ancestor widget::gtk-widget type::gtk-type => gtk-widget
- widget
type
- procedure: gtk-widget-get-toplevel widget::gtk-widget => gtk-widget
- widget
- procedure: gtk-widget-set-extension-events widget::gtk-widget events::gdk-event-mask => #unspecified
- widget
events
- procedure: gtk-widget-set-events widget::gtk-widget events::gdk-event-mask => #unspecified
- widget
events
- procedure: gtk-widget-set-usize widget::gtk-widget height::int width::int => #unspecified
- widget
height
width
- procedure: gtk-widget-set-uposition widget::gtk-widget x::int y::int => #unspecified
- widget
x
y
- procedure: gtk-widget-set-style widget::gtk-widget style::gtk-style => #unspecified
- widget
style
- procedure: gtk-widget-set-parent widget::gtk-widget parent::gtk-widget => #unspecified
- widget
parent
- procedure: gtk-widget-set-sensitive widget::gtk-widget sensitive::bool => #unspecified
- widget
sensitive
- procedure: gtk-widget-set-state widget::gtk-widget state::gtk-state-type => #unspecified
- widget
state
- procedure: gtk-widget-get-name widget::gtk-widget => string
- widget
- procedure: gtk-widget-set-name widget::gtk-widget name::string => #unspecified
- widget
name
- procedure: gtk-widget-grab-default widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-grab-focus widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-popup widget::gtk-widget x::int y::int => #unspecified
- widget
x
y
- procedure: gtk-widget-reparent widget::gtk-widget new_parent::gtk-widget => #unspecified
- widget
new_parent
- procedure: gtk-widget-activate widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-event widget::gtk-widget event::gdk-event => bool
- widget
event
- procedure: gtk-widget-add-accelerator widget::gtk-widget accel_signal::string accel_group::gtk-accel-group accel_key::uint accel_mods::gdk-modifier-type accel_flags::gtk-accel-flags => #unspecified
- widget
accel_signal
accel_group
accel_key
accel_mods
accel_flags
- procedure: gtk-widget-unrealize widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-realize widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-unmap widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-map widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-hide-all widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-show-all widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-hide widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-show widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-unparent widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-destroy widget::gtk-widget => #unspecified
- widget
- procedure: gtk-widget-unset-flags widget::gtk-widget flags::gtk-widget-flags => #unspecified
- widget
flags
- procedure: gtk-widget-set-flags widget::gtk-widget flags::gtk-widget-flags => #unspecified
- widget
flags
- procedure: gtk-widget-state widget::gtk-widget => gtk-state-type
- widget
- procedure: gtk-widget-flags widget::gtk-widget => gtk-widget-flags
- widget
8.2.5.87 The window widget
- procedure: gtk-window-activate-default window::gtk-window => int
- window
- procedure: gtk-window-activate-focus window::gtk-window => int
- window
- procedure: gtk-window-position window::gtk-window position::gtk-window-position => #unspecified
- window
position
- procedure: gtk-window-set-policy window::gtk-window allow_shrink::bool allow_grow::bool auto_shrink::bool => #unspecified
- window
allow_shrink
allow_grow
auto_shrink
- procedure: gtk-window-set-default window::gtk-window default::gtk-widget => #unspecified
- window
default
- procedure: gtk-window-set-focus window::gtk-window focus::gtk-widget => #unspecified
- window
focus
- procedure: gtk-window-set-wmclass window::gtk-window wmclass_class::string wmclass_name::string => #unspecified
- window
wmclass_class
wmclass_name
- procedure: gtk-window-set-title window::gtk-window title::string => #unspecified
- window
title
- procedure: gtk-window-new #!optional type => gtk-widget
- type
- procedure: gtk-window-set-position window::gtk-window position::gtk-window-position => #unspecified
- window
position
8.2.6 Utility objects
8.2.6.1 The accelerator table object
8.2.6.2 The adjustment object
- procedure: gtk-adjustment-set-value adjustment::gtk-adjustment value::float => #unspecified
- adjustment
value
- procedure: gtk-adjustment-clamp-page adjustment::gtk-adjustment lower::float upper::float => #unspecified
- adjustment
lower
upper
- procedure: gtk-adjustment-value-changed adjustment::gtk-adjustment => #unspecified
- adjustment
- procedure: gtk-adjustment-changed adjustment::gtk-adjustment => #unspecified
- adjustment
- procedure: gtk-adjustment-new value::float lower::float upper::float step_increment::float page_increment::float page_size::float => gtk-object
- value
lower
upper
step_increment
page_increment
page_size
- procedure: gtk-adjustment-value o::gtk-adjustment => float
- o
- procedure: gtk-adjustment-lower o::gtk-adjustment => float
- o
- procedure: gtk-adjustment-upper o::gtk-adjustment => float
- o
- procedure: gtk-adjustment-step-increment o::gtk-adjustment => float
- o
- procedure: gtk-adjustment-page-increment o::gtk-adjustment => float
- o
- procedure: gtk-adjustment-page-size o::gtk-adjustment => float
- o
8.2.6.3 The GC object
8.2.6.4 The data object
8.2.6.5 The style object
8.2.7 Initialization, exit and other features
8.2.7.1 Initializing and exiting bigloo-gtk
- procedure: gtk-input-remove tag::int => #unspecified
- tag
- procedure: gtk-events-pending => int
- procedure: gtk-init => pair-nil
Init the GTK and GDK environments. You must call this procedure prior
making any other GTK+ call. The gtk-init
processes the list of
arguments that were passed to the application (the value returned by
(command-line)
). The procedure processes some of list elements
and returns the copy of argv with all processed arguments removed.
Note: the gtk-init
is implemented as a scheme promise, so
it does all neccessary processing only once.
Example: provided that localhost:0
is valid X display value:
| (gtk-init "my-application" "--display" "localhost:0" "file1" "file2")
=> ("my-application" "file1" "file2")
|
- procedure: gtk-exit #!optional code => #unspecified
- code
- procedure: gtk-main-iteration-do val::bool => int
- val
- procedure: gtk-main-iteration => int
- procedure: gtk-main-quit => #unspecified
- procedure: gtk-main-level => int
- procedure: gtk-main => #unspecified
- procedure: gtk-timeout-remove id::uint => #unspecified
- Remove timeout, previously created by identifier id returned by
gtk-timeout-add
.
In this example the "Hello" message is printed only once.
| (letrec((id(gtk-timeout-add
1000
(lambda()
(print "Hello")
(gtk-timeout-remove id)))))
...)
|
- procedure: gtk-timeout-add interval::uint thunk::procedure => uint
Add a thunk procedure that will be called every interval
milliseconds. Return the timeout identifier suitable for passing to
gtk-timeout-remove
.
The thunk must be procedure of no arguments. If this procedure
returns #f, the timeout is removed just after the first thunk
invocation.
Example1: print "Hello" every second.
| (gtk-timeout-add 1000 (lambda()(print "Hello")))
=> 9
|
Example2: print "Hello" only once.
| (gtk-timeout-add 1000 (lambda()(print "Hello") #f))
=> 9
|
- procedure: gtk-idle-remove id::uint => #unspecified
- Remove timeout, previously created by identifier id returned by
gtk-idle-add
.
In this example the "Hello" message is printed only once.
| (letrec((id(gtk-idle-add
(lambda()
(print "Hello")
(gtk-idle-remove id)))))
...)
|
- procedure: gtk-idle-add callback::procedure => uint
Add a thunk procedure that will be called (as GTK+ tutorial says) "when nothing
else is happening". Return the idle identifier suitable for passing to
gtk-idle-remove
.
The thunk must be procedure of no arguments. If this procedure
returns #f, the idle task is removed just after the first thunk
invocation.
Example1: print "Hello" repeatedly.
| (gtk-idle-add 1000 (lambda()(print "Hello")))
=> 9
|
Example2: print "Hello" only once.
| (gtk-idle-add 1000 (lambda()(print "Hello") #f))
=> 9
|
8.2.7.2 Customization of the library
8.2.7.3 Simplified menu creation
8.2.7.4 Simplified tree creation
8.2.7.5 Pop up help mechanism
8.2.7.6 Resource Files
- procedure: gtk-rc-parse file::string => #unspecified
- file
8.2.7.7 Macros defined by all objects
8.2.8 Using bigloo-gtk
8.2.8.1 The simplest bigloo-gtk program
8.2.8.2 Hello world in bigloo-gtk
8.2.8.3 An enhanced hello world
8.2.8.4 Making Hello World II robust
8.2.9 Object internals
8.2.10 Signal internals
8.2.11 Widget internals
This document was generated
by Vladimir Tsichevski on December, 26 2003
using texi2html