From: Lyle Johnson Date: 2002-08-28T08:42:53+09:00 Subject: Re: FXRuby: FXShutter and FXShutterItem trouble with setting bg color Michael Brailsford wrote: > I have been fruitlessly trying to get the bg color in the FXShutter and > FXShutterItems to black. I looked at the Fox API and I called every > single color method with FXColor::Black, but all to no avail. One would > assume that "@shutter.backColor = FXColor::Black" or > "@shutter.setBackColor(FXColor::Black)" would work, but they don't, nor > do they work for the FXShutterItems. No matter what I do I get dark > gray as the bg color. Any help would be greatly appreciated. Part of the confusion is that the shutter's a nested widget. That is, the "shutter" is the entire thing (i.e. the container) and so changing its background color isn't usually going to have much visible effect. At the next level down are a number of shutter items, each of which has a short, wide button that the user clicks to "raise" or "lower" that shutter item, and a content area that contains the rest of the stuff for that shutter item (usually, but not always, a collection of buttons). You can access the button and content area for a shutter item using the FXShutterItem#button and FXShutterItem#content instance methods, respectively. So to change what I think you're calling the "shutter" background color, you actually want to change the background color for the content area in the shutter item of interest, e.g. shutterItem.content.backColor = FXColor::Black If you want to change the background color for the "short, wide" button for a particular shutter item, use: shutterItem.button.backColor = FXColor::Black If you want to get at one of the widgets inside the content area, you can of course do that too; e.g., save a reference to that widget when you add it to the shutter item: # Create the shutter shutter = FXShutter.new(...) # Create a shutter item inside that shutter shutterItem = FXShutterItem.new(shutter, "Short & Wide, that's me") # Create some regular buttons inside this shutter item's # content area btn1 = FXButton.new(shutterItem.content, ...) btn2 = FXButton.new(shutterItem.content, ...) # Change button 1's background color to black btn1.backColor = FXColor::Black I'm not sure if this covers what you were asking; if it didn't, please follow up. Hope this helps, Lyle