+2003-09-02 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkDialogPeer.java (create): Add width
+ and height arguments to GtkWindowPeer.create method call.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java
+ (create(int,int,int)): New method.
+ (create(int)): Add call to new create method.
+ (create()): Add width and height arguments to create method
+ call.
+ (GtkWindowPeer): Remove call to setBounds.
+ * java/awt/Frame.java (Frame(String)): Initialize visible field
+ to false.
+ (Frame(GraphicsConfiguration)): Likewise.
+ (Frame(String,GraphicsConfiguration)): Likewise.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (create):
+ Add width and height parameters. Call
+ gtk_window_set_default_size.
+ (connectHooks): Remove unused name variable.
+ (static setBounds): Call gtk_window_resize not
+ gtk_widget_set_usize.
+ (setBounds): Remove unused nchildren variable.
+
2003-08-31 Ingo Proetel <proetel@aicas.com>
* java/util/logging/Logger.java: provide class and method information
static protected final int GTK_WINDOW_TOPLEVEL = 0;
static protected final int GTK_WINDOW_POPUP = 1;
- native void create (int type);
+ native void create (int type, int width, int height);
+
+ void create (int type)
+ {
+ create (type, awtComponent.getWidth(), awtComponent.getHeight());
+ }
void create ()
{
- create (GTK_WINDOW_POPUP);
+ create (GTK_WINDOW_POPUP,
+ awtComponent.getWidth(),
+ awtComponent.getHeight());
}
native void connectHooks ();
public GtkWindowPeer (Window window)
{
super (window);
-
- Dimension d = window.getSize ();
- setBounds (0, 0, d.width, d.height);
}
public void getArgs (Component component, GtkArgList args)
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
- (JNIEnv *env, jobject obj, jint type)
+ (JNIEnv *env, jobject obj, jint type, jint width, jint height)
{
- gpointer window;
+ GtkWidget *window;
GtkWidget *vbox, *layout;
gdk_threads_enter ();
window = gtk_window_new (type);
+ gtk_window_set_default_size (GTK_WINDOW(window), width, height);
+
vbox = gtk_vbox_new (0, 0);
layout = gtk_layout_new (NULL, NULL);
gtk_box_pack_end (GTK_BOX (vbox), layout, 1, 1, 0);
(JNIEnv *env, jobject obj)
{
void *ptr;
- GtkVBox* vbox;
- GtkWidget *layout;
+ GtkWidget* vbox, *layout;
GList* children;
- char* name;
+
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
children = gtk_container_get_children(GTK_CONTAINER(ptr));
vbox = children->data;
- name = GTK_OBJECT_TYPE_NAME(vbox);
+
if(!GTK_IS_VBOX(vbox))
{
printf("*** this is not a vbox\n");
}
children = gtk_container_get_children(GTK_CONTAINER(vbox));
layout = children->data;
- name = GTK_OBJECT_TYPE_NAME(layout);
+
if(!GTK_IS_LAYOUT(layout))
{
printf("*** widget is not a layout ***");
gtk_widget_show (vbox);
gtk_widget_realize (window);
-/* setBounds (window, x, y, width, height); */
connect_awt_hook (env, obj, 1, window->window);
set_visible (window, visible);
static void
setBounds (GtkWidget *widget, jint x, jint y, jint width, jint height)
{
-/* gdk_window_get_root_origin (widget->window, ¤t_x, ¤t_y); */
-
-/* if (current_x != x || current_y != y) */
-/* { */
-/* gdk_window_set_hints (widget->window, x, y, 0, 0, 0, 0, GDK_HINT_POS); */
-/* gdk_window_move (widget->window, x, y); */
-/* } */
-
- gtk_widget_set_usize (widget, width, height);
+ gtk_window_resize (GTK_WINDOW(widget), width, height);
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBounds
gint *depth)
{
GdkWindow *private;
- unsigned int nchildren;
g_return_if_fail (window != NULL);