Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
mini-button.hpp
Go to the documentation of this file.
1/*
2 MINI-BUTTON.hpp - a tool button-like widget
3
4 Copyright (C)
5 2009, Joel Holdsworth <joel@airwebreathe.org.uk>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
23#ifndef STAGE_WIDGET_MINI_BUTTON_H
24#define STAGE_WIDGET_MINI_BUTTON_H
25
26#include "stage/gtk-base.hpp"
27
28
29namespace stage {
30namespace widget {
31
35 template<class T>
37 : public T
38 {
40 Gtk::Image image_;
41
42 public:
49 MiniWrapper (Gtk::StockID const& stock_id
50 ,const Gtk::IconSize icon_size = Gtk::ICON_SIZE_LARGE_TOOLBAR)
51 : image_(stock_id, icon_size)
52 {
53 T::add (image_);
54 T::set_relief (Gtk::RELIEF_NONE);
55 T::set_focus_on_click (false);
56 }
57
58
64 void
65 setStockID (Gtk::StockID const& stock_id
66 ,const Gtk::IconSize icon_size = Gtk::ICON_SIZE_LARGE_TOOLBAR)
67 {
68 image_.set (stock_id, icon_size);
69 }
70 };
71
72
73
76
79
80
81
82}}// stage::widget
83#endif /*STAGE_WIDGET_MINI_BUTTON_H*/
A wrapper for ToolButton-like Button widgets.
MiniWrapper(Gtk::StockID const &stock_id, const Gtk::IconSize icon_size=Gtk::ICON_SIZE_LARGE_TOOLBAR)
Creates a new Button containing the image and text from a stock item.
void setStockID(Gtk::StockID const &stock_id, const Gtk::IconSize icon_size=Gtk::ICON_SIZE_LARGE_TOOLBAR)
Sets a new image from a stock-id for this button.
Gtk::Image image_
image widget for the button.
A set of basic GTK includes for the UI.
MiniWrapper< Gtk::ToggleButton > MiniToggleButton
A ToggleToolButton-like widget.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37