Re: revised image prop, icon patch
- From: Havoc Pennington <hp redhat com>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-devel-list gnome org
- Subject: Re: revised image prop, icon patch
- Date: 28 Aug 2001 21:38:50 -0400
Owen Taylor <otaylor redhat com> writes:
> Is this still necessary? It means that you can have a pixmap storage
> type with a null pixmap, which seems like a bad idea to me. Avoiding
> this for icon-size is why I suggested the storage change, really.
>
> I guess the downside is that if you had pixmap/mask and switched
> to pixbuf without freeing the mask, the mask wouldnt' be freed.
> I don't think this really matters ... people won't be changing
> the storage type of GtkImage widgets at all often, if ever.
I ended up doing it somewhat differently... we can sort it out
tomorrow.
I don't like breaking the invariant that the mask is part of the
PIXMAP or IMAGE types, i.e. it should always be NULL if you are a
PIXBUF type. So instead I changed it so that the mask and icon size
are allowed to exist in EMPTY images, but get deleted/reset if you
switch to PIXBUF or something. If you set the "mask" property while
not in pixmap/image mode, then you get a GTK_IMAGE_EMPTY with a
mask. Saving the mask in EMPTY is a hidden property-system-only
feature, there's no C API to retrieve it.
Anyhow, this ensures that pixmap != NULL if storage_type ==
GTK_IMAGE_PIXMAP, but also frees the mask if you switch to another
storage type.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]