Ejemplo n.º 1
0
int main(int argc, char *const argv[])
{
	eHandle win, vbox, hbox, frame;
	eHandle vscrollbar, hscrollbar;
	eHandle scrollwin;

	egui_init(argc, argv);

	win  = egui_window_new(GUI_WINDOW_TOPLEVEL);
	e_signal_connect(win, SIG_DESTROY, egui_quit);
	egui_request_resize(win, 300, 300);

	frame = egui_frame_new(_("frame"));
	egui_set_expand(frame, etrue);
	egui_add(win, frame);

	vbox = egui_vbox_new();
	hbox = egui_hbox_new();
	egui_set_expand(vbox, etrue);
	egui_set_expand(hbox, etrue);

	vscrollbar = egui_vscrollbar_new(etrue);
	hscrollbar = egui_hscrollbar_new(etrue);

	scrollwin = egui_scrollwin_new();

	egui_hook_v(scrollwin, vscrollbar);
	egui_hook_h(scrollwin, hscrollbar);

	egui_add(vbox, scrollwin);
	egui_add(vbox, hscrollbar);

	egui_add(hbox, vbox);
	egui_add(hbox, vscrollbar);

	egui_add(frame, hbox);

	add_box_button(scrollwin);

	e_signal_connect(scrollwin, SIG_EXPOSE_BG, win_expose_bg);

	egui_main();

	return 0;
}
Ejemplo n.º 2
0
Archivo: frame.c Proyecto: kroody/egui
int main(int argc, char *const argv[])
{
	eHandle win, vbox, hbox, frame;
	eHandle button1, button2, button3;

	egui_init(argc, argv);

	win  = egui_window_new(GUI_WINDOW_TOPLEVEL);
	e_signal_connect(win, SIG_DESTROY, egui_quit);

	frame = egui_frame_new(_("frame vbox"));
	egui_set_expand(frame, true);
	egui_add(win, frame);

	vbox = egui_vbox_new();
	egui_set_expand(vbox, true);
	egui_box_set_layout(vbox, BoxLayout_SPREAD);
	egui_box_set_spacing(vbox, 10);
	//egui_box_set_align(vbox, BoxAlignStart);
	egui_box_set_border_width(vbox, 10);
	egui_add(frame, vbox);

	frame = egui_frame_new(_("frame hbox4"));
	egui_set_expand_h(frame, true);
	egui_add(vbox, frame);

	hbox = egui_hbox_new();
	egui_box_set_spacing(hbox, 10);
	button1 = egui_button_new(80, 40);
	egui_add(hbox, button1);
	button2 = egui_button_new(80, 40);
	egui_add(hbox, button2);
	egui_add(frame, hbox);
	button3 = egui_button_new(80, 40);
	egui_add(hbox, button3);
	egui_add(frame, hbox);

	hbox = egui_hbox_new();
	egui_box_set_layout(hbox, BoxLayout_SPREAD);
	egui_box_set_spacing(hbox, 10);
	egui_set_expand(hbox, true);
	button1 = egui_button_new(80, 40);
	button2 = egui_button_new(80, 40);
	button3 = egui_button_new(80, 40);
	egui_add(hbox, button1);
	egui_add(hbox, button2);
	egui_add(hbox, button3);

	frame = egui_frame_new(_("frame hbox1"));
	egui_set_expand_h(frame, true);
	egui_add(frame, hbox);
	egui_add(vbox, frame);

	hbox = egui_hbox_new();
	//egui_box_set_layout(hbox, BoxLayout_END);
	egui_box_set_spacing(hbox, 10);
	egui_set_expand(hbox, true);
	button1 = egui_button_new(80, 40);
	button2 = egui_button_new(80, 40);
	button3 = egui_button_new(80, 40);
	egui_add(hbox, button1);
	egui_add(hbox, button2);
	egui_add(hbox, button3);

	frame = egui_frame_new(_("frame hbox2"));
	egui_set_expand(frame, true);
	egui_add(frame, hbox);
	egui_add(vbox, frame);

	hbox = egui_hbox_new();
	egui_box_set_layout(hbox, BoxLayout_SPREAD);
	egui_box_set_spacing(hbox, 10);
	egui_set_expand(hbox, true);
	button1 = egui_button_new(80, 40);
	button2 = egui_button_new(80, 40);
	button3 = egui_button_new(80, 40);
	egui_add(hbox, button1);
	egui_add(hbox, button2);
	egui_add(hbox, button3);

	frame = egui_frame_new(_("frame hbox3"));
	//egui_set_expand(frame, true);
	egui_add(frame, hbox);
	egui_add(vbox, frame);

	e_signal_connect(win, SIG_EXPOSE_BG, win_expose_bg);

	egui_main();

	return 0;
}