55
expose_handler (GtkWidget *fixedtip)
55
na_fixed_tip_draw (GtkWidget *widget, cairo_t *cr)
59
gtk_widget_size_request (fixedtip, &req);
61
gtk_paint_flat_box (gtk_widget_get_style (fixedtip),
62
gtk_widget_get_window (fixedtip),
63
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
64
NULL, fixedtip, "tooltip",
65
0, 0, req.width, req.height);
57
GtkStyleContext *context;
61
width = gtk_widget_get_allocated_width (widget);
62
height = gtk_widget_get_allocated_height (widget);
64
state = gtk_widget_get_state_flags (widget);
65
context = gtk_widget_get_style_context (widget);
66
gtk_style_context_save (context);
67
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP);
68
gtk_style_context_set_state (context, state);
71
gtk_render_background (context, cr,
77
gtk_style_context_restore (context);
71
83
na_fixed_tip_class_init (NaFixedTipClass *class)
85
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
87
widget_class->draw = na_fixed_tip_draw;
73
89
fixedtip_signals[CLICKED] =
74
90
g_signal_new ("clicked",
75
91
G_OBJECT_CLASS_TYPE (class),
106
122
gtk_container_add (GTK_CONTAINER (fixedtip), label);
107
123
fixedtip->priv->label = label;
109
g_signal_connect (fixedtip, "expose_event",
110
G_CALLBACK (expose_handler), NULL);
112
125
gtk_widget_add_events (GTK_WIDGET (fixedtip), GDK_BUTTON_PRESS_MASK);
114
127
g_signal_connect (fixedtip, "button_press_event",
115
128
G_CALLBACK (button_press_handler), NULL);
136
149
gtk_window_set_screen (GTK_WINDOW (fixedtip), screen);
138
gtk_widget_size_request (GTK_WIDGET (fixedtip), &req);
151
gtk_widget_get_preferred_size (GTK_WIDGET (fixedtip), &req, NULL);
140
153
gdk_window_get_origin (parent_window, &root_x, &root_y);
141
gdk_drawable_get_size (GDK_DRAWABLE (parent_window),
142
&parent_width, &parent_height);
154
parent_width = gdk_window_get_width (parent_window);
155
parent_height = gdk_window_get_height (parent_window);
144
157
screen_width = gdk_screen_get_width (screen);
145
158
screen_height = gdk_screen_get_height (screen);