Re: [gtk-list] getting bitmap masks for rc-specified pixmaps



Paul Barton-Davis wrote:
> 
> i just figured out how to do "shaped" windows c/o the testgtk demo of
> the same.
> 
> but i have a problem. i'd like to be able to use a gtkrc file to let
> users specify the pixmaps they want for various visual
> elements. however, the style that is generated from the rc file only
> contains the pixmaps, not the masks. this means that i can't use the
> pixmaps to generate a shaped image.
> 
> i'd like to suggest one of two changes:
> 
>     1) either add a "fg_pixmap" specifier for rc files, and
>        have this also generate and make available the mask
> 
>     2) make the mask available for background pixmaps.
> 
> obviously, a widget will have to still draw the pixmap itself, using
> gtk_widget_shape_combine_mask() to get the shape effect, but the rc
> file provides a very convenient and standard way to specify which
> pixmap should be used for a given widget state.

Why don't you use the pixmap as the mask ? This is what I do and it is
working ok. Just make transparent everything that you don't want to be
visible. 

Eventually, take a look at
http://borco-ei.eng.hokudai.ac.jp/~borco/vdk/compo/class_isshapedbutton.html

Is the doco of my shaped button widget for vdk. The code is available
uppon request (works with VDK, a C++ wrapper for GTK+).

Ionutz



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]