2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ====================================================== */
11 #ifndef GNOME_PIXBUTTON
12 #define GNOME_PIXBUTTON
14 #include <gtk--/button.h>
15 #include <gtk--/box.h>
16 #include <gtk--/label.h>
17 #include <gnome--/pixmap.h>
18 #include <gnome--/stock.h>
20 /* Button class used in LyX Gnome frontend for buttons with pixmaps and
25 class PixButton: public Gtk::Button
28 PixButton(string label, string pixname): Button()
30 Gtk::Box * b = manage( new Gtk::HBox() );
31 l = manage( new Gtk::Label(label) );
32 Gnome::Pixmap * p = Gtk::wrap( GNOME_PIXMAP( gnome_stock_pixmap_widget(0, pixname.c_str()) ) );
35 b->children().push_back(Gtk::Box_Helpers::Element(*p, false, false));
36 b->children().push_back(Gtk::Box_Helpers::Element(*l, false, false));
40 accelkey_ = l->parse_uline(label);
47 guint get_accelkey() { return accelkey_; }
49 void set_text(string const & newlabel) { l->set_text(newlabel); }