Fenêtre se comportant comme le dock

APAP Membre
15:30 modifié dans API AppKit #1
Bonjour,

Je cherche à  avoir une NSWindow se comportant comme le doc à  savoir recevoir les événements souris sans pour autant prendre le focus à  la fenêtre qui l'a.
Toute idée est la bienvenue, même si API privée.

Merci d'avance pour votre aide :)

Réponses

  • mpergandmpergand Membre
    15:30 modifié #2
    Cette méthode de NSPanel devrait t'aider:

    setBecomesKeyOnlyIfNeeded:
    Specifies whether the receiver becomes the key window only when needed.

    - (void)setBecomesKeyOnlyIfNeeded:(BOOL)becomesKeyOnlyIfNeeded

    Parameters
    becomesKeyOnlyIfNeeded
    YES makes the panel become the key window only when keyboard input is required. NO makes the panel become key when it's clicked.

    Discussion
    This behavior is not set by default. You should consider setting it only if most user interface elements in the panel aren't text fields, and if the choices that can be made by entering text can also be made in another way (such as by clicking an item in a list).

    If the receiver is a non-activating panel, then it becomes key only if the clicked view returns YES from needsPanelToBecomeKey. This way, a non-activating panel can control whether it takes keyboard focus.

    Availability
    Available in Mac OS X v10.0 and later.

Connectez-vous ou Inscrivez-vous pour répondre.