/* Copyright (C) 1998-2002 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see .
*/
#include
#include
#include
#include
#include
namespace Gtk
{
void
Bin::remove()
{
auto child = get_child();
if (child)
Container::remove(*child);
}
_DEPRECATE_IFDEF_START
void
Bin::add_label(const Glib::ustring& str, bool mnemonic /* = false */,
double x_align /* = 0.5 */, double y_align /* = 0.5 */)
{
auto label = manage(new Label(str, x_align, y_align, mnemonic));
add(*label);
//This might not always be appropriate:
//because maybe the mnemonic widget should be another child widget.
//if(mnemonic)
//label->set_mnemonic_widget(*this);
label->show();
}
_DEPRECATE_IFDEF_END
void
Bin::add_label(const Glib::ustring& str, bool mnemonic,
Align x_align, Align y_align /* = ALIGN_CENTER */)
{
auto label = manage(new Label(str, x_align, y_align, mnemonic));
add(*label);
label->show();
}
_DEPRECATE_IFDEF_START
void
Bin::add_pixlabel(const std::string& pixfile,
const Glib::ustring& str,
double x_align /* = 0.5 */, double y_align /* = 0.5 */)
{
//Create Image and Label widgets:
auto pmap = manage(new Image(pixfile));
auto label = manage(new Label(str));
label->set_alignment (x_align, y_align);
//Put them in a Box:
auto hbox = manage(new Box(ORIENTATION_HORIZONTAL, 5));
hbox->pack_start(*pmap, PACK_SHRINK);
hbox->pack_start(*label);
hbox->show_all();
//And put that Box in this:
add(*hbox);
}
_DEPRECATE_IFDEF_END
void
Bin::add_pixlabel(const std::string& pixfile,
const Glib::ustring& str,
Align x_align, Align y_align /* = ALIGN_CENTER */)
{
//Create Image and Label widgets:
auto pmap = manage(new Image(pixfile));
auto label = manage(new Label(str, x_align, y_align));
//Put them in a Box:
auto hbox = manage(new Box(ORIENTATION_HORIZONTAL, 5));
hbox->pack_start(*pmap, PACK_SHRINK);
hbox->pack_start(*label);
hbox->show_all();
//And put that Box in this:
add(*hbox);
}
} //namespace Gtk