Generating a keypress event in wxWidgets programatically - events

I'm looking for a way to programatically generate keypress events in a C++ wxWidgets app, for testing a control that I had written.
Are there ways to do this?
Thanks a lot for the help!
Sahas

You should first build a wxKeyEvent object, fill it with the necessary key information, and then call the ProcessEvent method of the target control.

There is/will be wxUIActionSimulator in wx 2.9 soon (it's currently present in basic form in the trunk and in an improved one in one of svn branches which will be merged soon). You should be able to take the relevant files and use them with wx 2.8 too if you need but I haven't tested this.

Related

Organizing methods in a file using drag&drop in the structure view

Coming from eclipse, I am used to be able to move methods around in a file by simply dragging them around in the structure view (called overvew in eclipse).
I have noticed that it is not possible in RubyMine by default. Is there a way to enable it?
If not, is there a feature request for this?
All I have found yet is this: http://youtrack.jetbrains.com/issue/RUBY-2987, http://youtrack.jetbrains.com/issue/RUBY-9672 which considers only moving methods between classes,
Thank you
disclaimer: This started a copy of my attempt to get an answer on the JetBrains forum.
As #LazyOne said in his comment, there is an open feature request for drag&drop inside the structure view : http://youtrack.jetbrains.com/issue/IDEABKL-71.
It has been created in Feb 2005 and is not scheduled for any upcoming version, with only 11 votes so far, so no need to get your hopes up.

CPComboBox in Cappuccino

It seems like there is no ComboBox component in Cappuccino framework.
I see that there are many widgets in Cappuccino that are not used very often (like Predicate Editor), but ComboBox is missing. Is it abandoned on purpose?
Is it possible to transform CPPopUpButton into Combobox somehow?
A CPComboBox actually does exist. It's just not in the latest stable release yet…
Here's a link to the class: https://github.com/cappuccino/cappuccino/blob/master/AppKit/CPComboBox.j
We're working hard on getting the next major release out the door, please be patient or if you'd like to try out the latest release candidate you can here:
https://groups.google.com/d/topic/objectivej/svifpqxvjfA/discussion

What is the cleanest way to set the environmental variable DYLD_FRAMEWORK_PATH for a release build?

I have custom frameworks in my app bundle for WebKit, WebCore, and JavaScriptCore. I would like all other frameworks that depend on the system versions of WebKit, WebCore, or JavaScriptCore to use my custom versions also. For instance my custom version of Webkit loads private system frameworks that in turn depend on the system version of WebKit. This means both my WebKit and the system WebKit get loaded, and usually a crash happens shortly after.
The way I understand this should be done, is to set the DYLD_FRAMEWORK_PATH environmental variable before your app bundle begins execution (Search order for loading frameworks can be found here: http://code.google.com/p/macdependency/wiki/SearchPaths). You can set environmental variables in code with setenv, but it won't take effect for the currently running process. I would have to re-launch the process again for it to take effect. I would like to avoid this too.
So my question is what is the best way to set the DYLD_FRAMEWORK_PATH before the execution of the my app bundle? This has to work in a release app bundle too. Is there a way to run a script whenever someone clicks on my app bundle before the executable starts running. Or is there any other suggestions out there?
Thanks in advance.
Jeff Wolski has the right idea by referring directly to Apple's documentation on the subject. This thread also provides excellent advice on how to get that going in Xcode, including corner cases associated with alternative methods of specification (for example, by using ~/.bash_profile directly for your user).
My reason for chiming in is you also asked for a script that might be able to assist you (and a bounty provider appears to have the same issue). It turns out Webkit references such a script in its documentation, which you might want to pick apart from the applicable Webkit source code. This should give you additional guidance on how, at least according to the developers, you should do this properly.
Best of luck with your project(s).
I would recommend environment.plist or the LSEnvironment key in the info.plist. Check out the link below.
https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
WebKit currently has a script to do this for you, called run-webkit-app. See http://trac.webkit.org/browser/trunk/Tools/Scripts/run-webkit-app
Newer versions of ld understand the -dyld_env flag, which inserts a LC_DYLD_ENVIRONMENT load command into the binary (and as such applies essentially as early as possible in app execution). Perhaps adding -Wl,-dyld_env,DYLD_FRAMEWORK_PATH=/folder/encosing/WebKit/and/related/frameworks to your compiler flags might do what you want?

How do I translate monotouch code to xcode

I have an app written in MONOTOUCH. It works- I tested it with TESTFLIGHT. It is being added to a larger app, and that developer needs the full xcode project. Do I need to have it rewritten or is there a way to convert it easily.
There is no way to convert Mono code to Objective-C code.
There is an --xcode option that may or may not work. It has not been maintained and we do not officially support it, so I would not depend on it working.
My suggestion is to keep the two applications separate, and transfer control from one to the other by using urls. You register two url handlers "firstApp:" and "secondApp:" and when you need to go from the first to the second, you issue a Url open to "SecondApp:statevariables" and the same process is repeated to go back.
If you have a MonoTouch license, you can use mtouch --xcode yourapp.exe to generate Objective-C code. It doesn't work in the evaluation version.
Much more detail is available in this Stack Overflow answer.

Validation in erlang using nitrogen

I'm trying to do something simple with nitrogen in erlang. I have successfully set validation on text fields:
wf:wire(submit, desk,
#validate{ validators=[ #is_required{text="Required"} ]}),
where desk_name is a textbox and submit is the button at the bottom of the page.
I just want to do the same for a panel. However, using this same code does not seem to work.
Is there a way to have validation for fields other than a textbox??
I really appreciate your help! Thank you.
In nitrogen, you can use its documentation to see all that you can do with its elements. These elements are Erlang records. records have fields and you cannot add anything to a record that was not yet there at compile time.
I suggest you read the wf.hrl file which is the header file for a number of nitrogen elements (you can find it in a path $NITROGEN/apps/nitrogen/include/wf.hrl), or you could access the documentation for all elements here.
Another thing is, (to me) you sound like you have not yet learned as much erlang as you may need to successfully develop in nitrogen (no offense). Usually, Frameworks developed in erlang will become obvious once you have learned to play with the language's data structures. you will easily understand why a developer of a given library chose to do something the way you see it. I therefore suggest (with due respect) that you look at this good guide to Erlang Programming.
Most new developers in nitrogen get "Erlang errors" other than "Nitrogen errors" in most of their code.
Do not forget that you can use only as much functionality on a nitrogen element as has been built around the element through its record structure and support action functions. read the documentation, and you will be successful!
success!

Resources