Changeset f9e7e83d1603744ec991482a6817091f55697ba2
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
re51abc7
|
rf9e7e83
|
|
| 41 | 41 | |
| 42 | 42 | protected: |
| | 43 | // Gtk::Window overrides |
| | 44 | virtual void on_realize(); |
| | 45 | |
| 43 | 46 | // UI handler |
| 44 | 47 | void on_session_create(); |
-
|
r3033eda
|
rf9e7e83
|
|
| 20 | 20 | #include <fstream> |
| 21 | 21 | #include <ostream> |
| | 22 | |
| 22 | 23 | #include <gtkmm/main.h> |
| 23 | 24 | #include <gtkmm/aboutdialog.h> |
| … |
… |
|
| 25 | 26 | #include <gtkmm/filechooserdialog.h> |
| 26 | 27 | #include <gtkmm/stock.h> |
| | 28 | |
| 27 | 29 | #include <obby/client_buffer.hpp> |
| 28 | 30 | #include <obby/host_buffer.hpp> |
| | 31 | |
| 29 | 32 | #include "common.hpp" |
| 30 | 33 | #include "buffer_wrapper.hpp" |
| … |
… |
|
| 98 | 101 | { |
| 99 | 102 | on_session_quit(); |
| | 103 | } |
| | 104 | |
| | 105 | void 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); |
| 100 | 118 | } |
| 101 | 119 | |
| … |
… |
|
| 424 | 442 | { |
| 425 | 443 | // 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). |
| 426 | 448 | obby::client_buffer* buf = dynamic_cast<obby::client_buffer*>(m_buffer); |
| 427 | 449 | if(buf) |