-
Notifications
You must be signed in to change notification settings - Fork 9
R-macos/Mac-GUI
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
R app embedding R. This is a true Cocoa application that embeds R. The original code for embedding R in Cocoa is Simon's work. You can consider this or any other derivative of this product a four-hand work of me and Simon. R is started up with the option --gui=cocoa, this is temporarily needed because R_ProcessEvents is to be called from libR.dylib into the Cocoa app, and --gui=cocoa simply set a flag to conditionalize the R_ProcessEvents inside src/unix/aqua.c code. Once the aqua module will be declared "Defunct", --gui=aqua would be enough There are several tricks I did and there are several things to take into account. In sparse order, here they are: 1. after awakefromnib, instead of blocking the main cocoa event loop directly calling run_Rmainloop, a timer fires once to call this function. At this point the menu bar is correctly built and the GUI can respond to the related events. 2. to test x11/tcltk try the following: a) run the X window server using the X11 icon int he toolbar b) > library(tcltk) c) > demo(tkdensity) it works! On the contrary AquaTclTk doesn't work at all, or at least is works as badly as it was for the Carbon RAqua. Note: to build the R for Mac OS X FAQ manually use the following command from the shell makeinfo -D UseExternalXrefs --html --force --no-split RMacOSX-FAQ.texi For everything else read the NEWS file stefano Milan and Augsburg, 2004-10-10 === Note to developers === If you intend to work on the source code of R.app, please adjust your editor to use tabs. Each indentation level should be exactly one tab. The preferred setting in Xcode is (in Preferences -> TextEditing) [X] Editor uses tabs Tab width: [4] Indent width: [4] This will give you the proper indenting behavior and fairly well readable code. You can replace the "4" in both fields by any positive value you find pleasant, just make sure both entries are identical. Use Xcode-style indentation whenever possible. The strict use of tabs as indentation marks makes it possible for everyone to view the code with the spacing s/he prefers. Update (2005-01-13, SU) About localization: We have added new (experimental) support for localization of the GUI. Although this is great news for the users, this requires good cooperation of the developer and some extra work. If you add and language-dependent constants (like @"Choose a file"), first look up in Localized.strings whether there is such text alrady and if so use it 1:1 in the NLS(...) macro. If there is no such entry, add it to the corresponding localized files and flag those additions by an empty comment (e.g. @"Save"=@"Save"; // ), such that it can be localized later by our translators. If you make any changes to the NIB files, always remember to update the locallized versions. You can use "nibtool" to perform the updates semi-automatically. It is ok to wait with the update if you have more batch updates, because the changes can be made incrementally. Update (2005-02-01, SU) There is a script "update.localization" in the project directory that automatically updates localized NIBs to match changes made in the master 'English' versions. It is the aggressive form of NIB update (see nibtool) which means that it retains only sizes of existing components, but any other changes made to the localized NIB after translation will be lost. It also generates corresponding <nib>.<lang>.strings files that can be used for translation. Any existing files (localized NIBs and NIB-relased string files) will be overwritten. How To - NIB localization: ---------------------------- * adding new localization - in Xcode, select the NIB, go to Info, click on "Add Localization" use country's ISO 639 or 3166 code for the localization instead of full name - run update.localization this will create translation files in Translated.string for all NIBs and languages, including the new one - edit the translation file for the new NIB - right hand side must be translated. IMPORTANT: Before editing, make sure you set the encoding in the editor to UTF-8!! Not doing so will cause the translation to fail silently and you will wonder why nothing works. - run update.localization -t Don't forget the -t switch! Otherwise the script will overwrite the file you just translated! * adjusting locale-specific widgets in existing, localized NIBs - you can edit widgets in the localized NIBs, such as stretching them. Those changes won't be overwritten when updating the "English" master later. However, make locale-specific changes ONLY. If you want to make a change from which other locales may benefit then rather do the change in the master NIB. * updating master NIB files - always base your changes on the master "English" version of the NIB - run update.localization this synchronizes the changes made in the master with other locales. This also generates a new set of Translated.strings files [the following is optional] - edit the translation file. This is necessary if new widgets have been added and thus they need to be translated. - run update.localization -t again, don't forget the -t option or your new translation file will be overwritten Some notes about NIB files: - It is a good idea to check the translation files even if you actually don't want to translate the NIB. The file will show you any inconsistencies in the strings used, such as trailing spaces or newlines. - When desigining a view, always keep in mind that many languages need more space for the same phrase than english. Keep sufficient space around/following a text such that the localized files don't need to be modified one by one. (I could probably remove this one if we used German as the master language ;)). - Don't forget to re-run update.localization when you make non-GUI changes to the NIBs, such as new connections. It's easy to forget, because it has nothing to do with the GUI, but still, the localized NIBs need to be updated, too. - Always run update.localization before a release