Changeset 94 for trunk/src/gtk/MainView.cxx
- Timestamp:
- 04/20/06 06:29:18 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/gtk/MainView.cxx (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gtk/MainView.cxx
r89 r94 34 34 // Forward declarations. 35 35 static void main_window_about_box_cb (GtkWidget *, gpointer); 36 static gboolean main_window_moved_or_resized_cb (GtkWidget *, 37 GdkEventConfigure *, gpointer); 36 38 static void main_window_go_to_first_page_cb (GtkWidget *, gpointer); 37 39 static void main_window_go_to_last_page_cb (GtkWidget *, gpointer); … … 143 145 m_MainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); 144 146 setMainWindowIcon (); 145 // Connect already the destroy signal.147 // Connect already the destroy and delete signal. 146 148 g_signal_connect (G_OBJECT (m_MainWindow), "destroy", 147 149 G_CALLBACK (main_window_quit_cb), NULL); 150 g_signal_connect (G_OBJECT (m_MainWindow), "configure-event", 151 G_CALLBACK (main_window_moved_or_resized_cb), NULL); 148 152 // Create the main vertical box. 149 153 m_MainBox = gtk_vbox_new (FALSE, 0); … … 358 362 MainView::show (void) 359 363 { 364 Config &config = Config::getConfig (); 365 gtk_window_set_default_size (GTK_WINDOW (m_MainWindow), 366 config.getWindowWidth (), 367 config.getWindowHeight ()); 360 368 gtk_widget_show (m_MainWindow); 361 gtk_window_maximize (GTK_WINDOW (m_MainWindow)); 369 gtk_window_move (GTK_WINDOW (m_MainWindow), 370 config.getWindowX (), config.getWindowY ()); 362 371 } 363 372 … … 754 763 755 764 /// 765 /// @brief Called when the window is moved or resized. 766 /// 767 /// This is used to save the current window's position and size. 768 /// 769 gboolean 770 main_window_moved_or_resized_cb (GtkWidget *widget, GdkEventConfigure *event, 771 gpointer data) 772 { 773 // First set the window's size and position to the configuration. 774 GtkWindow *m_MainWindow = GTK_WINDOW (widget); 775 Config &config = Config::getConfig (); 776 config.setWindowSize (event->width, event->height); 777 gint x; 778 gint y; 779 gtk_window_get_position (m_MainWindow, &x, &y); 780 config.setWindowPos (x, y); 781 782 return FALSE; 783 } 784 785 /// 756 786 /// @brief The user tries to go to the first page. 757 787 ///
