Xfce
Foundation Classes |
|||
« Main Page | Index | |||
ArrowsThe Arrow widget draws an arrowhead, facing in a number of possible directions and having a number of possible styles. It can be very useful when placed on a button in many applications. The Arrow widget is a 'no window' widget and emits no signals. To create a new arrow, use one of the following constructors: Arrow(); The 'arrow_type' argument can be one of the values from the Gtk::ArrowType enum:
The first constructor creates a
default arrow
widget with an arrow type of ARROW_RIGHT and a shadow type of
SHADOW_OUT.
The second constructor creates an arrow widget with the specified
'arrow_type'
and 'shadow_type'.
You can set the arrow type with this method: void
set(Gtk::ArrowType arrow_type, Gtk::ShadowType shadow_type); Arrow Buttons ExampleThe Arrow Buttons example creates a small window containing four arrow buttons. Each button displays an arrow pointing in one of the four cardinal directions up, down, left and right.The header file for Arrow Buttons is <arrow.hh>: #include <xfc/main.hh> and the source file is <arrow.cc>: #include "arrow.hh" Gtk::HBox *hbox =
new
Gtk::HBox;
hbox->set_border_width(2); add(*hbox);
// Pack and show
all the
widgets.
ArrowButton *button = new ArrowButton(Gtk::ARROW_UP,
Gtk::SHADOW_IN);
hbox->pack_start(*button, false, false, 3);
button = new
ArrowButton(Gtk::ARROW_DOWN, Gtk::SHADOW_OUT);
hbox->pack_start(*button, false, false, 3);
button = new
ArrowButton(Gtk::ARROW_LEFT, Gtk::SHADOW_ETCHED_IN);
hbox->pack_start(*button, false, false, 3);
button = new
ArrowButton(Gtk::ARROW_RIGHT, Gtk::SHADOW_ETCHED_OUT);
hbox->pack_start(*button, false, false, 3);
hbox->show_all(); Compiling Arrow Buttons
If you compiled and installed XFC yourself, you will find the source
code for Arrow Buttons in the
<examples/arrow> source directory along with a Makefile. If
XFC came pre-installed, or you installed it from an RPM package, you
will
find the source code in the
</usr/share/doc/xfcui-X.X/examples/arrow> subdirectory. In
this case you will have to create the Makefile yourself (replace X.X
with the
version number of the libXFCui library you have installed). |
Copyright © 2004-2005 The XFC Development Team | Top |
XFC
4.4 |