Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] GTK:How to force a shell to paint?


Doesn't seem to work.  Here is some example code.
BTW:  You are my hero for your post about the "sucky API's".
Way to tell 'em!

Steve

public static void main (String [] args) {
        int width = 32, height = 32;
        OS.gtk_init_check (new int [] {0}, null);
        int shellHandle = OS.gtk_window_new (OS.GTK_WINDOW_TOPLEVEL);
        OS.gtk_widget_show_now (shellHandle);
       
//        Neither call one works
//        OS.gdk_window_process_updates (window, false);
        OS.gdk_window_process_all_updates ();

//        Works but processes too many events
//        while (OS.gtk_events_pending () != 0) OS.gtk_main_iteration ();        
       
        int window = OS.GTK_WIDGET_WINDOW (shellHandle);
        int gc = OS.gdk_gc_new (window);
        OS.gdk_draw_rectangle(window, gc, 1, 1, 1, width-2, height-2);
        OS.gdk_gc_destroy (gc);
        while (true) {
                OS.gtk_main_iteration ();        
        }
}



Havoc Pennington <hp@xxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

03/14/02 07:20 PM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-swt-dev] GTK:How to force a shell to paint?



Steve_Northover@xxxxxxx writes:
>
> How can I know when a shell has painted?  Is there a flush thing in GTK
> hopefully better but using the same idea as XmUpdateDisplay?
>

I'm not familiar with XmUpdateDisplay; reading its man page, I think
gdk_window_process_updates() is maybe equivalent.

You'll cause flicker and inefficiency calling that indiscriminately,
of course. "Be careful"

> BTW: I am implementing the sizing hack that we discussed and generally
> fixing Shell.

Sounds perfect.

Havoc

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top