How can I have a use a variable view for a Popover in Xcode Applescript-ObjC?

I'm adding Popovers to my application, but I have it coming from buttons in different views. One button might be in a Tab-View, and one in the main window. If I specify the wrong view, the Popover is off to the left and down, like the image below:
Here's my code:
on OpenPopover_(sender)
        Popover's showRelativeToRect_ofView_preferredEdge_(sender's frame(), MainWindow's contentView(), current application's NSMaxYEdge)
        end OpenPopover_
How can I use a variable view or not specify the view at all so that the buttons can be in different views without having to use multiple pieces of code, using Applescript-ObjC, Xcode?

You are using the content view of the entire window instead of whatever view the button is in - the frame rectangles are relative to the view it is in.
The method parameters are a rectangle that is relative to the view (to position the popover), the view containing the rectangle, and the edge of the rectangle to use.  To position relative to a button, you can get the button's superview (the containing view), for example:
popover's showRelativeToRect_ofView_preferredEdge_(sender's frame(), sender's superview(), current application's NSMaxYEdge)

Similar Messages

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

  • How can i cancel the using of "Only calls for emergency?"

    How can I cancel the using of "only calls for emergency?"

    In the USA, you cannot.  I believe it is an FCC requirement that all cell phones be enabled to dial 911, even if they do not have an active contract or prepaid service assigned to them.

  • HT1386 How can I have two seperate sets of Playlists for two different iPods on one computer?

    How can I have two seperate sets of Playlists for two different iPods, on the same PC?

    Open itunes.
    Make whatever playlists you each like.
    Connect one ipod, select only what you want, sync
    Do the same for the other ipod

  • How can I have a custom output file destination for each different preset?

    Hey guys,
    I have a bunch of presets in AME but I need to have each preset export to it's own folder. How can I do that? This was a really simple thing to do in Compressor but in Media Encoder is seems like I can only specify one output file destination for the whole application in general and everything gets exported to that folder. Can anyone help me with that please?

    This is a user to user forum. It is not staffed by Adobe employees so you will not always get a direct response from Adobe.
    That being said, the output destination is not tied to the presets so this is not possible without a little extra work. You can change multiple output destinations by selecting multiple jobs and then clicking on one of the output locations to update them all. Another way to set this up would be to use watch folders.
    This is a feature request are aware of but if you would like to add your vote for it, please add that request here: Adobe - Feature Request/Bug Report Form

  • How can I have permission to install DVD system for 2 computers?

    How can I get a permission to install my DVD system Snow Leopard into 2 computers of mine?

    If these are the original DVD;s that came with the system then they can only be used on that system.
    If they are other DVD's post back.

  • HT1430 I already own an iPhone & have purchased and iPod touch for my husband. How can I have a  completely separate Apple ID for both of the devices?

    I have purchased an iPhone 4s 2 years ago and recently purchased an iPod touch for my husband while he was abroad working. I used the same Apple ID when setting up the iPod touch but now I want to know how I can have two separate Apple IDs. One for his iPod touch and one for my iPhone?

    Create a new ID and start using it.
    You will not be able to transfer your existing purchases and updates will require knowing the password for the old ID.

  • How can my family member use their iTunes credit for a purchase when part of family sharing

    I've set up family sharing with my husband and children. They all have iTunes gift cards with credit on their accounts. I am wondering how they are able to make purchases in the app store using this credit rather than the family share credit card.

    If they have credit in their individual accounts, that credit will be used before the organizer's credit card is charged.

  • How can I make iMovie use my external HD for projects instead of my Internal HD?

    I only have a 250GB internal HD and using iMovie can take up a lot of space. I moved all my movie files to an external HD, but when I start up iMovie none of them show up. I have to import them back which places it on my internal HD and I really don't have much space so I can't do anymore projects. Can anyone help me? I am using version 7.1.4 .

    With version 7.1.4 of iMovie, you must keep your projects on the startup drive. However, the Events contain the large files, and can be moved to the external drive.
    You must move the Events from within iMovie. Click VIEW/EVENTS BY VOLUME. This will show you alll your properly formatted drives that are available. (The external drive must be formatted as Mac OS Extended (journaled). Then, in the Event  Library, you can drag and drop the small icons for the Events to the small icon for the drive in the Event Library List along the left side.
    If you need to move Projects also, you should upgrade to iMovie 11. It is available in the Mac App Store for about $15.
    Another note: In iMovie 7.1.4, you can move Events by dragging. However, in iMovie 8.06 (iMovie 09) and iMovie 9.0.4 (iMovie 11), drag and drop will copy. You have to hold down the Command Key while dragging to move rather than copy.

  • How can I have a different default reply account for iCloud mail?

    When I reply to emails on my iPad that came from the iCloud server the replies are from my iCloud account unless I manually select the @gmail.com account in the dropdown list. I want all replies to automatically default to the gmail account. Is this possible? I have set the default account as the gmail account but it is not working the way I want. On my Macbook it does work!

    Hi maus100,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iOS: Configuring additional outgoing mail servers
    http://support.apple.com/kb/ht4519
    Tap Settings > Mail, Contacts, Calendars.
    Setting called Default account. change what you want to send from.
    Best of luck,
    Mario

  • I am trying to do a blank composition widget, but it keeps ignoring my state changes for the trigger. How can I have my state changes still work for things placed in the trigger?

    So below is what I have so far. The menu is working perfectly, thanks to a few Youtube tutorials. And everything is linked correctly. But the only thing is that the "WORK" button doesn't respond to the state change that is set up for it. I tried applying the state change before I placed it in the trigger area, and after. Neither seems to make it work.
    The goal state change is basically that the text "WORK" will turn white, and the white space within the teal stroke will also turn teal. So, the colors will reverse. I have a link next to it, "ABOUT" that is currently successfully doing it. I guess if it's not possible then I will have to figure out another design..but I'd like to see if there is a way to do it!

    I believe you are trying to get a color state for composition when its active ? please publish the site and provide the url to have a look.
    Thanks,
    Sanjit

  • How can i mark as default a user view for bpm workspace 11g

    Hi,
    well i got this issue, in my workspace i made a new view with a flexfield and i would like for that view to be the default one for one particular user
    thanks for watching, i would appreciate any question :)

    There is a document about customizing the inbox available here: http://java.net/downloads/oraclebpmsuite11g/Samples/bpm-CustomizingWorkspace/BPM-CustomizingWS.pdf
    You need to implement getColumnNames and getColumnDisplayName on your implementation of IBPMUICustomizations. If you only want it for a single user you would either need to hard code that user in there or look to an xml file or something to map users to columns.

  • How can I have 2 variables for one output?

    I need it so that the spacebar does one thing on one frame and another thing on the other.
    I have solved this but now I need to know how can I have it so 2 variables = 1 output.
    This is my code at the moment:
    while (menu)
    if (changecharacter)
    gotoAndStop(2);
    menu = false

    My whole code is:
    var menu:Boolean = true
    stop();
    var leftPressed:Boolean = false;
    var rightPressed:Boolean = false;
    var changecharacter:Boolean = false;
    Block.addEventListener(Event.ENTER_FRAME, fl_MoveInDirectionOfKey);
    stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_SetKeyPressed);
    stage.addEventListener(KeyboardEvent.KEY_UP, fl_UnsetKeyPressed);
    Block.gotoAndStop(1)
    function fl_MoveInDirectionOfKey(event:Event)
              if (leftPressed)
                        Block.x -= 3;
              if (rightPressed)
                        Block.x += 3;
              if (changecharacter)
                        Block.gotoAndStop(2);
              while (menu)
              if (changecharacter)
                        gotoAndStop(2);
                        menu = false
    function fl_SetKeyPressed(event:KeyboardEvent):void
              switch (event.keyCode)
                        case Keyboard.LEFT:
                                  leftPressed = true;
                                  break;
                        case Keyboard.RIGHT:
                                  rightPressed = true;
                                  break;
                        case Keyboard.SPACE:
                                  changecharacter = true;
                                  break;
    function fl_UnsetKeyPressed(event:KeyboardEvent):void
              switch (event.keyCode)
                        case Keyboard.LEFT:
                                  leftPressed = false;
                                  break;
                        case Keyboard.RIGHT:
                                  rightPressed = false;
                                  break;
                        case Keyboard.SPACE:
                                  changecharacter = false;
                                  break;

  • I have OSX Maverick on an iMac using Outlook e-mail.  PDF attachments are included in the e-mail  as the whole document rather than just the PDF icon.  How can i have just the PDF icon as an attachment?

    In Outlook my PDF attachments appear as whole documents and not just the PDF icon.  How can I have attachments included as PDF icons and not the documents?

    For your own viewing, you can of course control-click on the attachment and select "View as Icon".
    For others' viewing, it depends upon their email reader.  To ensure that attachments are not displayed expicitly you can put them all in a zip file (via control click and "Compress") then attaching them, or you can use third party stuff like Attachment Tamer.
    charlie

  • How can I make the background one solid color?  It is too difficult and noticeable when I use the retouch button and try to erase all the creases in my backdrop.  So, how can I have just a solid white background?

    How can I make the background one solid color?  It is too difficult and noticeable when I use the retouch button and try to erase all the creases in my backdrop.  So, how can I have just a solid white background?

    When talking about a specific image posting the image may be useful.
    One can use a Layer Mask and add a white Layer underneath.

Maybe you are looking for

  • IPhoto 11 Library was corrupted and photobook is lost

    Hi there, I have encountered various issues with my iphoto. I have attempted to resolve it and I believe I have created a bigger mess. Problems: 1. many photos in "events" and "photobook" when clicked did not connect to photo for editing, it simply s

  • External display won't go away unless I restart my MacBook

    If I connect an external display to my MacBook it still think it's connected after the cable is disconnected. When I use "Detect Displays" it still thinks the external is connected. The only way I can get the computer back to using only 1 monitor is

  • Table name holding the material document

    hi friends....plz tell me any table name holding the value of  material document(migo) and purchase order.

  • PDA deploy using TCP/IP

    Hello, Can we deploy LabVIEW PDA/LaBVIEW Mobile through TCP/IP, ethernet? Thanks.

  • Column Chart Query

    Hi, I am trying to re-create a chart from excel in Application Express and after much playing I have got the data into one series and ordered correctly, is there any way which I can colour some of the lines in the the series a different colour? Cheer