Exemple #1
0
/* Run some general command */
int
systemExecute(char *command)
{
    int status;
    struct termios foo;
    WINDOW *w = savescr();

    dialog_clear();
    dialog_update();
    end_dialog();
    DialogActive = FALSE;
    if (tcgetattr(0, &foo) != -1) {
	foo.c_cc[VERASE] = '\010';
	tcsetattr(0, TCSANOW, &foo);
    }
    if (!Fake)
	status = system(command);
    else {
	status = 0;
	msgDebug("systemExecute:  Faked execution of `%s'\n", command);
    }
    DialogActive = TRUE;
    restorescr(w);
    return status;
}
Exemple #2
0
int
main(int argc, char **argv)
{
	int retval;
	unsigned char *tresult;

	init_dialog();
	use_helpfile("ftree2.test");
	use_helpline("Press Arrows, Tab, Enter or F1");
	retval = dialog_ftree("ftree2.test", '\t',
		"ftree dialog box example",
		"xterm widget tree from preprocess editres(1) dump", 
		-1, -1, 15,
                            &tresult);

	dialog_update();
	
	dialog_clear();
	
	end_dialog();

	if (!retval)
	{
 		puts(tresult);
  		free(tresult);
  	}
  	
	exit(retval);
}
Exemple #3
0
void
systemSuspendDialog(void)
{

    oldW  = savescr();
    dialog_clear();
    dialog_update();
    end_dialog();
    DialogActive = FALSE;
}
Exemple #4
0
int
main(int argc, char **argv)
{
	int retval;
	unsigned char *tresult;
	char comstr[BUFSIZ];

	init_dialog();
	do {
		use_helpline("Press OK for listing directory");
		retval = dialog_tree(names, 
			sizeof(names)/sizeof(unsigned char *) - 1,
			 '/',
			"tree dialog box example",
			"Typical find -x / -type d output", 
			-1, -1, 15,
                        	    &tresult);
		
		if (retval)
			break;
		
		use_helpline(NULL);
		(void)snprintf(comstr, sizeof(comstr), 
			"ls -CF %s", tresult);

		retval = dialog_prgbox(
			comstr, 
			comstr, 20, 60, TRUE, TRUE);

		dialog_clear();
  		
		retval = dialog_tree(names1, 
			sizeof(names1)/sizeof(unsigned char *),
			 ':',
			"tree dialog box example",
			"Other tree", 
			-1, -1, 5,
                        	    &tresult);
		if (!retval)
		{
	  		dialog_clear();
  		}
	} while (!retval);

	dialog_update();
	
	dialog_clear();
	
	end_dialog();
  	
	exit(retval);
}
Application_Message_Dialog::Application_Message_Dialog() :
    Dialog("Messages"),
    _show        (true),
    _widget      (0),
    _show_widget (0),
    _clear_widget(0),
    _close_widget(0)
{
    // Create widgets.

    _widget = new Multiline_Text_Display;

    _show_widget = new Check_Button("&Show");

    _clear_widget = new Push_Button("&Clear");

    _close_widget = new Push_Button("Clos&e");

    // Layout.

    Vertical_Layout * layout = new Vertical_Layout(this);
    layout->add(_widget);
    layout->stretch(_widget);

    Horizontal_Layout * layout_h = new Horizontal_Layout(layout);
    layout_h->margin(0);
    layout_h->add(_show_widget);
    layout_h->add_stretch();
    layout_h->add(_clear_widget);
    layout_h->add(_close_widget);
    layout_h->add_spacer(Layout::window_handle_size());

    // Preferences.

    Prefs prefs(Prefs::prefs_global(), "application_message_dialog");
    Prefs::get_(&prefs, "show", &_show);

    // Initialize.

    widget_update();
    dialog_update();

    size(size_hint());

    // Callbacks.

    _show_widget->signal.set(this, show_callback);
    _clear_widget->signal.set(this, clear_callback);
    _close_widget->signal.set(this, close_callback);
}
void Application_Message_Dialog::show_callback(bool in)
{
    _show = in;

    dialog_update();
}
void
show_dialog_message(const char * msg) {
    dialog_set_alert_message_text(main_dialog, msg);
    dialog_update(main_dialog);
    fprintf(stderr, "%s\n", msg);
}