Safari downloads dropdown

Discussion in 'Mac Programming' started by Blkant, Jul 10, 2014.

  1. Blkant macrumors member

    Blkant

    Joined:
    Jul 27, 2012
    #1
    I've recently been trying to learn mac development and for one of my ideas was to try and recreate Safari's downloads menu (the popover list of downloads). It seemed like a relatively easy thing to practice however I encountered an issue with getting a custom list/table in the popover that I could let the user interact with. In fact I've found nothing but problems in getting a correctly looking or correctly functioning list/table of any kind really that isn't static. I looked into it a fair bit online however the only answers I get that seem possibly correct seem way too involved for how it seems cocoa is supposed to work. Here was the only suggestion I found that seems relatable:

    http://stackoverflow.com/questions/21191413/view-based-nstableview-selection-highlighting

    Isn't there a better, more straightforward/intuitive way to do this?
     
  2. Supermacguy macrumors regular

    Joined:
    Jan 3, 2008
    #2
    What kind of answer are you looking for? It's possible in Safari, so it can definitely be done, all that and more even.
    All I can say is, as a proclaimed "newer" programmer, maybe some aspects are beyond what you've learned/experienced so far. And as far as being "way too involved" - well in that case, "you ain't seen nothin yet". Some solutions are amazingly complex and are clearly beyond any "simple" explanation. It's just how programming is: objects and entire concepts become abstracted away from basic human description.
    I'm sure it's possible to do what you describe. It may take a lot more learning or trial and error with different design patterns.
     
  3. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #3
    As far as programming UIs rather than using a GUI tool like interface builder, I think Swing (Java) is my favorite. It doesn't make the prettiest UIs, but dang if it isn't easy.
     
  4. briloronmacrumo, Jul 12, 2014
    Last edited: Jul 12, 2014

    briloronmacrumo macrumors 6502

    briloronmacrumo

    Joined:
    Jan 25, 2008
    Location:
    USA
    #4
    Beginners always find it difficult - that's how it works

    Try creating the popover first ( there are many tutorials online ) and get that working with just a simple text label inside it.

    Next put together a simple window with a cell-based tableview. Tableviews have several delegates that handle setting/getting. Once you have a tableview successfully displaying data and you've learned to reload it with new/updated data, it is time for the next step. Again, there are lots of tutorials and info on the web that explain how to get a basic tableview working.

    Once you understand how a popover and tableview work separately, it should be much easier to tackle imbedding a tableview in your popover.

    It might help to see the specifics of this general comment but yes, it is often possible to write less code in Cocoa. However, as others have noted, some things in Cocoa/Objective-C programming are not automatic and require study and a willingness to dive in and experiment.

    Tableviews imbedded in popovers are relatively simple compared to some tasks. Swift has some promise for simplification but complex UIs and potentially complicated processing ( such as writing parallel code with GCD in some scientific settings ) just require a lot of study, research, patience and experimentation. Good luck.
     

Share This Page