Re: ImageButton

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

 



2009/2/2 Steffen Toksvig <s.toksvig@xxxxxxxxx>:
> What is the best way to make an 'owner drawn' button that draws
> different images depending on  the state of the button.
> The button would draw only the relevant image, possibly scaled if the
> button has a different size compared to the image and a label. But it
> should not draw any of the normal button graphics.

Just make a regular button and turn off the relief decoration and the border:

        gtk_button_set_relief( GTK_BUTTON( but ), GTK_RELIEF_NONE );
        gtk_container_set_border_width( GTK_CONTAINER( but ), 0 );

No doubt you could do this with a style file too.

Put a GtkImage inside the button and change the graphic to whatever
you want, whenever you want.

You'll still get the mouseover and press effects, but they're rather
useful, I think.

John
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux