Euphoria Ticket #616: Faulty backend in final release of Euphoria 4.0.0 and in RC2.

The backend eubw.exe in Euphoria 4.0.0 appears to be faulty, the fault having appeared between release candidate 1 (RC1) and release candidate 2 (RC2). The environment is Windows XP.

Below there are three examples of programs which gave the desired results with RC1 but give undesirable results with both RC2 and the final release of Euphoria 4.0.0. The first two examples are inspired by the forum thread "Win32lib problem?" initiated by ChrisB. The third example was initially described in Ticket:598.

Example 1 is the following short program:

include win32lib.ew 
constant Win1 = create(Window,"Strange",0,Default,Default,400,400,0), 
		TabCtl = create(TabControl,"",Win1,5,5,380,355,0), 
		Tab1 = create(TabItem,"First",TabCtl,0,0,0,0,0), 
		Label1 = create(CText,"Nothing important",Tab1,10,30,360,25,0), 
		Cbox1 = create(Combo,"",Tab1,20,80,250,100,0) 
WinMain(Win1,Normal) 

This has a ComboBox and a text label in a TabItem. Using RC2 or the final release the text label is blacked out and the Edit box of the ComboBox is incorrectly underlined. They are correct with RC1.

Example 2 is the demo tabcontrol2.exw from the win32lib version 0.70.20 obtained from

win32lib_0_70_20.zip. This has the the same faults as example 1.

Example 3 is the even shorter program described in Ticket:598:

include std\win32\msgbox.e 
message_box("Trying\nmessage_box","Trial",MB_OK) 

This produces a message box using RC1 but not when using RC2 or the final release. A fix has been issued but the fix for this cannot fix the first two examples.

In all three examples the backend was isolated as the problem area by first producing a .il file using the final release and then running with the backends from RC1, RC2 and the final release.

Translated programs using Watcom give the correct results.

Details

Type: Bug Report Severity: Major Category: Interpreter
Assigned To: unknown Status: Invalid Reported Release: 4.0.0
Fixed in SVN #: View VCS: none Milestone: 4.0.1

1. Comment by mattlewis Feb 17, 2011

I get the "bad" results also with the intepreter.

2. Comment by SDPringle Feb 21, 2011

This is caused in the revision when the resource files were renamed.

3. Comment by mattlewis Feb 22, 2011

I think this is the rev which Shawn is referencing: hg:euphoria/rev/8b261149c13c. But I think the key is the added manifest file.

It does not appear that we ever create our own resource file when translating (only rc_file, which is passed by the user is ever passed to the resource compiler). Hence, our manifest is never included for translated programs. And I guess there is some issue with the manifest as far as the example code is concerned.

4. Comment by mattlewis Feb 27, 2011

I built an interpreter without using the manifest, and the controls look correct. I suppose the next question is whether win32lib needs to somehow be more aware that the XP style controls are active.

Is there anything special about controls in a tab control?

5. Comment by mattlewis Feb 28, 2011

One workaround (until we figure out the root cause, at least) is to not compile the manifest, but put the manifest in the bin dir. This way, end users could easily remove it if they have this issue with their programs.

6. Comment by mattlewis Feb 28, 2011

I think this is likely a Win32Lib issue. An equivalent wxEuphoria program looks correct when executed:

include wxeu/wxeud.e 
constant  
	Win1   = create( wxFrame, {0, -1, "Strange"}), 
	TabCtl = create( wxNotebook, Win1 ), 
	Tab1   = create( wxWindow, TabCtl ), 
	Label1 = create( wxStaticText, { Tab1, -1, "Nothing important", 10, 10, 360, 25 }), 
	Cbox1  = create( wxComboBox, {Tab1, -1, "", 10, 40, 250, 100 } ) 
 
add_page( TabCtl, Tab1, "First", 1, -1 ) 
wxMain( Win1 ) 

Possibly some hints here. I think that win32lib simply hides or makes visible individual controls based on tracking the tab items.

Poking around on the web, it seems like a more common method is to create a child dialog or window to do it all en masse. This seems to be the approach taken by wxWidgets. Alternatively, it might be as simple as handling WM_DRAWITEM messages differently.

7. Comment by DerekParnell Feb 28, 2011

Let's assume its a Win32lib bug for now then. I'll start looking into it from that angle.

Let's close off this ticket.

8. Comment by mattlewis Feb 28, 2011

Closing as invalid. Appears to be a library, not euphoria issue.

9. Comment by SDPringle Mar 07, 2011

I have fixed this. I'll be uploading a fix next time I go to a hotspot.

10. Comment by mattlewis Mar 07, 2011

Reopened and assigned to Shawn.

11. Comment by DerekParnell Mar 07, 2011

What have you fixed? I thought the problem was with the win32lib library and how it rendered tabbed controls.

12. Comment by mattlewis Mar 07, 2011

Shawn has been somewhat coy about what, exactly, he did, but I think it relates to something in the resource files that are compiled into the binaries.

13. Comment by SDPringle Mar 09, 2011

See: hg:euphoria/rev/cee581904732

changeset: 4725:cee581904732 parent: 3882:8b261149c13c user: Shawn Pringle <shawn.pringle@gmail.com> date: Mon Feb 21 11:46:41 2011 -0300 files: source/Makefile.wat source/eui.manifest source/eui.rc source/exw.rc source/exw.res description: Backed out changeset 8b261149c13c

  • fixes ticket 616

14. Comment by SDPringle Mar 09, 2011

See: hg:euphoria/rev/c0c3ee477c1d

changeset: 4727:c0c3ee477c1d user: Shawn Pringle <shawn.pringle@gmail.com> date: Wed Feb 23 09:37:40 2011 -0300 files: tests/t_616.e description:

  • added a unit test for ticket 616 (t_616.e)

15. Comment by mattlewis Mar 09, 2011

The "fix" was apparently to break the manifest. That all needs to be reverted. Putting this back to invalid, since all evidence points to a win32lib problem.

16. Comment by mattlewis Sep 16, 2013

For future searches, forum references with different solutions:

Search



Quick Links

User menu

Not signed in.

Misc Menu