From: SourceForge.net <no...@so...> - 2005-06-13 19:22:29
|
Bugs item #1219911, was opened at 2005-06-13 21:22 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=470969&aid=1219911&group_id=53614 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Andrew Thompson (vagabond26) Assigned to: Nobody/Anonymous (nobody) Summary: Gtk::RcStyle#set_bg crashes, Gtk::TextView#modify_bg fails Initial Comment: I've been trying to set the foreground/background color for a TextView widget both via the Gtk::Widget.modify_bg and the Gtk::RcStyle.set_bg and neither is working. The modify_bg fails to do anything, so maybe its not what I should be using (tho technicially Treeview is a child of Widget, right) but the RcStyle.set_bg crashes telling me it needs 4 parameters, when the API reference only mentions 2. Here's a little test program to give you an idea of the problem: require 'gtk2' window = Gtk::Window.new textview = Gtk::TextView.new window.add(textview) window.default_width=100 window.default_height=100 black = Gdk::Color.new(0, 0, 0) white = Gdk::Color.new(65535, 65535, 65535) #try setting the colors via the Gtk::Widget functions; Nothing seems to happen textview.modify_bg(Gtk::STATE_NORMAL, black) textview.modify_fg(Gtk::STATE_NORMAL, white) #what the hell, lets try some other states just because we can, again nothing happens textview.modify_bg(Gtk::STATE_PRELIGHT, black) textview.modify_fg(Gtk::STATE_PRELIGHT, white) textview.modify_bg(Gtk::STATE_ACTIVE, black) textview.modify_fg(Gtk::STATE_ACTIVE, white) #Get the Gtk::RcStyle and try to set the colors via that style = textview.modifier_style #this next line crashes saying the function takes 4 arguments, when according to # http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3ARcStyle#set_bg #and http://www.gtkmm.org/gtkmm2/docs/reference/html/classGtk_1_1RcStyle.html #it only takes 2 style.set_bg(Gtk::STATE_NORMAL, black) Gtk.init window.show_all Gtk.main At the very least, either the API documentation needs to be fixed, or the bug making that function think it needs 4 parameters needs to be fixed. I'm using Ruby/GTK 0.12.0 Andrew ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=470969&aid=1219911&group_id=53614 |