## Xfce Gtk+ extensions

Xfce Gtk+ extensions — Common used functions for GtkWidget's that are not provided by the Gtk+ library.

## Functions

GtkWidget * | xfce_gtk_button_new_mixed ()
GtkWidget * | xfce_gtk_frame_box_new ()
GtkWidget * | xfce_gtk_frame_box_new_with_content ()
void | xfce_gtk_window_center_on_active_screen ()

## Includes

    #include <libxfce4ui/libxfce4ui.h>

## Description

These functions allow the developer to quickly create common widgets, without the hassle of creating formatted string or a lot of code dupplication.

## Functions

### xfce_gtk_button_new_mixed ()

    GtkWidget *
    xfce_gtk_button_new_mixed (const gchar *stock_id,
                               const gchar *label);

Creates a new GtkButton containing a mnemonic label and a stock icon. The `stock_id` could be something like GTK_STOCK_OK or GTK_STOCK_APPLY.

When the `stock_id` is `NULL` a normal mnemonic button will be created, when `label` is `NULL` a stock button will be created. This behaviour is added for `xfce_message_dialog_new()`.

#### Parameters

stock_id | the name of the stock item. |
label | the text of the button, with an underscore in front of the mnemonic character. |

#### Returns

the newly created GtkButton widget.

### xfce_gtk_frame_box_new ()

    GtkWidget *
    xfce_gtk_frame_box_new (const gchar *label,
                            GtkWidget **container_return);

Creates an Xfce-styled frame. The frame is a GtkFrame, without outline and an optional bolded text label. The contents of the frame are indented on the left. The return value is the GtkFrame itself. The `container_return` is a GtkAlignment widget to which children of the frame should be added.

See also: `xfce_gtk_frame_box_new_with_content()`.

#### Parameters

label | the text to use as the label of the frame. |
container_return | return location for the frame's container. |

#### Returns

the newly created GtkFrame widget.

### xfce_gtk_frame_box_new_with_content ()

    GtkWidget *
    xfce_gtk_frame_box_new_with_content (const gchar *label,
                                         GtkWidget *content);

Creates a widget with `xfce_gtk_frame_box_new()` and adds the `content` GtkWidget to the frame.

#### Parameters

label | the text to use as the label of the frame. |
content | the GtkWidget to put inside the frame. |

#### Returns

the newly created GtkFrame widget.

### xfce_gtk_window_center_on_active_screen ()

    void
    xfce_gtk_window_center_on_active_screen
                                   (GtkWindow *window);

Determines the screen that contains the pointer and centers the `window` on it. If it failes to determine the current pointer position, `window` is centered on the default screen.

This function only works properly if you call it before realizing the window and you haven't set a fixed window position using `gtk_window_move()`.

See also: `xfce_gdk_screen_get_active()`.

#### Parameters

window | the GtkWindow to center. |

## Types and Values