[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



#include <Ewl.h>

Ewl_Widget *main_win;
Ewl_Widget *limage;
Ewl_Widget *rimage;
Ewl_Widget *lbox;
Ewl_Widget *rbox;
Ewl_Widget *sep;

void
__destroy_main_window(Ewl_Widget *main_win, void *ev_data, void
*user_data)
{
  ewl_widget_destroy(main_win);
  ewl_main_quit();

  return;
}

int main (int argc, char **argv)
{
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <image>\n", argv[0]);
    return 1;
  }
  ewl_init(&argc, argv);

  main_win = ewl_window_new();
  ewl_window_title_set(EWL_WINDOW(main_win), "EWL Double Image
Viewer");
  ewl_callback_append(main_win, EWL_CALLBACK_DELETE_WINDOW,
		      __destroy_main_window, NULL);
  ewl_object_minimum_size_set(EWL_OBJECT(main_win), 100, 100);
  ewl_widget_show(main_win);

  lbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(main_win), lbox);
  ewl_widget_show(lbox);

  sep = ewl_vseparator_new();
  ewl_container_child_append(EWL_CONTAINER(main_win), sep);
  ewl_widget_show(sep);

  rbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(main_win), rbox);
  ewl_widget_show(rbox);

  limage = ewl_image_new(argv[1], NULL);
  ewl_container_child_append(EWL_CONTAINER(lbox), limage);
  ewl_widget_show(limage);

  rimage = ewl_image_new(argv[1], NULL);
  ewl_container_child_append(EWL_CONTAINER(rbox), rimage);
  ewl_widget_show(rimage);

  ewl_main();

  return 0;
}


Any ideas?

Cheers,
-- 
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group