[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Solang-devel] [PATCH] Enlarged renderer improvements
From: |
Debarshi Ray |
Subject: |
[Solang-devel] [PATCH] Enlarged renderer improvements |
Date: |
Sat, 23 May 2009 17:43:08 +0530 |
http://rishi.fedorapeople.org/0001-Enlarged-renderer-improvements.patch
This is the contentious portion of this patch:
+void
+MainWindow::present_dock_object(GdlDockObject * dock_object) throw()
+{
+ if (0 == dock_object)
+ {
+ std::cerr << __FILE__ << ":" << __LINE__ << ", "
+ << __FUNCTION__ << ": " << "0 == dock_object"
+ << std::endl;
+ return;
+ }
+
+ Gtk::Container * dock_container
+ = Glib::wrap(GTK_CONTAINER(dock_object), false);
+ Gtk::Notebook * parent
+ = dynamic_cast<Gtk::Notebook *>(dock_container->get_parent());
+
+ if (0 != parent)
+ {
+ const gint page_num = parent->page_num(*dock_container);
+ parent->set_current_page(page_num);
+ }
+}
There is really no way to avert the dynamic_cast here. The parent of a
widget is stored somewhere in the private part of GtkWidget and it is
always returned as a GtkWidget * (or Gtk::widget *).
Happy hacking,
Debarshi
--
One reason that life is complex is that it has a real part and an
imaginary part.
-- Andrew Koenig
- [Solang-devel] [PATCH] Enlarged renderer improvements,
Debarshi Ray <=