[noob question] setting window background colour?

Hi,
Am just getting to grips with basics of Xcode, Coacoa and IB, been looking at some easy examples and just set myself my first exercise; to build the C# Introductory Video example app
OK, basically all I want to do is open the colour picker from a button and set the window background colour. But still with nothing more than an empty window in IB I can't find any obvious means to define it's background colour (not even statically)?
Hope someone can help with this dead easy question... (my Coacoa programming book is still on it's way from Amazon
Ceers,
Rich
PS. just looking for a nudge in the right direction, please - not a step by step description how to write my sample app, as well meant as that might be. cheers

+Although I'm guessing from the underlying tone you're already pretty experienced and it's been a long time since you sat down yourself and first started to "look through the documentation"?!?+
Sorry didn't mean to let the tone bleed through that much.
But seriously I assumed there was an NSWindow function that did it, checked the documentation, found it, mocked it up in 5 minutes (alright 10 I'm still getting used to IB in Xcode 3), tested it to make sure it worked as expected and then answered your post. Not that you should have been able to do that as quickly but I could do it because I have slogged through the process for other objects I had used.
Really this is a pretty basic Cocoa kind of operation. I have object X supplied but Cocoa (eg NSWindow, NSTextBox, etc.) and I want to do operation Y. Operation Y is almost always already there for you just waiting to be used. Learning this process of finding these things in the documentation and using them is really crucial to being a proficient Cocoa developer.
In Xcode 2 Help > Documentation will give you the searchable API and just type in NSWindow. In Xcode 3 selecting an object - like NSWindow - will change the Help > Documentation menu to point to NSWindow directly.
Cocoa is a very "lived in" API and it has clearly been evolved by people who really used it so it has the buttons and levers right where you want them most of the time. I assumed that NSWindow had a function to change the color simply because it would make sense that it would. And when I checked it did, but my making that assumption and being able to find the function comes from doing the heavy lifting already on other objects.
I'm just hoping you take this as an example of how to do this and next time dig into the docs and find the function. There is no way to be good at it without doing it and getting good at it gives you access to Cocoa's rich API and will get you very far because you get all that programming other people have done for you for (almost) free.
Good luck,
=Tod

Similar Messages

  • Finder Window Background Colours

    I have recently upgraded my old PowerBook G4 to a MacBook 2Ghz - Black.
    Setting all my preferences finder window background colours, icon sizes etc for all windows is fine.
    I have copied all my image files from the PowerBook to the MacBook, but when I increase the icon sizes for a particular window (selecting this window only) to view image thumbnails better the background colour changes to a bright orange or purple at the same time.
    Does anyone have any idea's, I have thought about re-installing OS X again and starting from scratch, but this can't be needed with a Mac can it????????
    Thanks
    Chris

    I can suggest two solutions:
    1) You delete all .DS_Store files from the offending folders. The files are invisible so it is a bit of a chore.
    Paste this Applescript in Script Editor and run it, then select your folder to remove all the invisible files I mentioned.
    set mountedDisk to POSIX path of (choose folder)
    tell application "Terminal"
    if (count of windows) is 0 then do script ""
    delay 0.1
    do script "find " & quoted form of mountedDisk & ¬
    " -name .DS_Store -delete" in front window
    end tell
    2) Make a new folder and move all your files to that folder.

  • TDMS : How to set the background colour programatically for .tdms file

    Hello every one 
    is there any method to set the background colour of .tdms file programatically
    Thank you
    Raja

    Hi Raja,
    "TDMS" is a file on your harddisc. How should a file have a background color?
    Or the other way around:
    How do you set the background color of a simple text file?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • ITunes 11 how can the window background colour be changed from white to black in Grid View?

    How do I change the window background colour ,in Grid View, from the new, default, white back to the good old, more easy on the eye, black?
    Apple did this to us in iPhoto some time ago and had to add a preference for shades of grey other than white. Why didn't Apple learn from this mistake?

    It is good to know I am not alone. The first thing I did after downloading iTunes 11 was go into preferences to change the background color. But alas, the option for a dark background is gone. I also was kind of disappointed in the lack of ability to resize the artwork, but not to the extent of some other commenters here.
    I will say this though. I love the way the albums expand with custom colored backgrounds based on each album's artwork colors. This looks fantastic. Still it would be nice to accomodate those who prefer to use a dark background for the overall application's theme.
    So, Apple, I join with my fellow users in requesting the return of resizable artwork, and the option for at least a dark (or an even further customizable) background color for the overall theme of the application. Thanks!
    Godspeed,
    Nuckels

  • Setting page background colour

    When setting page background colour I am currently using the shapes tool to create a colour rectangle to place in the background.
    Are there any other ways to set page background colour, say to set a book wide preference for page colour, or any alternative method at all?

    Thanks for your reply.
    I figured that would be the way to go. Though I'm getting a glitch when using image gallery widgets where the background colour flashes white when zooming on an image on the final ipad book. The background fade effect when zooming is set by default to start from white I presume. Hope they fix that soon.

  • How to set Window background transparent?

    hello
    i have a splash screen with an Image on it and i want the background of the Window object would be transparent, how can i do it?
    here it is:
    public class SplashWindow extends JWindow{
       public SplashWindow(){
          try{
             JLabel img=new JLabel(new ImageIcon("images/splash.gif"));
             getContentPane().add(img);
             setSize(473,534);
             setLocation(300,300);
             setVisible(true);
          }catch(Exception e){
             e.printStackTrace();
    thank a lot.

    Generally, transaprent backgrounds are fake. What happens is that you set an image as yoru window background and listen for window's moves. When the window is moved, you read the new location and the desktop background and update your window background with the portion of desktop image you have below your window.
    Choub

  • Re-iTunes11 change it's window background colour-.

      hi guys
      don't want to be a bore but...i just bought a 2013 iMac 27'' to replace my ''old'' late 2009 27''.
      since my eyes REALLY don't agree with iTunes11 searing white background, i uninstalled it & installed 10.7 instead with my favored dark background - as in the add ''....plop, plop, fizz, fizz....AAAHHHH, instant relief !!...''
    however having tried Mavericks & liking what i tried/how it felt, i would like to upgrade my OS but have read repeatedly that installing iTunes 10.7 creates a whole bunch of troubles like no access to  App Store, etc...
    since i like having my computers running as smoothly as the proverbial Swiss clock, i obviously rather not do that so :
    has anyone devised a workaround to change iTunes11 background colour to ANY other colour ? i like Apple & Macs but....not enough to have a splitting headache after using a piece of software i actually use everyday
    any colour other than white will do, even pink w/ polkadots
    or perhaps someone knows of an iTunes replacement music player that keeps iTunes 10.7 GUI ? all i need it for is to play music, in Artist/grid mode w/ a anything but white background
    any help/suggestions will be very welcome, many thanks to all
    Nuno

      hi guys
      don't want to be a bore but...i just bought a 2013 iMac 27'' to replace my ''old'' late 2009 27''.
      since my eyes REALLY don't agree with iTunes11 searing white background, i uninstalled it & installed 10.7 instead with my favored dark background - as in the add ''....plop, plop, fizz, fizz....AAAHHHH, instant relief !!...''
    however having tried Mavericks & liking what i tried/how it felt, i would like to upgrade my OS but have read repeatedly that installing iTunes 10.7 creates a whole bunch of troubles like no access to  App Store, etc...
    since i like having my computers running as smoothly as the proverbial Swiss clock, i obviously rather not do that so :
    has anyone devised a workaround to change iTunes11 background colour to ANY other colour ? i like Apple & Macs but....not enough to have a splitting headache after using a piece of software i actually use everyday
    any colour other than white will do, even pink w/ polkadots
    or perhaps someone knows of an iTunes replacement music player that keeps iTunes 10.7 GUI ? all i need it for is to play music, in Artist/grid mode w/ a anything but white background
    any help/suggestions will be very welcome, many thanks to all
    Nuno

  • New Browser Window - Background Colour

    I have a QT movie I want to link to from a webpage. I want it
    to open in a new window of a particular size. Using the Behaviors
    panel I can do this, though how do I specify a black (not white)
    background?
    I'm sure the code is very straightforward someone?

    If you are opening anything other than an HTML page (like a
    JPG or GIF
    image, and I assume a QT movie), you have no control over the
    browser
    defaults.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "ezzz_11" <[email protected]> wrote in
    message
    news:f0l3v5$dm7$[email protected]..
    >I have a QT movie I want to link to from a webpage. I
    want it to open in a
    >new
    > window of a particular size. Using the Behaviors panel I
    can do this,
    > though
    > how do I specify a black (not white) background?
    > I'm sure the code is very straightforward someone?
    >

  • Noob question on windows media files not importing

    I gather I can't get these files into iMovie without converting them? Is there any freeware app to do this? I tried opening them with QT and got the message "The movie could not be opened. It is not a movie file."
    They have the extension .ASF; "get info" tells me they are windows media files; they came from a POS Aiptek DV4500 (no, I don't do video much; this is a kid event at school that I'd like to see)
    Sorry; I'm sure the answer is in the forum somewhere but I couldn't find it several pages into my search.

    thanks -- flip4mac isn't free, though, at least for converting windows files, from what I can tell from the site. and the VLC software appears to just be a viewer; no importing.
    so again, is there any freeware? or am i forced to pay $$ to see these files?
    if that's the case, i'll just go back to my cruddy ol' XP laptop, because, again, i stress, i'm not gonna be doing this but maybe once a year....

  • Change the background colour of windows system-wide? (non B/W)

    I have difficulty reading on a white background, but find the White on Black theme doesn't work for me either. The background colour which works best for me is #F9EEE2;. I can work for nearly twice as long in a window with that background colour.
    So I prefer apps which allow me to change the background colour of their windows (e.g. [PathFinder|http://www.cocoatech.com>, [iTerm|http://iterm.sourceforge.net>, [Journler|http://wiki.journler.com/index.php?title=Main_Page], [OmniOutliner|http://www.omnigroup.com/products/omnioutliner>, [BBEdit|http://www.barebones.com/index.shtml], [TranslateIt|http://mac.gettranslateit.com>). I'll pay for this feature.
    However, I often don't have the choice. For example, [PoEdit|http://www.poedit.net/index.php] is the only OSX-native gettext .po editor (since Snow Leopard killed Cocoa-Java and thus [LocFactoryEditor|http://www.triplespin.com/en/products/locfactoryeditor.html]) , so I have to use it. I asked the developer if he could add a preference to change the background colour of the window (PoEdit is Carbon). He replied that this sort of preference should be system-wide, shouldn't it?
    From the Linux POV, yes, it should. Do we have that sort of option in OSX Snow Leopard? Previous OSX theme apps ShapeShifter and Mystique are respectively not yet compatible with OSX, and not available any more. I had a look at [ThemePark|http://www.geekspiff.com/software/themepark> (which does support 10.6), but don't know where to start in editing resource files. So what are our options for changing window background colour system-wide? (Or is there a Carbon plugin or library the PoEdit developer could use to embed that preference for his app.?)
    Thanks for any help you can offer with this.

    I asked a similar question before...as far as I know, there is no option to change this system-wide...short of creating a new color profile or using some hidden Terminal command.

  • Reports 3: setting background colour.

    Using Reports 3 how do I set the background colour for the
    margin? I do mean the margin and not the objects in the margin
    (they're easy).
    Thanks for any help.
    null

    "katychapman85" <[email protected]> wrote in
    message
    news:g6svqs$eli$[email protected]..
    > I'm retrieving different colours from a database and I
    want to set the
    > background colour of a canvas to the colour retrieved.
    I've tried doing
    > the
    > following:
    >
    > <mx:TileList
    > x="2" y="237"
    > direction="horizontal"
    > dataProvider="{MakeUpColours.lastResult.Colour}"
    > backgroundColor="#FFFFFF"
    > width="288" height="167.04999"
    > themeColor="#FFFFFF">
    >
    > <mx:itemRenderer>
    > <mx:Component>
    > <mx:Canvas width="35" height="35">
    > <mx:Canvas width="30" height="30" x="5" y="5"
    > backgroundColor="{data.ColourNo}">
    > <mx:Image
    > source="
    http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/
    >>
    > <mx:Label text="{data.@ColourNo}"/>
    > </mx:Canvas>
    > </mx:Canvas>
    > </mx:Component>
    > </mx:itemRenderer>
    > </mx:TileList>
    You're referring to both data.@ColourNo and data.ColourNo. Is
    it an
    attribute or an element?

  • Setting background colour to transparent?

    Why does cropping a photo leave a green background instead of being transparent? I'm fairly new at using the Photo Elements 10, I had v.7 which I could select "reverse" and delete background, then copy and paste into a new picture. However, the "copy" has a feathered edge and when I flatten the image then try to re-size/crop image, the background of the copy is still dark green??
    I can't remember how to set the background colour to "clear" not coloured nor feathered .... Please help.
    Thanks in advance for your help.
    Leona Buckner

    Double click the background layer to turn it to a regular layer before you start. If you delete on a background layer, the empty space fills with the chosen background color.

  • Setting Background Colour with a Value Retrieved from a Database

    I'm retrieving different colours from a database and I want
    to set the background colour of a canvas to the colour retrieved.
    I've tried doing the following:
    <mx:TileList
    x="2" y="237"
    direction="horizontal"
    dataProvider="{MakeUpColours.lastResult.Colour}"
    backgroundColor="#FFFFFF"
    width="288" height="167.04999"
    themeColor="#FFFFFF">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Canvas width="35" height="35">
    <mx:Canvas width="30" height="30" x="5" y="5"
    backgroundColor="{data.ColourNo}">
    <mx:Image source="
    http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/>
    <mx:Label text="{data.@ColourNo}"/>
    </mx:Canvas>
    </mx:Canvas>
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    But it just makes the background colour black. Any
    suggestions?
    Thanks
    Katy

    "katychapman85" <[email protected]> wrote in
    message
    news:g6svqs$eli$[email protected]..
    > I'm retrieving different colours from a database and I
    want to set the
    > background colour of a canvas to the colour retrieved.
    I've tried doing
    > the
    > following:
    >
    > <mx:TileList
    > x="2" y="237"
    > direction="horizontal"
    > dataProvider="{MakeUpColours.lastResult.Colour}"
    > backgroundColor="#FFFFFF"
    > width="288" height="167.04999"
    > themeColor="#FFFFFF">
    >
    > <mx:itemRenderer>
    > <mx:Component>
    > <mx:Canvas width="35" height="35">
    > <mx:Canvas width="30" height="30" x="5" y="5"
    > backgroundColor="{data.ColourNo}">
    > <mx:Image
    > source="
    http://localhost/Flex/Personalised%20Palettes-debug/{data.@PictureSrc}"/
    >>
    > <mx:Label text="{data.@ColourNo}"/>
    > </mx:Canvas>
    > </mx:Canvas>
    > </mx:Component>
    > </mx:itemRenderer>
    > </mx:TileList>
    You're referring to both data.@ColourNo and data.ColourNo. Is
    it an
    attribute or an element?

  • Background colour on pages

    Please can you help, I used to set the background colour on my windows so didnt get white glare..and so no visual migraines, but I don't know how to sort the apple..is it not possible to set a background colour that only shows on screen but doesn't send or print with that colour? Many thanks C

    You can dim your monitor to comfortable levels in your System Preferences. Particularly on the new LED screens which dim down to extremely low levels.
    However I think you are more likely to develop headaches trying to read content with too little lack of contrast than too much. As for coloring the background, readability studies show black and white is by far the best for readabilty.
    But then there is no end to the crazy illogical excuses people will come up with for doing the oddball things they do.
    Peter

  • Tab Canvas - Background Colour

    Hello,
    I'm building a form which has a tab canvas using Forms 6i. In my application Im using Oracle Look and Feel and the BLUE Colour Scheme. The background colour in the bar with the tabs is shown as grey, I would prefer it to be blue (that matching the shade of blue in colorScheme=Blue). I have tried setting the background colour of the tab canvas using the colour palette but am unable to find a matching shade of blue. Does anybody now the colour code to use?
    Thanks
    MATT

    Hello,
    I'm building a form which has a tab canvas using Forms 6i. In my application Im using Oracle Look and Feel and the BLUE Colour Scheme. The background colour in the bar with the tabs is shown as grey, I would prefer it to be blue (that matching the shade of blue in colorScheme=Blue). I have tried setting the background colour of the tab canvas using the colour palette but am unable to find a matching shade of blue. Does anybody now the colour code to use?
    Thanks
    MATT

Maybe you are looking for

  • TS3212 Unable to download iTunes 11.1.4 How do I get iTunes to download?

    Have been unable to download iTunes 11.1.4.  Get a pop-up stating that "Apple Mobile Device (Applre Mobile Device) failed to start.  Verify that you have sufficient privileges to start system services". Attempted download followed by message that iTu

  • Add instance on Read only field issue

    I have a subform with two fields , one a date field to capture current system date and time and another is a Text field for some comments. Then there are two buttons ,one for Adding the instance for these two fields and another is a Save button which

  • Dropdown doesn't work in IE

    I inserted a Spry dropdown menu on my website, but as the menu appears at the bottom of the page, I want the submenu to appear over, rather than under the main menu. I have changed the orientation, and it works beautifully in Firefox and Safari. Howe

  • CCMS Queue Monitoring

    Hello all, Can we monitor the queue length in XI and send alerts using CCMS?  Sometimes, My queues are active, but messages are piling up.  Is there a way to monitor the no. of messages in the queue and send an alert message when it reaches some limi

  • Advantage of creating Planned order first

    "The advantage of creating planned order first is the additional procurement proposal check that is executed by the MRP controllers. Purchasing can only order material when the MRP controller has checked the planned order and converted it into a PR.