remove requested button rather than last one, return true from successful Create(), and a non-pch build fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
// Purpose: wxInfoBar implementation for GTK
|
// Purpose: wxInfoBar implementation for GTK
|
||||||
// Author: Vadim Zeitlin
|
// Author: Vadim Zeitlin
|
||||||
// Created: 2009-09-27
|
// Created: 2009-09-27
|
||||||
// RCS-ID: $Id: wxhead.cpp,v 1.10 2009-06-29 10:23:04 zeitlin Exp $
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
#endif // WX_PRECOMP
|
#endif // WX_PRECOMP
|
||||||
|
|
||||||
#include "wx/vector.h"
|
#include "wx/vector.h"
|
||||||
|
#include "wx/stockitem.h"
|
||||||
|
|
||||||
#include "wx/gtk/private.h"
|
#include "wx/gtk/private.h"
|
||||||
#include "wx/gtk/private/messagetype.h"
|
#include "wx/gtk/private/messagetype.h"
|
||||||
@@ -143,7 +144,7 @@ bool wxInfoBar::Create(wxWindow *parent, wxWindowID winid)
|
|||||||
GTKConnectWidget("response", G_CALLBACK(wxgtk_infobar_response));
|
GTKConnectWidget("response", G_CALLBACK(wxgtk_infobar_response));
|
||||||
GTKConnectWidget("close", G_CALLBACK(wxgtk_infobar_close));
|
GTKConnectWidget("close", G_CALLBACK(wxgtk_infobar_close));
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxInfoBar::~wxInfoBar()
|
wxInfoBar::~wxInfoBar()
|
||||||
@@ -254,13 +255,16 @@ void wxInfoBar::RemoveButton(wxWindowID btnid)
|
|||||||
i != buttons.rend();
|
i != buttons.rend();
|
||||||
++i )
|
++i )
|
||||||
{
|
{
|
||||||
gtk_widget_destroy(i->button);
|
if (i->id == btnid)
|
||||||
buttons.erase(i.base());
|
{
|
||||||
|
gtk_widget_destroy(i->button);
|
||||||
|
buttons.erase(i.base());
|
||||||
|
|
||||||
// see comment in GTKAddButton()
|
// see comment in GTKAddButton()
|
||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFAIL_MSG( wxString::Format("button with id %d not found", btnid) );
|
wxFAIL_MSG( wxString::Format("button with id %d not found", btnid) );
|
||||||
|
Reference in New Issue
Block a user