GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Gtk::Scale Class Reference

A GtkScale C++ wrapper class. More...

#include <gfc/gtk/scale.hh>

Inheritance diagram for GFC::Gtk::Scale:

GFC::Gtk::Range GFC::Gtk::Widget GFC::Gtk::Object GFC::Atk::Implementor GFC::G::Object GFC::G::TypeInterface GFC::G::TypeInstance GFC::G::TypeInstance GFC::Trackable GFC::Trackable GFC::Gtk::HScale GFC::Gtk::VScale List of all members.

Signal Prototpyes

Public Member Functions

Accessors
Methods
Signal Proxies

Protected Member Functions

Constructors

Detailed Description

A GtkScale C++ wrapper class.

The Scale widget is an abstract class, used only for deriving the subclasses HScale and VScale.

A Scale is a slider control used to select a numeric value. To use it, you'll probably want to investigate the methods on its base class, Range, in addition to the methods for Scale itself. To set the value of a scale, you would normally use Gtk::Range::set_value(). To detect changes to the value, you would normally connect to the value_changed signal.


Constructor & Destructor Documentation

GFC::Gtk::Scale::Scale GtkScale *  scale,
bool  owns_reference = false
[explicit, protected]
 

Construct a new Scale from an existing GtkScale.

Parameters:
scale A pointer to a GtkScale.
owns_reference Set false if the initial reference count is floating, set true if it's not.

The scale can be a newly created GtkScale or an existing GtkScale (see G::Object::Object).


Member Function Documentation

Pango::Layout* GFC::Gtk::Scale::get_layout  )  const
 

Gets the Pango::Layout used to display the scale.

Returns:
The Pango::Layout for this scale, or null if set_draw_value() is set to false.

void GFC::Gtk::Scale::get_layout_offsets int *  x,
int *  y
const
 

Obtains the coordinates where the scale will draw the Pango::Layout representing the text in the scale.

Parameters:
x The location to store X offset of layout, or null.
y The location to store Y offset of layout, or null.

Remember when using Pango::Layout you need to convert to and from pixels using PANGO_PIXELS() or PANGO_SCALE. If set_draw_value() is set to false, the return values are undefined.

PositionType GFC::Gtk::Scale::get_value_pos  )  const
 

Gets the position in which the current value is displayed.

Returns:
The position in which the current value is displayed.

void GFC::Gtk::Scale::set_digits int  digits  ) 
 

Sets the number of decimal places that are displayed in the value.

Parameters:
digits The number of decimal places to display, e.g. use 1 to display 1.0, 2 to display 1.00 etc.

Also causes the value of the adjustment to be rounded off to this number of digits, so the retrieved value matches the value the user saw.

void GFC::Gtk::Scale::set_draw_value bool  draw_value  ) 
 

Specifies whether the current value is displayed as a string next to the slider.

Parameters:
draw_value Set true to display the current value.

void GFC::Gtk::Scale::set_value_pos PositionType  pos  ) 
 

Sets the position in which the current value is displayed.

Parameters:
pos The position in which the current value is displayed.


Member Data Documentation

const FormatValueSignalType GFC::Gtk::Scale::format_value_signal [static, protected]
 

Format value signal (see sig_format_value()).

Calls a slot with the signature:

             char* function(double value);
             // value: The scale value to format.
             // return: An allocated string representing value.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:41 2004 for GFC-UI by doxygen 1.3.8