X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afa7bd1eef03eb167b7f70412f1b4ef08ad73138..637b7e4f3a0fd1c6bdfc21d28e37bcf760e3b364:/src/gtk/notebook.cpp diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index a184447c6f..25785835a2 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -22,6 +22,12 @@ #include "wx/bitmap.h" #include "wx/fontutil.h" +// FIXME: Use GtkImage instead of GtkPixmap. Don't use gtk_container_border_width +#include +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "wx/gtk/private.h" #include "wx/gtk/win_gtk.h" @@ -36,13 +42,6 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) -//----------------------------------------------------------------------------- -// idle system -//----------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- @@ -89,7 +88,7 @@ WX_DEFINE_LIST(wxGtkNotebookPagesList) extern "C" { static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), GtkNotebookPage *WXUNUSED(page), - gint page, + guint page, wxNotebook *notebook ) { // are you trying to call SetSelection() from a notebook event handler? @@ -169,7 +168,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* //----------------------------------------------------------------------------- extern "C" { -static gint +static void gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) { if (g_isIdle) @@ -178,8 +177,6 @@ gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) /* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize here in order to make repositioning before showing to take effect. */ gtk_widget_queue_resize( win->m_widget ); - - return FALSE; } } @@ -188,7 +185,10 @@ gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win ) //----------------------------------------------------------------------------- extern "C" { -static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook ) +static gboolean +gtk_notebook_key_press_callback( GtkWidget *widget, + GdkEventKey *gdk_event, + wxNotebook *notebook ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -217,7 +217,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk } // m_selection = page; - gtk_notebook_set_page( GTK_NOTEBOOK(widget), page ); + gtk_notebook_set_current_page( GTK_NOTEBOOK(widget), page ); g_signal_stop_emission_by_name (widget, "key_press_event"); return TRUE; @@ -422,7 +422,7 @@ int wxNotebook::SetSelection( size_t page ) // cache the selection m_selection = page; - gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), page ); + gtk_notebook_set_current_page( GTK_NOTEBOOK(m_widget), page ); wxNotebookPage *client = GetPage(page); if ( client ) @@ -441,7 +441,7 @@ bool wxNotebook::SetPageText( size_t page, const wxString &text ) nb_page->m_text = text; - gtk_label_set( nb_page->m_label, wxGTK_CONV( nb_page->m_text ) ); + gtk_label_set_text( nb_page->m_label, wxGTK_CONV( nb_page->m_text ) ); return TRUE; } @@ -475,7 +475,7 @@ bool wxNotebook::SetPageImage( size_t page, int image ) { /* Case 2) or 4). There is already an image in the gtkhbox. Let's find it */ - GList *child = gtk_container_children(GTK_CONTAINER(nb_page->m_box)); + GList *child = gtk_container_get_children(GTK_CONTAINER(nb_page->m_box)); while (child) { if (GTK_IS_PIXMAP(child->data)) @@ -741,7 +741,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const size_t i = 0; GtkNotebook * notebook = GTK_NOTEBOOK(m_widget); - if (gtk_notebook_get_scrollable(notebook)); + if (gtk_notebook_get_scrollable(notebook)) i = g_list_position( notebook->children, notebook->first_tab ); for ( ; i < count; i++ ) @@ -758,7 +758,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const { GtkWidget *pixmap = NULL; - GList *children = gtk_container_children(GTK_CONTAINER(box)); + GList *children = gtk_container_get_children(GTK_CONTAINER(box)); for ( GList *child = children; child; child = child->next ) { if ( GTK_IS_PIXMAP(child->data) )