eugene.chepurnykh's picture

Not firing Load event for GLControl.

Project:The Open Toolkit library
Version:1.0-beta-1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

GLControl.Load fire never.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

#1

Version:all versions» 0.9.9-1
Status:open» confirmed
the Fiddler's picture

#2

Version:0.9.9-1» 0.9.8-2

Confirmed to occur on earlier version.

objarni's picture

#3

Workaround: Use Form.Load event instead. In practice this has worked since OpenTK 0.3.13, and it seems to work with 0.9.9.1 too.

the Fiddler's picture

#4

Status:confirmed» in progress

Ok, the reason is that the GLControl.Load event is raised as soon as you call its constructor, not giving you a chance to hook it.

The solution is to modify the GLControl to be constructed lazily, as all regular controls do.

the Fiddler's picture

#5

Version:0.9.8-2» 0.9.x-dev
Status:in progress» fixed

Issue fixed in trunk (rev. 2203).

Please test if it works as expected on Windows, as I do not have access to a Windows installation right now.

objarni's picture

#6

@Fiddler cool!

@Hex - if you read this - could you please try this out since you are "close to the issue"? :) [assuming you are on Windows that is..]

the Fiddler's picture

#7

Version:0.9.x-dev» 0.9.9-2b
Status:fixed» closed

Closing issues fixed in 0.9.9-2.

FauxBestaan's picture

#8

Status:closed» open

Still not fixed on Windows in 0.9.9-2b. Having to use Form.Load instead.

the Fiddler's picture

#9

Status:open» fixed

Confirmed, debugged and fixed in SVN rev. 2281.

The issue was that the winforms designer sets all public properties by default. In this case, it specified VSync = false, which caused the control to be realized prematurely - before you got a chance to connect any events. This issue would always manifest in the VS designer but not when you created the control through code - which explains why it passed through unnoticed.

Can you please verify that it works as expected now?

FauxBestaan's picture

#10

Working as expected. Good job :)