Пример #1
0
int main(int argc, char **argv)
{
	gdk_threads_init();
	gdk_threads_enter();

	gSimuApp = Gtk::Application::create(argc, argv, "org.gtkmm.example");

	Gtk::Window win;
	win.set_title("RE8000 Simulador");
	win.set_default_size(800, 480);

	/* Virtual Framebuffer area */
	pArea = new MyArea;

	/* Input */
	pArea->add_events(Gdk::BUTTON_PRESS_MASK);
	pArea->signal_button_press_event().connect(sigc::ptr_fun(&VirtualInputClickHandler));
	pArea->add_events(Gdk::BUTTON_RELEASE_MASK);
	pArea->signal_button_release_event().connect(sigc::ptr_fun(&VirtualInputClickHandler));
	gdk_threads_leave();

	/* Fb */
	pVirtFb = new char[800 * 480 * 2];

	/* Gtk Window call */
	win.add(*pArea);
	pArea->show();


	pMarsh = new marshmallow_thread;

	return gSimuApp->run(win);
}
Пример #2
0
void RunMViewer()
{
    Gtk::Window win;
    win.set_title("MViewer");

    win.set_default_size(800, 600);
    PackTrackWindow(win, bb::bind(&PackMonitor, _1, _2, _3));

    RunWindow(win);
}
int main(int argc, char *argv[])
{
  Glib::RefPtr<Gtk::Application> app =
    Gtk::Application::create(argc, argv,
      "org.gtkmm.examples.base");

  Gtk::Window window;
  window.set_default_size(200, 200);

  return app->run(window);
}
Пример #4
0
void TestExampleDA(DAExposeFunc ef)
{
    InitGtkmm();

    ExampleDA da(ef);

    Gtk::Window win;
    win.set_default_size(400, 400);
    win.add(da);

    RunWindow(win);
}
Пример #5
0
int main(int argc, char *argv[])
{

    // make window
    Glib::RefPtr<Gtk::Application> app =
        Gtk::Application::create(argc, argv,
                                 "tutorial2");

    Gtk::Window window;

    window.set_default_size(400,200);
    window.set_title("Tutorial 2");

    // This creates a vertical box container with 0 padding
    Gtk::Box *vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL, 0));
    window.add(*vbox);

    // creates menu bar
    Gtk::MenuBar *menubar = Gtk::manage(new Gtk::MenuBar());
    vbox->pack_start(*menubar, Gtk::PACK_SHRINK, 0);

    // create menu items
    Gtk::MenuItem *menuitem_file = Gtk::manage(new Gtk::MenuItem("_File", true));
    menubar->append(*menuitem_file);
    Gtk::Menu *filemenu = Gtk::manage(new Gtk::Menu());
    menuitem_file->set_submenu(*filemenu);
    Gtk::MenuItem *menuitem_quit = Gtk::manage(new Gtk::MenuItem("_Quit", true));
    filemenu->append(*menuitem_quit);

    // create grid container with border width 10
    // and add it to the new cell of the vertical box
    Gtk::Grid *grid = Gtk::manage(new Gtk::Grid);
    grid->set_border_width(10);
    vbox->add(*grid);

    // create button
    Gtk::Button *b1 = Gtk::manage(new Gtk::Button("Button 1"));
    b1->set_hexpand(true);		//  take up all unused space horizontally
    b1->set_vexpand(true);		//  take up all unused space vertically
    // possition 0(x), 0(y), span 1 cell wide and 2 cells down
    grid->attach(*b1, 0, 0, 1, 2);

    Gtk::Button *b2 = Gtk::manage(new Gtk::Button("Button 2"));
    grid->attach(*b2, 1, 0, 1, 1);

    Gtk::Button *b3 = Gtk::manage(new Gtk::Button("Button 3"));
    grid->attach(*b3, 1, 1, 1, 1);

    vbox->show_all();

    return app->run(window);
}
Пример #6
0
int main(int argc, char *argv[])
{
	Glib::RefPtr<Gtk::Application> app = 
		Gtk::Application::create(argc, argv,
			 "tutorial1");

	Gtk::Window window;
	
	window.set_default_size(400,200);
	window.set_title("Tutorial 1");

	return app->run(window);	
}
Пример #7
0
int main(int argc, char **argv){

    Gtk::Main     kit (argc, argv);
    Gtk::Window   win;
    GObjTestTile  pl;

    SimpleViewer viewer(&pl);

    win.add(viewer);
    win.set_default_size(640,480);
    win.show_all();

    kit.run(win);
}
Пример #8
0
int main(int argc, char **argv){

    Gtk::Main     kit (argc, argv);
    Gtk::Window   win;
    GObjTestGrid  pl(150000);

    DThreadViewer viewer(&pl);

    win.add(viewer);
    win.set_default_size(640,480);
    win.show_all();

    kit.run(win);
}
Пример #9
0
int main(int argc, char *argv[]){
    //Inicializamos el framework
    Gtk::Main kit(argc, argv);

    Gtk::CheckButton button("Checkbox button");

    Gtk::Window window;
    window.set_default_size(400,400);
    window.add(button);
    window.show_all();

    //Iniciamos el loop de eventos
    Gtk::Main::run(window);
    return 0;
}
Пример #10
0
void
DoScaledText()
{
    InitGtkmm();

    Gtk::Window win;
    ScaledText t_wdg;

    win.set_title("Scaled Text");
    win.set_border_width(0);

    win.set_default_size(300, 100);
    win.add(t_wdg);
    RunWindow(win);
}
Пример #11
0
void
DoTextWidget()
{
    InitGtkmm();

    Gtk::Window win;
    TextWidget t_wdg;

    Gdk::Color white;
    white.set_rgb(0x0, 0x0, 0xffff);

    win.set_title("TextWidget");

    t_wdg.modify_bg(Gtk::STATE_NORMAL, white);

    win.set_default_size(300, 300);
    win.add(t_wdg);

    RunWindow(win);
}
Пример #12
0
int main(int argc, char **argv){

    Gtk::Main     kit (argc, argv);
    Gtk::Window   win;
    GObjTestTile  p1;

    SimpleViewer viewer(&p1);
    Rubber rubber(&viewer);

    iPoint p(20,20);
    rubber.add_src_sq(p, 3);
    rubber.add_dst_sq(3);
    rubber.add_rect(p);
    rubber.add_line(p);

    win.add(viewer);
    win.set_default_size(640,480);
    win.show_all();

    kit.run(win);
}
Пример #13
0
int main(int argc, char* argv[]) {
  Gtk::Main kit(argc, argv);

  AnalogueGUI guiBox("http://www.westkamper.com/lv2/analogue/gui"); 

  float controls[p_n_ports-3];
  for (int i = 0; i < p_n_ports-3; i++)  {
    controls[i] = p_port_meta[i].default_value;
  }

  Gtk::Window window;
  window.set_title("Analogue");
  window.set_default_size(800, 400);
  window.add(guiBox);
  window.show_all();

  Gtk::Main::run(window);

  return 0;

}
Пример #14
0
void SetAppWindowSize(Gtk::Window& win, int wdh)
{
    Point sz = CalcBeautifulRect(wdh);
    win.set_default_size(sz.x, sz.y);
}