問題タブ [nsbutton]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
objective-c - ラジオボタンの状態を取得する方法とそれが選択されているかどうか?
ラジオ ボタン (マトリックス) のグループがあり、4 つの選択肢があります。選択内容を (プログラムで) 調べて、その BOOL を取得するにはどうすればよいですか?
objective-c - How can I make a button not fire its action on click-through?
The Apple Human Interface Guidelines state that:
An item that provides click-through is one that a user can activate on an inactive window with one click, instead of clicking first to make the window active and then clicking the item. Click-through provides greater efficiency in performing such tasks as closing or resizing inactive windows, and copying or moving files. In many cases, however, click-through could confuse a user who clicks an item unintentionally.
and
Don’t provide click-through for an item or action that:
- Is potentially harmful and does not allow the user to cancel it (for example, the Delete button in Mail)
- Is difficult or impossible to cancel (such as the Send button in Mail)
- Dismisses a dialog without telling the user what action was taken (for example, the Save button in a Save dialog that overwrites an existing file and automatically dismisses the dialog)
- Removes the user from the current context (for example, selecting a new item in a Finder column can change the target of the Finder window)
What I want to do is that if the user clicks a specific button it will not send its message unless the window is active (for example, the delete message button in Mail). How can I achieve this? If I need to subclass NSButton that's fine.
objective-c - スコープ外で IBAction ボタンを使用する方法
3 つの IBActions があり、それぞれが次のように独自のボタンにリンクされています。
スコープ外のボタンをどのように使用/呼び出しますか? 私はこのようなことをしようとしています:
前もって感謝します!
cocoa - NSButton +&-ボタン
私のアプリケーションでは、テーブルに行を追加および削除するために+&-ボタンを追加する必要があります。デフォルトの画像/ボタンを見つけようとしましたが、取得できませんでした。+&-ボタンの適切な画像。これらのボタンの画像を自分で、またはCocoaフレームワークで利用できるように配置します。質問を見てくれてありがとう、おそらくばかげた質問ではないでしょう
objective-c - NSButtonのグリッドを作成するためにループしますか?
ループして、プログラムで256個のNSButton(16x16)のグリッドを作成しようとしています。私がこれまでに持っているコードは以下の通りです。これは私のMacアプリのObjective-Cにあります。そのため、ボタンをクリックしたときに取得するタグを確認するためにログに記録していますが、毎回同じタグが返され続けます。
すべてのボタンが左から右、上から下に1〜256になるようにします。このコードはそれらを私のビューに正常にロードしますが、タグは間違っています。
objective-c - プログラムで追加された NSButton をサブクラス化しますか?
私のアプリには、プログラムで作成された NSButtons がたくさんあります。Interface Builder を使用せずにこれらの NSButtons のサブクラスを設定するにはどうすればよいですか?
objective-c - mouseDown 時に mouseEntered イベントを無効にする (NSEvents Mac)
NSButton クラスを作成しました。ボタンをロールオーバーすると、mouseEntered および mouseExited イベントが検出されます。しかし、mouseDown イベントが発生するとすぐに、マウスが押されている限り、mouseEntered イベントはマウス ボタンが離されるまで呼び出されなくなります。
したがって、mouseDown イベントが呼び出されると、mouseEntered または MouseExited イベントは呼び出されなくなり、最初の mouseDown を放すまで、他のボタンをロールオーバーするときにも mouseDown が呼び出されなくなります。
そのため、マウスがダウンしているときにマウスが入ったことを検出したいと思います。
objective-c - NSButton の色を変更するにはどうすればよいですか?
setBackgroundColor メソッドを使用して NSButton の色を変更していますが、質問は、それ以外に NSButton の色を変更するために使用できる他の方法はありますか?
cocoa - NSButtonをフォントパネルで開く
Cocoaを使用してMacOSXのフォントパネルを開くボタンを作成する方法を考えていました。アプリケーションにNSTextViewがあり、ユーザーがボタンをクリックしたときにフォントダイアログを表示したいと思っています。前もって感謝します!
objective-c - NSButton で -setImage を使用する
Cocoa アプリケーションでイメージをボタン (NSButton) にしようとしています。以下は、使用しようとしているコードです。
インターフェイス ビルダーで mrButton を NSButton にリンクしました。Xcode プロジェクト内に button.jpg というファイルがあり、このコードを修正したり、NSButton を画像にしたりする方法を知りたいと思っていました。
前もって感謝します!