Re: Transparent buttons
- From: Paul Davis <paul linuxaudiosystems com>
- To: Sven Neumann <sven gimp org>
- Cc: Shaun McCance <shaunm wolfram com>, sydney barrow <sydbarrow hotmail com>, gtk-list gnome org
- Subject: Re: Transparent buttons
- Date: Wed, 28 May 2003 07:38:19 -0400
>Hi,
>
>Paul Davis <paul linuxaudiosystems com> writes:
>
>> >On Tue, 2003-05-27 at 18:51, sydney barrow wrote:
>> >> Is there a way to create transparent buttons (so that the
>> >> background pixmap shows through) in GTK+ (1.2)?
>> >>
>> >> Any help would be greatly appreciated.
>> >
>> >IIRC, this was one of the really cool features of GTK+ 2, and it isn't
>> >possible in GTK+ 1.
>>
>> it certainly is possible, though it can be quite a bit more work. you
>> need to use gtk_widget_shape_combine_mask() together with a
>> GtkEventBox as the underlying widget type. getting full GtkButton
>> semantics from this is hard, but if you want something that responds
>> with generic (ie. button_press, button_release) events, its not that
>> bad.
>
>If all you want is the background pixmap to show through, you don't
>need to do anything special since a GtkButton does not have it's own
>window but draws on the window of it's parent.
1) you can't use gtk_widget_shape_combine_mask() (sensibly) unless the
widget has its own window.
2) if you don't use gtk_widget_shape_combine_mask(), then you will
find that GtkButton always draws on a rectilinear area of its
drawing window, regardless of the shape of its child pixmap (or
label). this is true in 1.2 i am not sure about 2.X ...
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]