golib
0.5
|
Base class for a main application window. Provides a menu bar, a standard File menu with about and quit items, and a Gtk::HPaned, a horizontally divided widget, as main widget. In the left area (Gtk: pack2()) a "controls box" is added, where you can add goGUI::Control widgets using addControl(). The left area (Gtk: pack1()) is left blank and you can add stuff to it if you need it. You can use something like getPaned().pack1(my_very_own_widget) to add you widget to the left side of the HPaned. To add new menus, you can do something like this: More...
#include <mainwindow.h>
Public Member Functions | |
void | addControl (goGUI::Control &c, bool active=true) |
void | setControlsVisibility () |
Shows/hides controls as indicated by the controls menu. | |
Gtk::Menu * | addMenu (const char *label) |
Gtk::MenuItem * | addMenuItem (Gtk::Menu *, const char *label) |
void | addFileAbout (const char *aboutText=0) |
void | addFileQuit () |
void | setAboutText (const char *) |
virtual void | fileAbout () |
virtual void | fileQuit () |
void | controlsToggled (goGUI::Control *control, Gtk::CheckMenuItem *item=0) |
Gtk::HPaned & | getPaned () |
Get Gtk::HPaned that is supposed to be the main widget. More... | |
Gtk::MenuBar & | getMenuBar () |
Gtk::Menu * | getFileMenu () |
Gtk::Menu * | getControlsMenu () |
Protected Attributes | |
Gtk::MenuBar | myMenuBar |
Gtk::VBox | myControlBox |
Gtk::HPaned | myPaned |
Gtk::Menu * | myFileMenu |
Gtk::Menu * | myControlsMenu |
goString | myAboutText |
MainWindowPrivate * | myPrivate |
Base class for a main application window. Provides a menu bar, a standard File menu with about and quit items, and a Gtk::HPaned, a horizontally divided widget, as main widget. In the left area (Gtk: pack2()) a "controls box" is added, where you can add goGUI::Control widgets using addControl(). The left area (Gtk: pack1()) is left blank and you can add stuff to it if you need it. You can use something like getPaned().pack1(my_very_own_widget) to add you widget to the left side of the HPaned. To add new menus, you can do something like this:
goGUI::MainWindow mw; ... Gtk::Menu* menu = mw.addMenu ("Help"); Gtk::MenuItem* mi = mw.addMenuItem (menu, "Read documentation"); mi->signal_activated().connect (sigc::mem_fun (my_widget_instance, &my_widget_class::my_void_callback)); ...
Gtk::HPaned & goGUI::MainWindow::getPaned | ( | ) |
Get Gtk::HPaned that is supposed to be the main widget.
The control box is added using pack2(), so you could add more widgets using pack1() to get them into the left region of the window.