|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
macrumors newbie
Join Date: Nov 2009
|
Synchronizing icon of file between button and drag&drop
Hi all,
I have 2 separate files: - open.m using button to open file - fileDrop.m using drag&drop without button to open file If i drag&drop a file i got the icon of this file displayed in the NSView. Everything is OK with fileDrop.m Now, i would like to do the same with open.m with the button: - If i open a file, it shows the icon of the file in the NSView - The button is using a custom image. And when i open a file, this image should be changed with the icon of file i am opening. Synchronizing icon of file between button and drag&drop: - And if i drag&drop a file, i got the icon of the file displayed in the NSView. At the same time it displays this icon (from drag&drop) in the button, too. I am a newbee, and do not have much experiences how it could be realized. Thank you for any your help! open.m PHP Code:
PHP Code:
Last edited by giha : Nov 16, 2009 at 09:00 AM. |
|
|
|
|
|
#2 |
|
Demi-God (Moderator)
Join Date: Jun 2000
|
In your open class, create an IBOutlet for your fileDrop view and connect it in the nib. Then you will have a reference to that view for calling the setFile: method.
|
|
|
|
|
|
#3 |
|
Thread Starter
macrumors newbie
Join Date: Nov 2009
|
In the fileDrop.h there is a IBOutlet id delegate, i connect it with the button but it is not working. I really don't know how to connect with IBOutlet in open.h since i am total new with this language. Please help me, Thanks!
PHP Code:
PHP Code:
|
|
|
|
|
|
#4 |
|
Demi-God (Moderator)
Join Date: Jun 2000
|
In open.h, declare
Code:
IBOutlet fileDrop *drop; Then, in your mButton: method, you can call Code:
[drop setFile:tFilepath]; Last edited by kainjow : Nov 17, 2009 at 05:36 PM. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|