gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
EventBox.H
Go to the documentation of this file.
1 /* Copyright 2000-2018 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16  */
17 #ifndef EVENTBOX_H_
18 #define EVENTBOX_H_
19 
20 #include <gtk/gtk.h>
21 #include "Box.H"
22 
23 class EventBox : public Box {
28  virtual void pack(GtkWidget *obj) {
29  gtk_container_add(GTK_CONTAINER(widget), obj);
30  }
31 
32 public:
36  EventBox(void) {
37  widget=gtk_event_box_new();
38  setAboveChild(false);
39  setVisibleWindow(true);
40  }
41 
46  void setBackgroundColour(GdkColor *colour, GtkStateType state=GTK_STATE_NORMAL) {
47  gtk_widget_modify_bg(widget, state, colour);
48  }
49 
54  void setBackgroundColour(const char* colourName, GtkStateType state=GTK_STATE_NORMAL) {
55  GdkColor colour;
56  gdk_color_parse (colourName, &colour);
57  setBackgroundColour(&colour, state);
58  }
59 
63  void setAboveChild(bool aboveChild){
64  gtk_event_box_set_above_child(GTK_EVENT_BOX(widget),aboveChild);
65  }
66 
70  void setVisibleWindow(bool visible){
71  gtk_event_box_set_visible_window(GTK_EVENT_BOX(widget),visible);
72  }
73 };
74 #endif
void setBackgroundColour(GdkColor *colour, GtkStateType state=GTK_STATE_NORMAL)
Definition: EventBox.H:46
void setBackgroundColour(const char *colourName, GtkStateType state=GTK_STATE_NORMAL)
Definition: EventBox.H:54
void setVisibleWindow(bool visible)
Definition: EventBox.H:70
virtual void pack(GtkWidget *obj)
Definition: EventBox.H:28
void setAboveChild(bool aboveChild)
Definition: EventBox.H:63
GtkWidget * widget
The container based widget.
Definition: Widget.H:33
Definition: Box.H:153
EventBox(void)
Definition: EventBox.H:36
gtkIOStream: /tmp/gtkiostream/include/EventBox.H Source File
GTK+ IOStream  Beta