[Gtk-sharp-list] Issue concerning button image
dkarantonis at soft4real.com
Sun Jan 17 16:28:07 EST 2010
thanks a lot for the advices
> If I need only an image without the text and I don't need all of the
> features in the Gtk.Button I will normally just use a Gtk.Image in a
> Gtk.Event container widget, of course that doesn't have all the benefits
> a Gtk.Button does but I makes for a quick simple solution to the button
> border problem.
> I hope that helps.
> Spoody Goon
> On 1/17/2010 1:47 AM, Michael Hutchinson wrote:
>> On Thu, Dec 31, 2009 at 6:26 AM, dkarantonis<dkarantonis at soft4real.com>
>>> Hi to all,
>>> i am using the following code in order to set a custom image on top of a
>>> Button widget in order to be used for a touch-screen application.
>>> Gdk.Pixbuf pixBuf = new Gdk.Pixbuf(byte);
>>> pixBuf = pixBuf.ScaleSimple(btn.WidthRequest, btn.HeightRequest,
>>> btn.Image = new Image(pixBuf);
>>> the button is of 'Text and image" type, but i clear the text propery in
>>> order for the image to be displayed alone. The image is fetched from a
>>> byte inside my application and I would like to cover the whole button
>>> area, this is the reason for scaling it to the button width and height
>>> Everything should work as expected but the result is not perfect. The
>>> cannot cover the whole button area. A top-left offset is displayed
>>> leaving part of the button control surface uncovered.
>>> Any ideas on how to set the image cover the whole button area?
>> I think the padding in the button is a theme-level property, i.e. not
>> really supposed to be touched by app writers. Despite this, you can
>> override it using a gtkrc settings file for your app, or by code, e.g.
>> something like
>> You might have to poke around in the gtk+ docs to find the right
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.432 / Virus Database: 270.14.147/2628 - Release Date:
>> 01/17/10 07:35:00
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
View this message in context: http://old.nabble.com/Issue-concerning-button-image-tp26977415p27203010.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.
More information about the Gtk-sharp-list