Google Search Engine - Cocoa - objective-c

Would it be possible to make a google search engine in Xcode, cocoa? If so, how? I want the user to type in a phrase in a textfield called inputBox, and the button to be sendButton. When the button is pressed it will open your default browser to the searched phrase.
Thanks,
KeViN

Yes. See -[NSWorkspace openURL:] and -[NSString stringByAddingPercentEscapesUsingEncoding:].
Also, that isn't what is usually called a "search engine." That is a form that sends a request to Google.

Yes. Evidence: It's been done.
Of course, that needn't stop you from implementing your own as a learning project.
Also, what Chuck said about your use of the term “search engine”.

Related

An extension for Apple's Look Up

I am learning French. Every time I use the Force Click on my Mac on a word I don't know, I get a dictionary entry and a translation to English.
But when I want to translate a whole sentence, I have to open Google Translate to do so. (1. Open Google Translate. 2. Copy sentence 3. Paste Sentence) It is pretty annoying to do that 20-30 times a day.
So is there a way to expand the capabilities of Force Click in Safari (or in the best case, in every application which allows "Look Up")?
Let me worry about how I can translate the sentences.
I am open for any kind of creative solution.
Here is the standard pop-up when I force touch
I don't think there is a documented way to achieve this on a force click, but you may want to look at Services.
Basically, you can create an application that provides a service, select some text, and then choose your application's Service menu item from the Services submenu in your Application Name menu (the one in bold where "Hide" etc. are).
The service will then receive a copy of the selection (in an NSPasteboard) and can do whatever it wants with that, or even change it.

Launch application using openwith on mouse click

Can any one tell me about how to lanch a self-made application using the "openwith" feature of a mouse click event?
Your question is not very clear, but I understand it as "How do I tell the Finder that my application knows handle certain file types?". Once the Finder knows the link, it will suggest your application in the Open With submenu that appears when you ctrl/right-click on a file.
Have a look at the Apple documentation. Basically, you have to declare all the supported file types in Info.plist (or what you called it). The system is based on Universal Type Identifiers.

Dynamic suggestions for text ctrl in wxPython?

Is there any way to mimic the dynamic suggestions behavior as per the search field on Google? As in, I type something in a text ctrl, and a list of suggestions pops up below for the user to chose from? If wxPython doesn't have such a feature, perhaps some other Python gui has it?
EDIT: For use on a Mac. That excludes this example, although it seems to be exactly what I am looking for.
Im not sure it theres a way to automatically do this but I think it could be easily achieved by binding to EVT_TEXT.
This is a recipe from the wxpython wiki for a TextCtrlAutoComplete control
Have you tried AutocompleteTextCtrl?
You could quickly download and test it as it comes with a nice test module to run straight away.

Is there a way to print an clickable link to the console?

Is that generally possible? Is the console able to format a link so that it is clickable? i.e. a link that launches an application, or anything else when clicked?
No, not unless your terminal supports it, and most terminals I know of don't support such a feature. If your terminal does support hyperlinks, read up on its documentation -- there's probably some escape sequence analogous to ANSI escape codes for doing so.
Actually, yes ✨ (kind of).
Select the URL in the Xcode console then you can find Open URL among services in the right-click context menu.

Multiple windows or "pages" in an application

I am a newbie in Mac application development. I want to write a GUI application in Cocoa using Interface Builder. I want multiple screens i.e. when one button on a screen is clicked, another screen should be displayed. How can I activate a new screen at button click event?
I would heartily recommend Aaron Hilegass's book Cocoa Programming for Mac OS X. It took me from feeling like everything was impossible to being relatively competent in the space of a few short weeks. I was very impressed with it.
Apple's documentation is amazingly good, but it takes a while to get used to the style, and you will need to know which objects actually exist before you can look up how to use them, which is where Aaron's book comes in.
Your library may have a copy of it, or be able to order one for you if they don't.
I think you mean windows, not screens. Screens are the displays (monitors) on which all the user's windows from all the user's applications appear.
And I second Jonathan's recommendation of the Hillegass book.
The button has a target. That should link to the new window. As its action you can tell the window to show itself.
Take a look at:
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/WinPanel/WinPanel.html
I think what you want is the type of interface like that seen in Coda, or System Preferences where there is a toolbar on the top of the screen that can be used to select between the content of the window.
The simplest method I have found is to use BWToolkit.
Another method is to use a series of views, and switch between them when the toolbar is clicked. I've found one description here, but that's not the one I used first (which may have been originally in Ruby Cocoa, IIRC).
NSTabView.