Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gtk::Scale Class Reference

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

#include <inti/gtk/scale.h>

Inheritance diagram for Inti::Gtk::Scale:

Inti::Gtk::Range Inti::Gtk::Widget Inti::Gtk::Object Inti::Atk::Implementor Inti::G::Object Inti::G::TypeInterface Inti::G::TypeInstance Inti::MemoryHandler Inti::G::TypeInstance Inti::ReferencedBase Inti::ReferencedBase Inti::Gtk::HScale Inti::Gtk::VScale List of all members.

Public Member Functions

Accessors
Methods
Property Proxies
Signal Proxies

Protected Member Functions

Constructors
Signal Handlers

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

Inti::Gtk::Scale::Scale GtkScale *  scale,
bool  reference = false
[explicit, protected]
 

Construct a new Scale from an existing GtkScale.

Parameters:
scale A pointer to a GtkScale.
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

String Inti::Gtk::Scale::format_value double  value  ) 
 

Emits the "format_value" signal to format the value.

Parameters:
value the current adjustment value.

If there are no user signal handlers, falls back to a default format.

PositionType Inti::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.

virtual char* Inti::Gtk::Scale::on_format_value double  value  )  [protected, virtual]
 

Called to format the scale value before it gets displayed.

Parameters:
value The scale value to format.
Returns:
An allocated string representing value.

This signal handler allows you to change how the scale value is displayed. The return value must be an allocated string representing value. That string will then be used to display the scale's value. Here's an example signal handler which displays a value 1.0 as with "-->1.0<--".
             char*
             MyScale::on_format_value(double value)
             {
                return g_strdup_printf("-->%0.*g<--", scale->get_digits(value));
             }

void Inti::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 Inti::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 Inti::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.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:18 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002