# New Window Open is slow

**URL:** <https://forum.xojo.com/t/new-window-open-is-slow/63118>\
**Category:** General\
**Created:** [May 3, 2021, 2:00pm UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118 "2021-05-03T14:00:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 3, 2021, 2:00pm UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/1 "2021-05-03T14:00:50Z")

</div>

First of all, I have to explain a bit.

While my main laptop is doing intensive work (update ?) decided to update an old project using a MacBook Pro M1.

Of course, witj Xojo 2021r1.1.

So, the work goes and goes, and finally, I move the project to my main laptop (MacBook Pro i5, El Capitan, Xojo 2015r1).

Then, when running n the IDE or as Stand Alone, when I click in a Canvas button, I get its image nverted for around 4 seconds and it tooks another second to display the new window.

This behavior exists nly for this window, not for the other windws (I do not changed the code on the other windows)

The “original” project works fine.

On M1, I cannot talk about a slowdown because I get a dialog asking permission to use data on disk before the new window is displayed.

Conclusion:  
It may not be a good idea to move a project from version to version.

And, of course, when I will have some minutes, I will rollback the new code to the previous version and discard this project once all goes well.

FWIW

---

<div class="post-metadata">

**Author:** ![MarkusR](https://forum.xojo.com/user_avatar/forum.xojo.com/markusr/32/685_2.png) [@MarkusR](https://forum.xojo.com/u/MarkusR)\
**Post date:** [May 3, 2021, 5:29pm UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/2 "2021-05-03T17:29:28Z")

</div>

check if there are unnecessary paint events.  
plus use menu project / profile code.  
for a test you can put a return in any events and see whats happens time-saving.

---

<div class="post-metadata">

**Author:** ![Carsten\_Belling](https://forum.xojo.com/user_avatar/forum.xojo.com/carsten_belling/32/11665_2.png) [@Carsten\_Belling](https://forum.xojo.com/u/Carsten_Belling)\
**Post date:** [May 3, 2021, 5:44pm UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/3 "2021-05-03T17:44:25Z")

</div>

What does your code in the action event of the canvas button do? Have you used the debugger to go step by step trough the code and don’t see what causes the delay? Maybe it’s the code in the Open event of the new window.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 3, 2021, 11:53pm UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/4 "2021-05-03T23:53:49Z")

</div>

I do not modify the events. The modified code was in a Metod called by a PushButton.

The code only load Pictures (2) and draw them add a Rectangle in both cases.

That is why I beleive I’d better not use the project modified by Xojo 2021.r1.1, but move the changed code.

And I tested it with a clean boot, only running applcation and no Internet (the computer was “cold” (no fans with loud noise).

---

<div class="post-metadata">

**Author:** ![Carsten\_Belling](https://forum.xojo.com/user_avatar/forum.xojo.com/carsten_belling/32/11665_2.png) [@Carsten\_Belling](https://forum.xojo.com/u/Carsten_Belling)\
**Post date:** [May 4, 2021, 7:01am UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/5 "2021-05-04T07:01:39Z")

</div>

> [@Emile\_Schwarz](#):
>
> And I tested it with a clean boot, only running applcation and no Internet (the computer was “cold” (no fans with loud noise).

```
                 ^
                 Syntax Error. ')' expected.

```

Loading a picture smells like delay…

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 4, 2021, 7:26am UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/6 "2021-05-04T07:26:00Z")

</div>

> [@Carsten\_Belling](#):
>
> ` Syntax Error. ')' expected.`

2 H (night): I can have this kind of troubld. Worst, the compilet does not report it ! 😉

the “delay” happens before the window drawing itsekf begans…

More later after I report the changes to the previous version.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 5, 2021, 7:34am UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/7 "2021-05-05T07:34:39Z")

</div>

One “great” difference s in one case I use a PopupMenu, and in the other (recent) case, I use a ListBox to choose the Template (I load each of the images and paint a 30 x30 copy in Column(0) and part of its name in Column(1). 15 images, 4.2MB each (Ouch I will say) @300 DPI !!!. \*

That is probably the time difference.

- I may copy that folder and resize these for that use. 6 seconds to wait (especially for testings) is really boring.

I added this change a month (or so) ago. Of course, I forgot the code since then.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 5, 2021, 10:59am UTC](https://forum.xojo.com/t/new-window-open-is-slow/63118/8 "2021-05-05T10:59:05Z")

</div>

Rhe slowdown decrease drastically to around 1 second.

More code to add, but it is good now.
