/** * cact_main_toolbar_init: * @window: this #CactMainWindow window. * * Setup the initial display of the standard main toolbars. * * This actually only setup the initial state of the toggle options in * View > Toolbars menu; when an option is activated, this will trigger * the 'on_view_toolbar_activated()' which will actually display the * toolbar. */ void cact_main_toolbar_init( BaseWindow *window, GtkActionGroup *group ) { static const gchar *thisfn = "cact_main_toolbar_init"; int i; g_debug( "%s: window=%p, group=%p", thisfn, ( void * ) window, ( void * ) group ); for( i = 0 ; i < G_N_ELEMENTS( toolbar_pos ) ; ++i ){ init_toolbar( window, group, toolbar_pos[i] ); } }
void interface (gint argc, gchar *argv[]) { GtkWidget *MenuBar; GtkWidget *VBox; GtkWidget *HandleBox; gtk_set_locale(); gtk_init (&argc, &argv); Settings = init_settings (); MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW(MainWindow), g_strconcat (WELCOME_MSG, " ", APP_NAME, " ", VERSION_NUMBER, NULL)); gtk_window_set_policy (GTK_WINDOW(MainWindow), TRUE, TRUE, FALSE); gtk_widget_set_usize (MainWindow, MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT); gtk_signal_connect (GTK_OBJECT(MainWindow), "delete_event", (GtkSignalFunc) quit, NULL); gtk_signal_connect (GTK_OBJECT(MainWindow), "destroy", (GtkSignalFunc) quit, NULL); FileProperties = g_array_new (TRUE, FALSE, sizeof(t_fprops)); VBox = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER(MainWindow), VBox); HandleBox = gtk_handle_box_new(); gtk_container_set_border_width (GTK_CONTAINER(HandleBox), 2); gtk_box_pack_start (GTK_BOX(VBox), HandleBox, FALSE, FALSE, 0); init_toolbar (GTK_BOX(VBox)); MainNotebook = gtk_notebook_new (); read_uedit_wordfile (WORDFILE); editor_init(); MenuBar = menubar_new (MainWindow); gtk_container_add (GTK_CONTAINER(HandleBox), MenuBar); gtk_notebook_popup_enable (GTK_NOTEBOOK(MainNotebook)); gtk_notebook_set_homogeneous_tabs (GTK_NOTEBOOK(MainNotebook), TRUE); gtk_notebook_set_scrollable (GTK_NOTEBOOK(MainNotebook), TRUE); gtk_box_pack_start (GTK_BOX(VBox), MainNotebook, TRUE, TRUE, 0); gtk_signal_connect (GTK_OBJECT(MainNotebook), "switch_page", (GtkSignalFunc) set_title, NULL); init_msgbar (GTK_BOX(VBox)); print_msg ("You're the welcome..."); command_line (argc, argv); autosave (AUTOSAVE_DELAY); gtk_widget_show_all (MainWindow); if (!MSGBAR_DISPLAY) hide_msgbar (); if (!TOOLBAR_DISPLAY) hide_toolbar (); gtk_timeout_add (80, (GtkFunction)display_line_column, NULL); gtk_main (); set_preferences_to_disk (&Settings, NULL); gtk_item_factory_dump_rc (g_strconcat (g_get_home_dir (), PATH_SEP_STRING, CONF_DIR, PATH_SEP_STRING, "AccelRC", NULL), NULL, FALSE); }
PapyrusDesktop::PapyrusDesktop() : QMainWindow() { p = new PapyrusDesktopPrivate; p->splitter_save_timer = 0; p->resize_save_timer = 0; p->papyrus = Papyrus::instance(); p->desktop = new AsemanDesktopTools(this); QFontDatabase::addApplicationFont( p->papyrus->resourcePathAbs() + "/fonts/DroidKaqazSans.ttf" ); p->font.setPointSize(10); resize( Papyrus::instance()->size() ); #ifdef Q_OS_MAC QToolBar *mac_toolbar = new QToolBar(); mac_toolbar->setFixedHeight(TOOLBAR_HEIGHT); mac_toolbar->setMovable(false); addToolBar(mac_toolbar); setUnifiedTitleAndToolBarOnMac(true); #endif p->main_widget = new QWidget(this); p->main_widget->resize(size()); p->main_layout = new QVBoxLayout(p->main_widget); p->main_layout->setContentsMargins(0,0,0,0); p->main_layout->setSpacing(0); init_toolbar(); init_mainWidget(); #ifdef Q_OS_WIN QtWin::enableBlurBehindWindow(this); QtWin::extendFrameIntoClientArea(this,-1,-1,-1,-1); setStyleSheet("PapyrusDesktop{border: 0px solid transparent; background: transparent}"); #endif }