Methods
gtk.Style.copy
def copy()
The copy
() method returns a copy of the
style object.
gtk.Style.attach
def attach(window
)
The attach
() method adapts a style to
the specified window
. This process allocates the
colors and creates the graphics contexts for the style specializing them to
a particular visual and colormap. A new gtk.Style
may be
created if the style has already been adapted to a window with a different
style and colormap.
gtk.Style.detach
def detach()
The detach
() method detaches the style and frees its resources if it is no longer attached.
gtk.Style.set_background
def set_background(window
, state_type
)
The set_background
() method sets the
background of window
to the background color or
pixmap of the style for the widget state specified by
state_type
.
gtk.Style.apply_default_background
def apply_default_background(window
, set_bg
, state_type
, area
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
set_bg :
| if True use the bg_pixmap
for the widget state |
state_type :
| the widget state |
area :
| the clipping area |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The apply_default_background
() method
sets the background of the specified window
in the
area specified by x
, y
,
width
and height
. The
background color is derived from the bg_gc of the style with the state
specified by state_type
. If
area
is not None
it specifies a
clipping area for the application of the background.
gtk.Style.lookup_icon_set
def lookup_icon_set(stock_id
)
The lookup_icon_set
() method looks in
the gtk.IconFactory
list associated with the style and the default icon factory for the stock
icon specified by stock_id
. If the stock icon iconset
is found it is returned.
gtk.Style.lookup_color
def lookup_color(color_name
)
color_name :
| the name of the logical color to look up |
Returns : | a gtk.gdk.Color
on succes, None otherwise. |
The lookup_color
() method looks up color_name
in the style's logical color mappings, filling in color and returning True
if found, otherwise returning Flase
.
Do not cache the found mapping, because it depends on the GtkStyle and might
change when a theme switch occurs.
gtk.Style.render_icon
def render_icon(source
, direction
, state
, size
, widget
=None, detail
=None)
source :
| the gtk.IconSource
specifying the icon to render |
direction :
| a text direction |
state :
| a widget state |
size :
| the size to render the icon at. A size of -1
means render at the size of the source and don't scale. |
widget :
| a widget |
detail :
| a style detail |
Returns : | a gtk.gdk.Pixbuf |
The render_icon
() method renders the
icon specified by source
at the specified
size
for the specified widget
state
according to the given parameters and returns
the result in a gtk.gdk.Pixbuf
.
gtk.Style.paint_hline
def paint_hline(window
, state_type
, area
, widget
, detail
, x1
, x2
, y
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
area :
| the rectangle that clips the
output |
widget :
| a widget |
detail :
| a detail string |
x1 :
| the starting x coordinate |
x2 :
| the ending x coordinate |
y :
| the y coordinate |
The paint_hline
() method draws a
horizontal line from (x1
, y
)
to (x2
, y
) in
window
using the specified
state_type
of the style. If
area
is not None
the line is
clipped by the rectangle specified by area
.
gtk.Style.paint_vline
def paint_vline(window
, state_type
, area
, widget
, detail
, y1
, y2
, x
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
area :
| the rectangle to which the output is
clipped |
widget :
| a widget |
detail :
| a detail string |
y1 :
| the starting y coordinate |
y2 :
| the ending y coordinate |
x :
| the x coordinate |
The paint_vline
() method draws a
vertical line from (x
, y1
) to
(x
, y2
) in
window
using the specified
state_type
of the style. If
area
is not None
the line is
clipped by the rectangle specified by area
.
gtk.Style.paint_shadow
def paint_shadow(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window * |
state_type :
| a widget state |
shadow_type :
| a type of shadow - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| the rectangle to which the output is
clipped |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_shadow
() method draws a
shadow of the specified shadow_type
on the specified
window
with the size specified by
x
, y
,
width
and height
. If
area
is not None
the shadow is
clipped to the rectangle' area. state_type
specifies
the style state to use for drawing.
gtk.Style.paint_polygon
def paint_polygon(window
, state_type
, shadow_type
, area
, widget
, detail
, points
, fill
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
points :
| a list or tuple containing point (x, y)
tuples |
fill :
| if True the polygon should
be filled |
The paint_polygon
() method draws a
polygon on the specified window
with the shadow type
specified by shadow_type
connecting the points
specified by points
. If area
is not None
it specifies a clipping rectangle. The style
state specified by state_type
determines the graphics
context to use while drawing.
gtk.Style.paint_arrow
def paint_arrow(window
, state_type
, shadow_type
, area
, widget
, detail
, arrow_type
, fill
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| the widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
arrow_type :
| an arrow type - one of:
gtk.ARROW_UP , gtk.ARROW_DOWN ,
gtk.ARROW_LEFT ,
gtk.ARROW_RIGHT |
fill :
| if True the arrow should be
filled |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_arrow
() method draws an arrow
of the type specified by arrow_type
on the specified
window
with the shadow type specified by
shadow_type
with the location and size specified by
x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_diamond
def paint_diamond(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_diamond
() method draws a
diamond on the specified window
with the shadow type
specified by shadow_type
and the location and size
specified by x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_box
def paint_box(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_box
() method draws a box on
the specified window
with the shadow type specified
by shadow_type
and the location and size specified by
x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_flat_box
def paint_flat_box(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_flat_box
() method draws a
flat box (no shadow) on the specified window
with
the location and size specified by x
,
y
, width
and
height
. If area
is not
None
it specifies a clipping rectangle. The style state
specified by state_type
determines the graphics
context to use while drawing.
gtk.Style.paint_check
def paint_check(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_check
() method draws a check
on the specified window
with the shadow type
specified by shadow_type
and the location and size
specified by x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_option
def paint_option(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_option
() method draws an
option menu item on the specified window
with the
shadow type specified by shadow_type
and the location
and size specified by x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_tab
def paint_tab(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_tab
() method draws a tab on
the specified window
with the shadow type specified
by shadow_type
and the location and size specified by
x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_shadow_gap
def paint_shadow_gap(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
, gap_side
, gap_x
, gap_width
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
gap_side :
| a position - one of:
gtk.POS_LEFT , gtk.POS_RIGHT ,
gtk.POS_TOP ,
gtk.POS_BOTTOM |
gap_x :
| the x position of the gap |
gap_width :
| the gap width |
The paint_shadow_gap
() method draws a
shadow with a gap on the specified window
with the
shadow type specified by shadow_type
and the location
and size specified by x
, y
,
width
and height
. The gap
position and width is specified by gap_side
,
gap_x
and gap_width
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_box_gap
def paint_box_gap(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
, gap_side
, gap_x
, gap_width
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
gap_side :
| a position - one of:
gtk.POS_LEFT , gtk.POS_RIGHT ,
gtk.POS_TOP ,
gtk.POS_BOTTOM |
gap_x :
| the x position of the gap |
gap_width :
| the gap width |
The paint_box_gap
() method draws a box
with a gap on the specified window
with the shadow
type specified by shadow_type
and the location and
size specified by x
, y
,
width
and height
. The gap
position and width is specified by gap_side
,
gap_x
and gap_width
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_extension
def paint_extension(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
, gap_side
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
gap_side :
| a position - one of:
gtk.POS_LEFT , gtk.POS_RIGHT ,
gtk.POS_TOP ,
gtk.POS_BOTTOM |
The paint_extension
() method draws an
extension on the specified window
with the shadow
type specified by shadow_type
and the location and
size specified by x
, y
,
width
and height
. The
extension position is specified by gap_side
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_focus
def paint_focus(window
, state_type
, area
, widget
, detail
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_focus
() method draws a focus
indicator on the specified window
with the location
and size specified by x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_slider
def paint_slider(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
, orientation
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
orientation :
| a position - one of:
gtk.ORIENTATION_HORIZONTAL or
gtk.ORIENTATION_VERTICAL |
The paint_slider
() method draws a
slider with the specified orientation
on the
specified window
with the shadow type specified by
shadow_type
and the location and size specified by
x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_handle
def paint_handle(window
, state_type
, shadow_type
, area
, widget
, detail
, x
, y
, width
, height
, orientation
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
shadow_type :
| a shadow type - one of:
gtk.SHADOW_NONE , gtk.SHADOW_IN ,
gtk.SHADOW_OUT , gtk.SHADOW_ETCHED_IN ,
gtk.SHADOW_ETCHED_OUT |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
orientation :
| a position - one of:
gtk.ORIENTATION_HORIZONTAL or
gtk.ORIENTATION_VERTICAL |
The paint_handle
() method draws a
handle with the specified orientation
on the
specified window
with the shadow type specified by
shadow_type
and the location and size specified by
x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_expander
def paint_expander(window
, state_type
, area
, widget
, detail
, x
, y
, expander_style
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
expander_style :
| an expander style - one of:
gtk.EXPANDER_COLLAPSED ,
gtk.EXPANDER_SEMI_COLLAPSED ,
gtk.EXPANDER_SEMI_EXPANDED or
gtk.EXPANDER_EXPANDED |
The paint_expander
() method draws an
expander with the specified expander_style
on the
specified window
at the location specified by
x
, y
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_layout
def paint_layout(window
, state_type
, use_text
, area
, widget
, detail
, x
, y
, layout
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
use_text :
| if True use the text
graphics context for drawing |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
x :
| the x location |
y :
| the y location |
layout :
| a Pango.Layout object
containing the text to display |
The paint_layout
() method draws the
text in a pango.Layout
specified by
layout
on the specified window
at the location specified by x
and
y
. If text is True
use the text
graphics context of the style for drawing, otherwise use the fg graphics
context. If area
is not None
it
specifies a clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing.
gtk.Style.paint_resize_grip
def paint_resize_grip(window
, state_type
, area
, widget
, detail
, edge
, x
, y
, width
, height
)
window :
| a gtk.gdk.Window |
state_type :
| a widget state |
area :
| a clipping rectangle |
widget :
| a widget |
detail :
| a detail string |
edge :
| the edge in which to draw the resize grip,
currently only gtk.WINDOW_EDGE_SOUTH_EAST is
implemented |
x :
| the x location |
y :
| the y location |
width :
| the width |
height :
| the height |
The paint_resize_grip
() method draws a
resize grip at the specified edge
on the specified
window
with the location and size specified by
x
, y
,
width
and height
. If
area
is not None
it specifies a
clipping rectangle. The widget state specified by
state_type
determines the graphics context to use
while drawing. Currently the grip can only be drawn at the
gtk.WINDOW_EDGE_SOUTH_EAST
(lower right) edge.