Author Topic: Hourglass in long operations (project loading)  (Read 30620 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: Hourglass in long operations (project loading)
« Reply #30 on: July 28, 2006, 12:36:28 am »
Quote
Another note:
Why not add the hourglass at the beginning of the function?
It would be only 1 line of code and all switch cases would be affected while now some are skipped.

I assume you are talking about the OpenGeneric. If so, that's not a good place, since the DnD will call OpenGeneric for every file, that means N times creation/destruction of the glass hour. The glass hour is being constructed though in the Dnd before' all the files are being submitted to OpenGeneric.

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Hourglass in long operations (project loading)
« Reply #31 on: July 28, 2006, 12:46:51 am »
I assume you are talking about the OpenGeneric.
Yes, I forgot to say that ;-)

If so, that's not a good place, since the DnD will call OpenGeneric for every file, that means N times creation/destruction of the glass hour. The glass hour is being constructed though in the Dnd before' all the files are being submitted to OpenGeneric.

I try to explain better what I mean:
- place the houglass call in both OpenGeneric() and OnDropFiles()
- in OnDropFiles() is ok
- in OpenGeneric() place it at the first lines
- no problem if the function is called several times in OpenGeneric() by OnDropFiles()
From wxWidgets docs (http://www.wxwindows.org/manuals/2.6.3/wx_dialogfunctions.html#wxbeginbusycursor):
These two calls (wxBeginBusyCursor and wxEndBusyCursor) can be nested, and a counter ensures that only the outer calls take effect.
And note that wxBusyCursor works by calling wxBeginBusyCursor in the constructor, and wxEndBusyCursor in the destructor

For the other problem (about OnDropFiles()), it seems to be caused by:
Code
        Freeze();
        Thaw();
because removing them, it is fixed.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #32 on: July 28, 2006, 09:47:51 am »
Quote
1) the hourglass is called, but never shown
Not true. It is shown for a short time, but it is reset soon after. We're not doing it, so send your complaints to Julian Smart.
Moving the call to the beginning of the function does not change the behaviour.

Quote
2) the GUI freezes more than before
That's what Freeze() does. However, it avoids the flickering due to overdraw, and it makes loading the dropped files significantly faster, which is one thing you complained about in the first place.

Quote
3) while the files are being loaded, you can click on the window below C::B
Don't do that then.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Hourglass in long operations (project loading)
« Reply #33 on: July 28, 2006, 09:24:00 pm »
Quote
1) the hourglass is called, but never shown
Not true. It is shown for a short time, but it is reset soon after. We're not doing it, so send your complaints to Julian Smart.
Moving the call to the beginning of the function does not change the behaviour.
I don't know Julian Smart, who is him?

Quote
2) the GUI freezes more than before
That's what Freeze() does. However, it avoids the flickering due to overdraw, and it makes loading the dropped files significantly faster, which is one thing you complained about in the first place.
I never complained about slow loading, but about no feedback during the slow loading. They are different things ;-)

Quote
3) while the files are being loaded, you can click on the window below C::B
Don't do that then.
Probably this was not clear, but this is a bug (probably of wxWidgets).
If I have Firefox loaded below C::B and I move the mouse over C::B window, I see the text which is "highlighted" by the mouse on the HTML page of Firefox (animated images too).
Anyway I think that Freeze() and Thaw() give more troubles than what they solve.

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: Hourglass in long operations (project loading)
« Reply #34 on: July 29, 2006, 02:58:25 am »

Quote
1) the hourglass is called, but never shown
Not true. It is shown for a short time, but it is reset soon after. We're not doing it, so send your complaints to Julian Smart.
Moving the call to the beginning of the function does not change the behaviour.
I don't know Julian Smart, who is him?

  Just so you know that should be: "who is he".  Julian Smart is the creator of wxWidegts (formerly wxWindows).  I have emailed him a couple of times, and I even got replies.  You might try addressing the behaivor/problem in the wxWidgets forums.

jmccay
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Hourglass in long operations (project loading)
« Reply #35 on: July 31, 2006, 03:53:14 pm »
  Just so you know that should be: "who is he".
Ok, thanks! I've just learned something more of this language (english). ;-)
[EDIT]
And it's that way because he is the subject, not the object. Right?
[/EDIT]

I found in another forum a problem like this:
http://wxforum.shadonet.com/viewtopic.php?p=33381#33381
Quote
If the code between the Freeze & Thaw are expensive, and you for example press the mouse left click - you might ending up pressing on the application under your application.
Quote
The best thing to do is to call the frame child's Freeze & thaw.
Do we need to call freeze on all the application?
Can we freeze only needed widgets (like the menu bar)?

Anyway I think that the "Start here" page should be closed _before_ any opening sequence.
« Last Edit: July 31, 2006, 07:40:49 pm by iw2nhl »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Hourglass in long operations (project loading)
« Reply #36 on: July 31, 2006, 04:41:31 pm »
Do we need to call freeze on all the application?
Can we freeze only needed widgets (like the menu bar)?
To what avail? The menu bar is not causing any significant overdraw.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: Hourglass in long operations (project loading)
« Reply #37 on: July 31, 2006, 06:45:23 pm »
Do we need to call freeze on all the application?
Can we freeze only needed widgets (like the menu bar)?
To what avail? The menu bar is not causing any significant overdraw.
1) menubar is _constantly_ redrawn (flickers)
2) that was only an example