With the exceptions of DnD, wxGTk now works with

both GTK 1.0.6 and GTK 1.2.1 - the latter still
  produces warnings and blah.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-04-01 12:14:30 +00:00
parent 1a33c3ba91
commit d345e841da
24 changed files with 119 additions and 89 deletions

View File

@@ -287,9 +287,11 @@ void wxApp::OnIdle( wxIdleEvent &event )
inOnIdle = TRUE;
#if wxUSE_THREADS
/* Resend in the main thread events which have been prepared in other
threads */
ProcessPendingEvents();
#endif
/* 'Garbage' collection of windows deleted with Close(). */
DeletePendingObjects();

View File

@@ -385,6 +385,26 @@ bool wxClipboard::AddData( wxDataObject *data )
/* Add handlers if someone requests data */
#if (GTK_MINOR_VERSION > 0)
gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
GDK_SELECTION_PRIMARY,
format,
0 ); /* what is info ? */
gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
g_clipboardAtom,
format,
0 ); /* what is info ? */
gtk_signal_connect( GTK_OBJECT(m_clipboardWidget),
"selection_get",
GTK_SIGNAL_FUNC(selection_handler),
(gpointer) NULL );
#else
gtk_selection_add_handler( m_clipboardWidget,
g_clipboardAtom,
format,
@@ -396,6 +416,7 @@ bool wxClipboard::AddData( wxDataObject *data )
format,
selection_handler,
(gpointer) NULL );
#endif
/* Tell the world we offer clipboard data */

View File

@@ -434,7 +434,7 @@ void wxComboBox::Copy()
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gtk_editable_copy_clipboard( GTK_EDITABLE(entry) );
#else
gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 );
@@ -446,7 +446,7 @@ void wxComboBox::Cut()
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gtk_editable_cut_clipboard( GTK_EDITABLE(entry) );
#else
gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 );
@@ -458,7 +458,7 @@ void wxComboBox::Paste()
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gtk_editable_paste_clipboard( GTK_EDITABLE(entry) );
#else
gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 );

View File

@@ -126,7 +126,7 @@ gdk_window_transparent_new ( GdkWindow *parent,
gprivate->window_type = attributes->window_type;
gprivate->extension_events = FALSE;
#ifndef NEW_GTK_DND_CODE
#if (GTK_MINOR_VERSION == 0)
gprivate->dnd_drag_data_type = None;
gprivate->dnd_drag_data_typesavail =
gprivate->dnd_drop_data_typesavail = NULL;
@@ -215,7 +215,7 @@ gdk_window_transparent_new ( GdkWindow *parent,
if (attributes_mask & GDK_WA_TITLE)
title = attributes->title;
else
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
title = "Unknown"; // GLH: Well I don't know for the moment what to write here.
#else
title = gdk_progname;

View File

@@ -33,10 +33,8 @@
// conditional compilation
//-------------------------------------------------------------------------
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MICRO_VERSION >= 5)
#define NEW_GTK_SCROLL_CODE
#endif
#if (GTK_MINOR_VERSION > 0)
#define NEW_GTK_SCROLL_CODE
#endif
//-----------------------------------------------------------------------------
@@ -224,7 +222,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
debug_focus_in( s_window->vscrollbar, "wxWindow::vsrcollbar", name );
#ifdef NEW_GTK_SCROLL_CODE
GtkViewport *viewport = GTK_VIEWPORT(s_window->child);
GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
#else
GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
#endif

View File

@@ -674,7 +674,7 @@ void wxTextCtrl::Cut()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) );
#else
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text), 0 );
@@ -685,7 +685,7 @@ void wxTextCtrl::Copy()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) );
#else
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text), 0 );
@@ -696,7 +696,7 @@ void wxTextCtrl::Paste()
{
wxCHECK_RET( m_text != NULL, "invalid text ctrl" );
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) );
#else
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text), 0 );

View File

@@ -14,11 +14,9 @@
// conditional compilation
//------------------------------------------------------------------------- */
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MICRO_VERSION >= 5)
#if (GTK_MINOR_VERSION > 0)
#define NEW_GTK_CONSTRUCT_CODE
#endif
#endif
#ifdef __cplusplus
extern "C" {
@@ -46,7 +44,7 @@ static void gtk_myfixed_add (GtkContainer *container,
static void gtk_myfixed_remove (GtkContainer *container,
GtkWidget *widget);
static void gtk_myfixed_foreach (GtkContainer *container,
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gboolean include_internals,
#endif
GtkCallback callback,
@@ -118,7 +116,7 @@ gtk_myfixed_class_init (GtkMyFixedClass *klass)
container_class->add = gtk_myfixed_add;
container_class->remove = gtk_myfixed_remove;
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
container_class->forall = gtk_myfixed_foreach;
#else
container_class->foreach = gtk_myfixed_foreach;
@@ -508,7 +506,7 @@ gtk_myfixed_remove (GtkContainer *container,
static void
gtk_myfixed_foreach (GtkContainer *container,
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MINOR_VERSION > 0)
gboolean include_internals,
#endif
GtkCallback callback,

View File

@@ -125,11 +125,9 @@
// conditional compilation
//-------------------------------------------------------------------------
#if (GTK_MINOR_VERSION == 1)
#if (GTK_MICRO_VERSION >= 5)
#if (GTK_MINOR_VERSION > 0)
#define NEW_GTK_SCROLL_CODE
#endif
#endif
//-----------------------------------------------------------------------------
// (debug)
@@ -1435,7 +1433,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id,
#ifdef NEW_GTK_SCROLL_CODE
gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget), m_wxwindow );
GtkViewport *viewport = GTK_VIEWPORT(s_window->child);
GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
#else
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
@@ -1931,7 +1929,7 @@ void wxWindow::DoSetClientSize( int width, int height )
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
#ifdef NEW_GTK_SCROLL_CODE
GtkWidget *viewport = scroll_window->child;
GtkWidget *viewport = GTK_BIN(scroll_window)->child;
#else
GtkWidget *viewport = scroll_window->viewport;
#endif
@@ -1996,7 +1994,7 @@ void wxWindow::GetClientSize( int *width, int *height ) const
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
#ifdef NEW_GTK_SCROLL_CODE
GtkWidget *viewport = scroll_window->child;
GtkWidget *viewport = GTK_BIN(scroll_window)->child;
#else
GtkWidget *viewport = scroll_window->viewport;
#endif