[Contents] [Back] [Prev] [Up] [Next] [Forward]

# Package Gtk.Button

This package implements a general button widget. This button can be clicked on by the user to start any action. This button does not have multiple states, it can just be temporarily pressed while the mouse is on it, but does not keep its pressed state.

- Gtk.Button Widget Hierarchy
- Gtk.Button Signals
- Gtk.Button Subprograms

## Widget Hierarchy

    Gtk_Object                    (see section Package Gtk.Object)
       \___ Gtk_Widget            (see section Package Gtk.Widget)
          \___ Gtk_Container      (see section Package Gtk.Container)
             \___ Gtk_Bin         (see section Package Gtk.Bin)
                \___ Gtk_Button   (see section Package Gtk.Button)

## Signals

- "clicked" procedure Handler (Button : access Gtk_Button_Record'Class);
  Emitted when the button has been clicked on by the user. This is the signal you should use to start your own actions.
- "enter" procedure Handler (Button : access Gtk_Button_Record'Class);
  Emitted when the mouse enters the button. The clicked signal can only be emitted when the mouse is inside the button.
- "leave" procedure Handler (Button : access Gtk_Button_Record'Class);
  Emitted when the mouse leaves the button.
- "pressed" procedure Handler (Button : access Gtk_Button_Record'Class);
  Emitted when the user presses the mouse button on the widget. The default implementation modifies the widget state and its visual aspect.
- "released" procedure Handler (Button : access Gtk_Button_Record'Class);
  Emitted when the user releases the mouse button and is inside of the widget. The default implementation modifies the widget state and its visual aspect. If the mouse is still inside the widget, then the "clicked" signal is emitted.

## Subprograms

    procedure Gtk_New
      (Button             : out    Gtk_Button;
       Label              : in     String := "");

| Create a new button. if Label is not the empty string, then the text appears in the button (and the child of the button is a Gtk_Label). On the other hand, if Label is the empty string, then no child is created for the button and it is your responsibility to add one. This is the recommended way to put a pixmap inside the button.

    function Get_Type              return Gtk.Gtk_Type;

| Return the internal value associated with a Gtk_Button.

    procedure Set_Relief
      (Button             : access Gtk_Button_Record;
       NewStyle           : in     Gtk.Enums.Gtk_Relief_Style);

| Modify the relief style for the button. This modifies only its visual aspect, not its behavior.

    function Get_Relief
      (Button             : access Gtk_Button_Record)
       return Gtk.Enums.Gtk_Relief_Style;

| Get the current relief style for the button

### Signals emission

    procedure Pressed
      (Button             : access Gtk_Button_Record);

| Send the "pressed" signal to the button

    procedure Released
      (Button             : access Gtk_Button_Record);

| Send the "release" signal to the button

    procedure Clicked
      (Button             : access Gtk_Button_Record);

| Send the "clicked" signal to the button

    procedure Enter
      (Button             : access Gtk_Button_Record);

| Send the "enter" signal to the button

    procedure Leave
      (Button             : access Gtk_Button_Record);

| Send the "leave" signal to the button

[Contents] [Back] [Prev] [Up] [Next] [Forward]