WM_SETREDRAW on Linux?

Linux specific forum
klaver
Enthusiast
Enthusiast
Posts: 147
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

WM_SETREDRAW on Linux?

Post by klaver »

Is there on linux something similar to the Windows WM_SETREDRAW message?

For example I've created a ListIconGadget and want to fill it with ~10000 items, and I don't want it to be redrawn after adding every single item.

It should redraw only once after all 10k items are added (is gtk_widget_queue_draw_() good for this?).

Thanks in advance for help.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

... imho not the best way ... as this command makes the widget invalid (the region) and it will be redrawn ... I guess that's what you want to avoid ?

The way I know (maybe there's a better way) is the following:

1. bind the expose event to a procedure of your own
2. block the expose event as long as you fill your widget
3. unblock the expose event
4. redraw the widget
5. remove the expose-event to let the main loop do this again for you

Code: Select all

;1.
myInstance=g_signal_connect_object(*your_widget,"expose-event",@your_procedure(),*gobject,#G_CONNECT_SWAPPED)
;2.
g_signal_handler_block_(*your_widget,myInstance)
;3.
g_signal_handler_unblock_(*your_widget,myInstance)
;4.
g_signal_emit_by_name_(myinstance,"exopse-event",0)
;5.
g_signal_handler_disconnect_(myinstance,*your_widget)
hope this helps a bit (and there are not too much typos :roll: )
Post Reply