144 |
|
|
145 |
gdk_threads_leave (); |
gdk_threads_leave (); |
146 |
} |
} |
147 |
|
|
148 |
|
JNIEXPORT void JNICALL |
149 |
|
Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setNativeBounds |
150 |
|
(JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) |
151 |
|
{ |
152 |
|
GtkWidget *widget; |
153 |
|
void *ptr; |
154 |
|
|
155 |
|
ptr = NSA_GET_PTR (env, obj); |
156 |
|
|
157 |
|
gdk_threads_enter (); |
158 |
|
|
159 |
|
widget = GTK_WIDGET (ptr); |
160 |
|
|
161 |
|
/* We assume that -1 is a width or height and not a request for the |
162 |
|
widget's natural size. */ |
163 |
|
width = width < 0 ? 0 : width; |
164 |
|
height = height < 0 ? 0 : height; |
165 |
|
|
166 |
|
if (!(width == 0 && height == 0)) |
167 |
|
{ |
168 |
|
/* Set the event box's size request... */ |
169 |
|
gtk_widget_set_size_request (widget, width, height); |
170 |
|
/* ...and the label's size request. */ |
171 |
|
gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (widget)), |
172 |
|
width, height); |
173 |
|
|
174 |
|
if (widget->parent != NULL) |
175 |
|
gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y); |
176 |
|
} |
177 |
|
|
178 |
|
gdk_threads_leave (); |
179 |
|
} |