Пример #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
Gtk::Window * Inkscape::UI::window_new (const gchar *title, unsigned int resizeable)
{
    Gtk::Window *window = new Gtk::Window(Gtk::WINDOW_TOPLEVEL);
    window->set_title (title);
    window->set_resizable (resizeable);
    window->signal_key_press_event().connect(sigc::ptr_fun(&on_window_key_press));

    return window;
}
Пример #3
0
int main(int argc, char** argv) {
	auto app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
	Gtk::Window win;
	win.set_title("Cairo example");
	MyArea my_area;
	win.add(my_area);
	my_area.show();
	return app->run(win);
}
Пример #4
0
int main(int argc, char* argv[]) {
	Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
    Gtk::Window win;
	win.set_title("DrawingArea");
	Ovalo area;
	win.add(area);
	area.show();
    return app->run(win);
}
Пример #5
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);
}
Пример #6
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);
}
Пример #7
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);	
}
Пример #8
0
int main( int argc, const char* argv[] )
{
	Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");

	Gtk::Window win;
	win.set_title("tut_2d_physics_engine");

	Main_engine * engi = new Main_engine();//Don't think this is ever deleted

	win.add(*sim);
	engi->show();
	
	return app->run(win);
}
Пример #9
0
int main(int argc, char *argv[] )
{
	Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");

	Gtk::Window win;
	win.set_title("CGOL - SFC");

	Simple_GOL_Area * area = new Simple_GOL_Area(50,50);

	win.add(*area);
	area->show();
	
	return app->run(win);
	//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);
}
int main(int argc, char* argv[])
{
   Gtk::Main kit(argc, argv);  //this must be first
   ListArray<CD>* cds = CD::readCDs("cds.txt");
   //DO THIS
   //create the sorted linked list (call it sorted_list)
	   SortedListLinked<CD>* sorted_list = new SortedListLinked<CD>(&CD::compare_items);



   String title("CDs");
   ListBox<CD>* lstCDs = new ListBox<CD>(&title, sorted_list);
   addCDs(cds, lstCDs);

   Gtk::Window win;

   win.set_title("Music!");
   win.set_position(Gtk::WIN_POS_CENTER);

   //the size of the window
   int width = 640;
   int height = 520;

   win.set_size_request(width, height);
   win.set_resizable(false);  

   //10 rows, 1 column
   Gtk::Table tbl(10, 1, true);

   Gtk::Button btnRemove("Remove");

   //left attach, right attach, top attach, bottom attach
   tbl.attach(*lstCDs, 0, 1, 0, 9, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND, 0, 0);
   tbl.attach(btnRemove, 0, 1, 9, 10, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND, 0, 0);
   win.add(tbl);

   //a button must register with a method that has a void return type
   btnRemove.signal_clicked().connect(sigc::mem_fun(lstCDs, &ListBox<CD>::removeSelectedItem));

   win.show_all_children();
   Gtk::Main::run(win);

   deleteCDs(cds);
   delete cds;
   delete lstCDs;

   return 0;
}
Пример #12
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);
}
Пример #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
int main(int argc, char** argv)
{
   Matrix* mat = Matrix::readMatrix("maze.txt");

   Gtk::Main kit(argc, argv);

   Gtk::Window win;
   win.set_title("Maze!");
   win.set_position(Gtk::WIN_POS_CENTER);
   //the size of the window
   int width = 875;
   int height = 445;

   win.set_size_request(width, height);
   win.set_resizable(false);  

   Gtk::Table tbl(10, 1, true);
   int rows = tbl.property_n_rows();
   int button_height = (int) (((double) height)/rows + 0.5);

   Maze* maze = new Maze(mat);
   MazeGUI mg(width, height - button_height, maze);  //needs to know its own dimensions
   Gdk::Color c("#FF0000");
   Gtk::Button btnMaze("Solve!");

   btnMaze.signal_clicked().connect(sigc::mem_fun(mg, &MazeGUI::on_maze_button_click_event));

   tbl.attach(mg, 0, 1, 0, 9, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND, 0, 0);
   tbl.attach(btnMaze, 0, 1, 9, 10, Gtk::FILL | Gtk::EXPAND, Gtk::FILL | Gtk::EXPAND, 0, 0);
   win.add(tbl);

   win.show_all_children();
   Gtk::Main::run(win);

   return 0;
}