PR# 18544 {EV_APPLICATION}.process events does not work properly in finalized app
Problem Report Summary
Submitter: finnianr
Category: EiffelVision
Priority: Low
Date: 2013/03/13
Class: Bug
Severity: Non-critical
Number: 18544
Release: 7.1.8.8986
Confidential: No
Status: Analyzed
Responsible:
Environment: Linux Mint 14 AKA Ubuntu 12.10
Synopsis: {EV_APPLICATION}.process events does not work properly in finalized app
Description
I have a data save/load progress dialog which displays a pixmap and then draws some patterns over it to indicate the progress. It works consistently well from within EStudio but in my finalized app the pixmap (more often than not) fails to display and also the first trigram pattern. However logging output indicates that the draw_pixmap call was made, so why didn't it display? Relevant code is below. As a workaround I can put the serialization operation in a separate thread. But for the sake of simplicity it would be nice if process_events worked. feature -- Element change set_progress (proportion: DOUBLE) local next_trigram_index: INTEGER do if is_displayed then next_trigram_index := (trigram_index_upper * (proportion.min (1.0))).rounded if next_trigram_index > trigram_interval.upper then trigram_interval.resize_exactly (trigram_interval.upper + 1, next_trigram_index) redraw GUI.application.process_events end end end feature -- Status query is_pixmap_displayed: BOOLEAN feature {NONE} -- Implementation on_redraw (a_x, a_y, a_width, a_height: INTEGER) do log.enter ("on_redraw") if not is_pixmap_displayed then draw_pixmap (0, 0, Pixmaps.waterfall_pixmap) log.put_line ("draw_pixmap") is_pixmap_displayed := True end across trigram_interval as trigram_index loop move_trigram_outer_area (trigram_index.item) draw_trigram end log.exit end
To Reproduce
Problem Report Interactions
Have you tried clear_and_redraw instead of just redraw, this will first clear the drawing area to the default background color first. The following code sample works: class APPLICATION inherit EV_APPLICATION create make_and_launch feature {NONE} -- Initialization make_and_launch -- Initialize and launch application do default_create prepare launch end prepare local l_da: EV_DRAWING_AREA l_vb: EV_VERTICAL_BOX l_but: EV_BUTTON do -- create and initialize the first window. create first_window create l_da l_da.expose_actions.extend (agent on_redraw (l_da, ?, ?, ?, ?)) create l_vb create l_but.make_with_text ("Click Me") l_but.select_actions.force_extend (agent handle_click (l_da)) l_vb.extend (l_da) l_vb.extend (l_but) first_window.extend (l_vb) -- Show the first window. --| TODO: Remove this line if you don't want the first --| window to be shown at the start of the progr .... Output truncated, Click download to get the full message
PS I have exhaustively tried various things to try and get the initial drawings to appear, calling flush immediately after redraw for example, or calling process events both before and after. I have also tried process_graphical_events in various combinations with the others and alone. None of them make any difference to the problem. I even tried using a pixmap instead of a EV_DRAWABLE_AREA but for some strange reason all the colors went to monochrome.