Package: gtk

Accessor gtk:widget-opacity

Lambda List

gtk:widget-opacity (object)

Syntax

(gtk:widget-opacity object) => opacity
(setf (gtk:widget-opacity object) opacity)

Arguments

object -- a gtk:widget object
opacity -- a double float with the opacity of the widget

Details

Accessor of the opacity slot of the gtk:widget class. The gtk:widget-opacity function fetches the requested opacity for the widget. The (setf gtk:widget-opacity) function request the widget to be rendered partially transparent, with opacity 0.0 being fully transparent and 1.0 fully opaque.

Opacity values are clamped to the [0.0,1.0] range. This works on both toplevel widget, and child widgets, although there are some limitations:
  • For toplevel widgets this depends on the capabilities of the windowing system. On X11 this has any effect only on X screens with a compositing manager running. See the gtk:widget-is-composited function. On Windows it should work always, although setting the opacity of the window after the window has been shown causes it to flicker once on Windows.
  • For child widgets it does not work if any affected widget has a native window, or disables double buffering.
 

See also

2025-1-25