Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Bordered Gtk Label

Reply
Thread Tools

Bordered Gtk Label

 
 
Martin DeMello
Guest
Posts: n/a
 
      07-06-2005
How do I draw a rectangular border around a Gtk Label? Also, is there
any way to set the background colour on an individual widget?

martin
 
Reply With Quote
 
 
 
 
Martin DeMello
Guest
Posts: n/a
 
      07-07-2005
Martin DeMello <(E-Mail Removed)> wrote:
> How do I draw a rectangular border around a Gtk Label? Also, is there
> any way to set the background colour on an individual widget?


FWIW the answers are

1. Enclose it in a Gtk::Frame (at least, that's the best I could come up
with)

2. Gtk::Widget#modify_bg(state, colour)

(From Geoff Youngs on the ruby-gnome2 mailing list:
ISTR that this only works for widgets which actually have a background
window, otherwise you'll need to wrap the widget in a Gtk::EventBox,
which does.

e.g.
col = Gdk::Color.parse("red")
label = Gtk::Label.new("Warning")
eb = Gtk::EventBox.new()
eb.add(label)
eb.modify_bg(Gtk::STATE_NORMAL, col)
)

martin

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract a bordered, skewed rectangle from an image Paul Hemans Python 2 05-09-2010 12:03 PM
Image bordered div Vol. II toxee HTML 6 01-26-2009 05:38 PM
Best method for image bordered div? midori0x@yahoo.com HTML 20 01-24-2009 06:37 PM
GTK+, segmentation fault in gtK-editable_get_chars zombek@gmail.com C Programming 2 05-29-2007 03:27 PM
compiling ruby under windows (+ gtk stuff, is the gtk list dead?) Gergely Kontra Ruby 2 06-18-2004 10:20 PM



Advertisments