[libxfcegui4] xfce_iconbutton

Olivier Fourdan fourdan at xfce.org
Tue Oct 8 20:29:01 CEST 2002


Hi Jasper,

I did not look in to it yet, but the whole thing is to avoid using
GdkImage, so I doubt this could be kept...

IMO, there is no need for scaling.

Cheers,
Olivier.

On Tue, 2002-10-08 at 19:22, Jasper Huijsmans wrote:
> Hi Olivier,
> 
> You were working so hard on the xfce widgets I wanted to try and
> contribute something to that effort.
> 
> xfce_iconbutton is a gtk_button with an automatically scaled icon. It's
> based on GtkButton and I just add a gtk_image containing the icon.
> 
> It works for me, but the automatic scaling part turned out to be a lot
> more complicated then I thought. I didn't want to reimplement all the
> button functions myself, so I decided to just connect to the 
> 'size-allocate' signal. However if I set the image in the size-allocate
> handler you get a race condition (new image => new size => new
> image => etc.).
> 
> 
> I 'solved' it by having a flag indicating if the icon was just scaled.
> So effectively I never scale on every second size-allocate event. This
> seems to work fine, but it also feels wrong.
> 
> I can either try to reimplement the gtk_image widget or the gtk_button
> size_allocate function. Both are not entirely trivial.
> 
> Could you perhaps have a look and tell me what you think? There is an
> example for it as well.
> 
> 	Jasper
> 
> -- 
> IRC channel: #xfce on irc.openprojects.net
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at moongroup.com
> http://moongroup.com/mailman/listinfo/xfce4-dev
> 
-- 
Olivier               <fourdan at xfce.org>            http://www.xfce.org
-----------------------------------------------------------------------
XFce is a lightweight  desktop  environment  for  various *NIX systems. 
Designed for productivity,  it loads  and  executes  applications fast,
while conserving  system resources. XFce is all free software, released
under GNU General Public License.    Available from http://www.xfce.org




More information about the Xfce4-dev mailing list