01-30-2012 05:10 PM - edited 01-31-2012 10:50 AM
How to detect button click or press on the screen of playbook?
Problem: Tried to add a button. After button is pressed, the button function will work.
But, cannot find button press or link reference, which can like button function with button.
The code is at below.
dialog_create_alert(&main_dialog);
dialog_set_title_text(main_dialog, "Data Logger");
dialog_set_size(main_dialog, DIALOG_SIZE_FULL);
dialog_set_group_id(main_dialog, get_window_group_id());
dialog_set_cancel_required(main_dialog, true);
dialog_add_button(main_dialog, "Start", true, 0, true);
For example, In java,
private ButtonField startButton;
startButton = new CustomButton(60, 200, "Start");
startButton.setChangeListener(this);
vetcenter.add(startButton);
//I could not find a any related code at below in Native SDK or C programming code.
public void fieldChanged(Field field, int context) {
if(field == startButton){
butstart();
}
How do I link button with button-press function.?
Hopefully, the probelm is clearly addressed.
Thank your attention,
01-31-2012 10:18 AM
Not sure I understand your question but take a look at very nice Dialog example at github https://github.com/blackberry/NDK-Samples/tree/mas