Changeset f9e7e83d1603744ec991482a6817091f55697ba2

Show
Ignore:
Timestamp:
01/06/07 23:36:03 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
3033edac03b725f01854e3161ac09682e771a063
Children:
eaf8ea60a6c6e52574582ec32b5ccc28c44d6f33
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:36:03Z+0000
Message:

[project @ Initialise size of paned widgets [fixes #5]]

Original author: Armin Burgmeier <armin@…>
Date: 2005-05-29 13:48:11+00:00

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • inc/window.hpp

    re51abc7 rf9e7e83  
    4141 
    4242protected: 
     43        // Gtk::Window overrides 
     44        virtual void on_realize(); 
     45 
    4346        // UI handler 
    4447        void on_session_create(); 
  • src/window.cpp

    r3033eda rf9e7e83  
    2020#include <fstream> 
    2121#include <ostream> 
     22 
    2223#include <gtkmm/main.h> 
    2324#include <gtkmm/aboutdialog.h> 
     
    2526#include <gtkmm/filechooserdialog.h> 
    2627#include <gtkmm/stock.h> 
     28 
    2729#include <obby/client_buffer.hpp> 
    2830#include <obby/host_buffer.hpp> 
     31 
    2932#include "common.hpp" 
    3033#include "buffer_wrapper.hpp" 
     
    98101{ 
    99102        on_session_quit(); 
     103} 
     104 
     105void Gobby::Window::on_realize() 
     106{ 
     107        Gtk::Window::on_realize(); 
     108 
     109        // Initialize paned sizes. This cannot be done in the constructor 
     110        // because the widget's sizes are not known. 
     111        int submin = m_subpaned.property_min_position(); 
     112        int submax = m_subpaned.property_max_position(); 
     113        int mainmin = m_mainpaned.property_min_position(); 
     114        int mainmax = m_mainpaned.property_max_position(); 
     115 
     116        m_subpaned.set_position(submin + (submax - submin) * 4 / 5); 
     117        m_mainpaned.set_position(mainmin + (mainmax - mainmin) * 3 / 4); 
    100118} 
    101119 
     
    424442{ 
    425443        // TODO: Something like is_client to prevent dynamic_cast? 
     444        // TODO: local_buffer should fix this issue because the host does not 
     445        // send a user_join for the local user (well, it does, but it does 
     446        // it in its constructor - no signal handler could have been 
     447        // connected at this time). 
    426448        obby::client_buffer* buf = dynamic_cast<obby::client_buffer*>(m_buffer); 
    427449        if(buf)