I need a module that allows you to create a button that can be resized using a bang and use an image for both a normal and hover state.
Label can be resized but does not provide a way to use a hover image and shortcuts can use a hover image but cannot be resized.
Does anyone have any tricks to be able to do this? I'm creating a fairly minimal theme so I want to avoid adopting modules I don't need.
I don't understand. I don't think I explained myself properly. I have a button in my theme that I need to be able to resize using a bang and supports hover effects. Neither Shortcut or Label have both these functions (AFAIK).
you could use label and just make 2 of them, switching between them with onmouseenter and onmouseleave to simulate hover
So you mean to create 2 labels then use hide and show to toggle between them? I don't think you can change the image for a label with a bang, can you?
yeah, that or just create the hover label on top of the non hover label... its probably easier that way
Using show/hide works pretty nicely. The only catch was that on OnMouseLeftClick I wanted the label hide completely, but when I moved my mouse OnMouseLeave took effect and the label appeared again. So I have to destroy the label instead of hiding it with the OnMouseLeftClick and use hide/show for the hove effect.
*skinbox f 10 10 80 80 #t
fBitmap $bleh$normal.png
fOnMouseOver !execute [!SkinBoxBitmap f $bleh$hover.png][!SkinBoxMove f 0 0 100 100]
fOnMouseOut !execute [!SkinBoxBitmap f $bleh$normal.png][!SkinBoxMove f 10 10 80 80]
I think...
If it's just a plain shortcut I think you can have the normal image have a magic pink border for the area occupied by the hover image.
I really didn't explain this properly, did I :) The button width could be any width between 10 and 100 pixels or even more. And it will resize dynamically without user input. The hover image will be the same size as the normal image. Thanks for your tip anyway. I have implemented a solution now which I'm happy with, but still interested to hear of different solutions.
The new xlabel-2.5.5 supports hover and pressed images with TrueTransparency (resizable).
Release on 07.01.04 search on
http://www.lsd-trip.de for it
Andymon
fwiw, that wasn't intended to be a complete solution, just a short example to show what's possible. :) (and I was really slow in actually posting that...)