Search Results

Search found 1080 results on 44 pages for 'bindings'.

Page 7/44 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Difference between mutableArrayValueForKey and calling insertObject:inEmployeesAtIndex: directly

    - by jasonbogd
    I have a question regarding using KVO-compliant methods to insert/remove objects from an array. I'm working through Aaron Hillegass' Cocoa Programming for Mac OS X and I saw the following line of code (in the insertObject:inEmployeesAtIndex: method: [[undoManager prepareWithInvocationTarget:self] removeObjectFromEmployeesAtIndex:index]; Correct me if I'm wrong, but I always thought it was better to call mutableArrayValueForKey: and then removeObjectAtIndex:...so I tried changing the above line to this: [[undoManager prepareWithInvocationTarget:[self mutableArrayValueForKey:@"employees"]] removeObjectAtIndex:index]; And it didn't work. Can someone explain the difference and why the first line works but the second line doesn't?

    Read the article

  • How do I share an NSArrayController between two nib files?

    - by Tom Dalling
    I have an array of images, and two nib files. One nib file has a window that displays the images in an NSTableView. The other nib has a window that draws the array of images into an NSView, and also draws a highlight over the images that are selected. The array of images is controlled by an NSArrayController. I'm having trouble getting the two nibs to share the NSArrayController. I would have two separate NSArrayControllers bound to the same content, but I also want both nibs to share the controller's selection; that is, if you select an image in the table window, it also becomes selected in the other window. Is there a standard way to do this?

    Read the article

  • Check if key is pressed using python (a daemon in the background)

    - by Nazarius Kappertaal
    I've created a python script in which an event needs to be executed each time I press the Super (or WinKey) on my keyboard. How can one achieve this without the python process being "focused" - as it is running in the background waiting for the key to be pressed to execute the event? I've seen a lot of posts around the web showing me how to read input - but they have all required one to have the process "focused" and none have showed me how to capture the Super (or WinKey) using a python script. I'm running Ubuntu 9.10.

    Read the article

  • How do I bind an iTunes style source list to an NSTableView using Core Data?

    - by Austin
    I have an iTunes style interface in my application: Source list (NSOutlineView) on the left that contains different libraries and playlists with an NSTableView on the right side of the interface displaying information for "Presentations". Similar to iTunes, I am showing the same type of information in the table view whether a library or playlist is selected (title, author, date created, etc). I currently have an NSArrayController connected to my NSTableView and was setting the fetch predicate based on what was selected in the source list. This works fine when selecting a library because I can just set the fetch predicate to filter by the "type" field in my Presentation Core Data entity. When I try to adjust the fetch predicate for the playlist however, it doesn't look like there is any way to set the fetch predicate because I've got a table in between Playlists and Presentations to keep up with the order within the Playlist. According to the Apple docs, these type of predicates are not doable with Core Data (it basically doesn't multiple inner joins). Below is the relevant portion of my Data Model. Is my data model setup incorrectly? Should I drop the NSArrayController and handle connecting the NSTableView up by hand? I'm trying to figure out if there is a simple fix, or really a design flaw.

    Read the article

  • Background problem on UITableView

    - by f0rz
    Hi ! I have come to a problem, wich I have no idea how to solve. Can anyone think outside the box and point me to right directions? I would be very thankfull ! The problem. I have a UITableView containing a first row wich is always the same (a empty row with repeating background) Next rows are bounch of dynamic data rows. I have set the yellow background on my UITableView in IBuilder, My cells (except first row) have white background with code: UIView* backgroundView = [ [ [ UIView alloc ] initWithFrame:CGRectZero ] autorelease ]; backgroundView.backgroundColor = [UIColor colorWithRed: 0.96078431372549 green: 0.96078431372549 blue: 0.96078431372549 alpha: 1.0]; cell.backgroundView = backgroundView; for ( UIView* view in cell.contentView.subviews ) { view.backgroundColor = [ UIColor clearColor ]; } The example yellow background, I only want to be showed at the top. As u see img example below. The thing is I dont want to have yellow background under the last datarow, I want to contain same white color I have on the cells. This should be white as the cells. Not yellow. Thank u for your time. Regards

    Read the article

  • Why would the first call to a KVC setter have an NSTextField instance as the argument?

    - by Stephen
    If I have a NSTextField bound through an NSObjectController to a model object, I would expect the setter of the model object to be called with an NSString as the argument, but instead, I receive the instance of the control that I am bound too the first time I am called. - (NSString *)property { NSLog(@"returning property"); return property; } - (void)setProperty:(NSString *)string { NSLog(@"recieved %@", string) } - (id) init { if (self = [super init]) { property = [[NSString alloc] initWithString:@"value"]; } NSLog(@"property is %@",property"); return self; } (The program doesn't run if you try anything in setProperty, because it tries to send NSString messages to string - which might be an NSTextField.) Console Output: 2010-05-12 14:19:14.096 Trouble[13108:10b] property is enter value 2010-05-12 14:19:14.100 Trouble[13108:10b] recieved <NSTextField: 0x1025210> 2010-05-12 14:19:14.106 Trouble[13108:10b] returning property

    Read the article

  • Sorting of table column by string length not working as intended when done in IB via cocoa - binding

    - by Miraaj
    Hi all, I made a sample application displaying list of employees with their salaries over NSTableView using NSArrayController. Basic functionality is working as intended. Also sorting is working fine when Selector - compare or caseInsensitiveCompare is assigned in attribute pane for table column- employeeName. Problem occurs when I try to sort it by string length by setting selector in IB as - length, for the table column - employeeName. It does sorting by string length but does it inappropriately. It is doing sorting on alternate clicks ie. on first click it sorts the content in table in descending order by length. Then on second click it does not arrange contents in ascending order by length but sets arrow on top as in ascending. Then on third click it arranges contents in ascending order by length but sets arrow on top of table column as in descending and so on... Can anyone suggest if I am wrong somewhere? Thanks, Miraaj

    Read the article

  • How to bind a control to a singleton in Cocoa?

    - by SphereCat1
    I have a singleton in my FTP app designed to store all of the types of servers that the app can handle, such as FTP or Amazon S3. These types are plugins which are located in the app bundle. Their path is located by applicationWillFinishLoading: and sent to the addServerType: method inside the singleton to be loaded and stored in an NSMutableDictionary. My question is this: How do I bind an NSDictionaryController to the dictionary inside the singleton instance? Can it be done in IB, or do I have to do it in code? I need to be able to display the dictionary's keys in an NSPopupButton so the user can select a server type. Thanks in advance! SphereCat1

    Read the article

  • Assign multiple Emacs keybindings to a single command?

    - by Dan
    I'm giving ErgoEmacs mode a try to see if I can use Emacs more comfortably. Some of its keybindings are fairly intuitive, but in many cases I don't want to outright replace the defaults. For example, in the context of ErgoEmacs' navigation shortcut structure, M-h makes sense as a replacement for C-a--but I want to be able to use both, not just M-h. I tried simply duplicating the commands: ;; Move to beginning/ending of line (defconst ergoemacs-move-beginning-of-line-key (kbd "C-a")) ; original (defconst ergoemacs-move-end-of-line-key (kbd "C-e")) ; original (defconst ergoemacs-move-beginning-of-line-key (kbd "M-h")) ; ergoemacs (defconst ergoemacs-move-end-of-line-key (kbd "M-H")) ; ergoemacs But Emacs simply overwrites the first keybinding with the second. What's the best way to address this?

    Read the article

  • NSTableView with columns bound to different NSArrayControllers

    - by Vyacheslav Karpukhin
    i have NSTableView and two columns in it: NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@"custId"] autorelease]; [column bind:@"value" toObject:arrC2 withKeyPath:@"arrangedObjects.custId" options:nil]; [table addTableColumn:column]; column = [[[NSTableColumn alloc] initWithIdentifier:@"totalGrams"] autorelease]; [column bind:@"value" toObject:valuationArrC withKeyPath:@"arrangedObjects.totalGrams_double" options:nil]; [table addTableColumn:column]; as you can see, columns bound to different NSArrayControllers. first column shows correct values, but second just shows "(" symbol. but if i swap columns like this: NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@"totalGrams"] autorelease]; [column bind:@"value" toObject:valuationArrC withKeyPath:@"arrangedObjects.totalGrams_double" options:nil]; [table addTableColumn:column]; column = [[[NSTableColumn alloc] initWithIdentifier:@"custId"] autorelease]; [column bind:@"value" toObject:arrC2 withKeyPath:@"arrangedObjects.custId" options:nil]; [table addTableColumn:column]; then i see values of first column (which was second in the first example) and again "(" in the second column. i don't understand that behaviour. how can i bound two array controllers to one table?

    Read the article

  • Binding value for NSTableView, but tooltip gets set as well

    - by Mark
    I've set up an NSTableView in Interface Builder to be populated from an NSArray. Each value of the array represents one row in the table. The value is bound correctly, but as a side effect, the table cell's tooltip is set to the string representation of the bound object. In my case, the NSArray contains NSDictiorany objects and the tooltip looks like it could be the [... description] output of that dictionary. Very ugly... I don't want the tooltip to be set at all. I have other tables that have plain NSString values bound to them and they don't have a tooltip set automatically. Is there some Interface Builder magic going on? I tried to start with a blank project - same problem. I should add that the table cell is a custom implementation of NSTextFieldCell that uses an NSButtonCell instance to draw an image and a label into the table. The values are retrieved from the dictionary bound as value. Why is the tooltip set when I only bind the "value" attribute? Thanks in advance!

    Read the article

  • How do you move the pointer up or down multiple lines with Emacs?

    - by Peter
    I can move my pointer up and down one line with my arrow key just fine in Emacs, so I'd like to redefine C-n and C-p to move up and down 5 lines at a time. I'm just beginning to learn how to use Emacs, and elisp is very alien to me. I tried using the GNU Emacs lisp reference, but I couldn't find how to bind a keystroke to multiple commands. Here's what I have so far (concentrating on the moving up definition): (global-set-key "\C-p" '(loop for i in '(1 2 3 4 5) do ('previous-line))) But, this brings up an error message when I hit C-p, "Wrong type argument." Any suggestions? Thanks!

    Read the article

  • Add objects to NSDictionaryController

    - by kaile
    I have an NSTableView which is bound to an NSDictionaryController. I have set this and the content dictionary through the interface builder. The question I have is, how do I add objects to the dictionary in a manner that the controller will see it automatically and display it in the table. I've seen in examples about NSArrayController that you add the new objects through the controller rather than the actual array so the controller sees the change. However, I don't see a similar way of doing this with the dictionarycontroller... Thanks for the help.

    Read the article

  • Unable to bind with any property of UserControl

    - by Agha Khan
    I looked your answer where I was also using this.DataContext=this. I am unable to convince myself why I have to remove it? But I did In my UserControl control I have 6 int properties (RedCount, GreenCount …) I am using .NET 3.5 and basically I wanted to use StringFormat with Binding. In my xaml file I have 6 Labels with I would like to bind, and I did what exactly you told in last reply. For some strange reasons it didn’t work. I don't know why it does not work. I placed break point in converter where I never hit it. This imples Binding failed.

    Read the article

  • Wpf- Is there any way to disable some of the default hotkeys in a RichTextBox?

    - by Justin
    I have several keybindings in my text editing application that no longer work now that I have switched from using a regular textbox to using a richtextbox. This is because the wpf richtextbox has several default hokeys such as "Ctrl+1", "Ctrl+2", and "Ctrl+5". My keybindings are defined in a view that contains the view that the richtextbox is in. I can't move the keybindings to the richtextbox; Is there any fix for this problem? Other than using a third-party control or creating my own richtextbox from textboxbase.

    Read the article

  • How do I bind a key to "the function represented by the following key sequence"?

    - by katrielalex
    I'm just starting to learn emacs (woohoo!) and I've been mucking around in my .emacs quite happily. Unfortunately, I don't know Lisp yet, so I'm having issues with the basics. I've already remapped a few keys until I fix my muscle memory: (global-set-key (kbd "<f9>") 'recompile) That's fine. But how can I tell a key to 'simulate pressing several keys'? For instance, I don't know, make <f1> do the same as C-u 2 C-x } (widen buffer by two chars). One way is to look up that C-x } calls shrink-window-horizontally, and do some sort of lambda thing. This is of course the neat and elegant way (how do you do this?). But surely there's a way to define <f1> to send the keystrokes C-u 2 C-x }?

    Read the article

  • Cocoa's newbie question: is it possible to bind a NSTableView's selection to another tableview's selection?

    - by cocoaOverloaded
    http://img651.imageshack.us/img651/6999/modelsf.jpg Let'say, I've 2 entities in the Core Data's Model file, one being all "transactions" ever done by X company. The "transactions" entity has among other properties, a "DATE" property and a to-one relationship "COMPANY"(specifying the company with which X company has done that particular transaction). The other entity:"companies" of course contains all the companies' info ,with which X company has done transaction. The "companies" entity has a to-many relationships "TRANSACTIONS" which is an inverse relationship to "transactions" entity's "COMPANY" relationship. So within IB, I created a NSTableView(with its own NSArrayController) showing all the transactions on a particular Date (with the help of NSPredicate). Then I create another table view showing the to-many relationship "TRANSACTIONS" of the company of the selected transaction in the first table view(which shows transactions on a particular date). The 2nd table view's NSArrayController binding is like this: ** bind to: "name of the first tableview's controller", Controller Key: selection, Model Key Path:COMPANY.TRANSACTIONS(the to-many relationship in the "companies" entity)** Everythings work fine up to this moment, the 2nd tableview shows all the transactions X company has done with the company of the selected transactions in the 1st table view. But I have a group of textfields showing details of a particular transactions. Binding the these textfields with the controller of the 1st table view(the one showing transactions on a particular date) is pretty straightforward. But what I want to do are: 1/ Look up the transactions on a particular date in the first table view, select any one of them 2/ Then, check all previous transactions of the company of that transaction( selected in the first table view) from the 2nd table view 3/ Select any previous transactions and check the details of the transaction from that group of textfields So naturally I should have bind the textfields' gp to the 2nd table view's controller. But I found the default selected row in the 2nd table view(the one show all previous transactions of a company) wasn't the transaction I've selected in the 1st tableView for a particular date. Of course, i can manually select that transaction in the 2nd table view again.... So I just want to know if it's possible to have the 2nd table view automatically select the transaction according to the transaction I've selected in the 1st table view thr binding?? After hours of googling, I solved the problem by implementing the tableview Delegate protocol: - (void)tableViewSelectionDidChange:(NSNotification *)aNotification { if (["nameOf1stTableView" selectedRow] > -1) { NSArray *objsArray = ["nameOf2ndTableView'sController" arrangedObjects]; for (id obj in objsArray) { if ([[obj valueForKey:@"DATE"] isEqualToDate: ["nameOf1stTableView'sController".selection valueForKey:@"DATE"]]) { ["nameOf2ndTableView" selectRowIndexes:[NSIndexSet indexSetWithIndex:[objsArray indexOfObject:obj]] byExtendingSelection:NO]; } } } } But,this just look too cumbersome... can it be done with binding alone? Thanks in Advance,

    Read the article

  • visual studio 2008 keyboard gets locked when editing source controlled files

    - by Rama
    Hi, I am facing a strange issue with editing source controlled files (especially aspx files) using visual studio 2008. when I check out and edit the file, I can edit fine for few seconds and after that keyboard gets locked and I can't type anything (it doesn't affect the files not added to source control). as soon it is locked, if I try to type, the focus shifts to solution explorer and other windows and sometimes it freezes and doesn't respond at all. I tried uninstalling and reinstalling visual studio, reinstalling the source control plug-in. none of it worked. not sure if it is my machine or my profile. Please help if you have any clues. I can't see any other solution for this except rebuilding the machine Thanks, Rama

    Read the article

  • Assign TableView column binding to a specific core-data object in to-many related entity based on se

    - by snown27
    How would I assign a column of a TableView to be a specific entry in a Core Data entity that is linked to the NSArrayController via a to-many relationship? For example Entity: MovieEntity Attributes: title(NSString), releaseDate(NSDate) Relationship: posters<-->> PosterEntity Entity:PosterEntity Attributes: imageLocation(NSURL), default(BOOL) Relationships: movie<<--> MovieEntity So I have a three column table that I want to display the Poster, Title, and Release Date attributes in, but as one movie could potentially have several different style's of posters how do I get the poster column to only show the one that's marked default? Since the rest of the table is defined in Interface Builder I would prefer to keep it that way for the sake of keeping the code as clean as possible, but if this can only be done programmatically then I'm all ears. I just wanted to give preference in case there's more than one way to skin a cat, so to speak.

    Read the article

  • keyboard gets locked when editing source controlled files using Visual Studio 2008

    - by Rama
    Hi, I am facing a strange issue with editing source controlled files (especially aspx files) using visual studio 2008. when I check out and edit the file, I can edit fine for few seconds and after that keyboard gets locked and I can't type anything (it doesn't affect the files not added to source control). as soon it is locked, if I try to type, the focus shifts to solution explorer and other windows and sometimes it freezes and doesn't respond at all. I tried uninstalling and reinstalling visual studio, reinstalling the source control plug-in. none of it worked. not sure if it is my machine or my profile. Please help if you have any clues. I can't see any other solution for this except rebuilding the machine Update: I use Perforce plug-in for source control Thanks, Rama

    Read the article

  • Using special keys for keybidings in Javascript

    - by newhen
    Hi, I was wondering if it was possible to use special keys that the macbook pro has for music control and bind them in javascript? Example keys: PLay/pause,next, back. I am trying to do this to modify a greasemonkey script if that helps. Here is the current code HotKeys.bindings['/'] = HotKeys.activateSearch; HotKeys.bindings['p'] = HotKeys.playPrev; HotKeys.bindings['n'] = HotKeys.playNext; HotKeys.bindings['k'] = HotKeys.selectPrev; HotKeys.bindings['j'] = HotKeys.selectNext; HotKeys.bindings['o'] = HotKeys.playSelected; HotKeys.bindings['v'] = HotKeys.openBlog; HotKeys.bindings['s'] = HotKeys.toggleFavorite; HotKeys.keyBindings[27] /*ESC*/ = HotKeys.deactivateSearch; Script source: http://userscripts.org/scripts/review/23612

    Read the article

  • Is it a jaxb bug?

    - by wd-shuang
    I take a scheme, its element definition as follows: <xs:complexType name="OriginalMessageContents1"> <xs:sequence> <xs:any namespace="##any" processContents="skip"/> <xs:any namespace="##any" processContents="skip" minOccurs="0"/> </xs:sequence> </xs:complexType> I use xjb to export java file,xjb as follow: <jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jxb:bindings schemaLocation="ibps.706.001.01.xsd" node="/xs:schema"> <jxb:bindings node="//xs:complexType[@name='OriginalMessageContents1']/xs:sequence"> <jxb:bindings node=".//xs:any[position()=1]"> <jxb:property name="anyOne"/> </jxb:bindings> <jxb:bindings node=".//xs:any[position()=2]"> <jxb:property name="anyTwo"/> </jxb:bindings> </jxb:bindings> </jxb:bindings> </jxb:bindings> Java as: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OriginalMessageContents1", propOrder = { "anyOne", "anyTwo" }) public class OriginalMessageContents1 { @XmlAnyElement protected Element anyOne; @XmlAnyElement protected Element anyTwo; public Element getAnyOne() { return anyOne; } public void setAnyOne(Element value) { this.anyOne = value; } public Element getAnyTwo() { return anyTwo; } public void setAnyTwo(Element value) { this.anyTwo = value; } } When I unmashaller this object by using getAnyOne,I get the contents of the second element. I got null by using getAnyTwo. It is a bug? Anybody can help me ?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >