# ListBox events? Arrrgghhh!

**URL:** <https://forum.xojo.com/t/listbox-events-arrrgghhh/78147>\
**Category:** General\
**Created:** [November 16, 2023, 10:30pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147 "2023-11-16T22:30:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Wagner](https://forum.xojo.com/user_avatar/forum.xojo.com/james_wagner/32/822_2.png) [@James\_Wagner](https://forum.xojo.com/u/James_Wagner)\
**Post date:** [November 16, 2023, 10:30pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/1 "2023-11-16T22:30:39Z")

</div>

Just updated to 2023R3.1 during the sale. I know that lots of changes have happened since my long suffering 2019 but this seems totally bizarre!

Very first action is to try to bring my ListBoxes up to date in my current project. I HAD a CellClicked event. I looked up in the new help system (will reserve comments on that until later). It tells me that the following are available:

CellPressed  
DoublePressed  
MouseDown

Any of these MIGHT be useful for the task I have (selecting a cell for editing). BUT, when I try to add an event, I ONLY get:

DoubleClick

What gives? Even the mismatch between DoublePressed and DoubleClick is cause for concern. A ListBox is a key control and there is such a huge difference between the documentation and the implementation? My first experience does not instill the Xojo/RB (since RB0.9) confidence I have previously experienced! Previous upgrades have been pretty painless but this is starting to look like a rewrite! Not thrilled, yet!

Should say MacOS Monterey on Intel silicon (iMac 19,1).

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [November 16, 2023, 10:37pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/2 "2023-11-16T22:37:05Z")

</div>

Your old Listboxes should have the same events as always.  
If you now use a DesktopListbox then the new events apply.

Are you creating a new project or are you working with an old project (from Xojo 2019)?

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [November 16, 2023, 10:48pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/3 "2023-11-16T22:48:55Z")

</div>

If you already have a CellClicked event implemented, you cannot also implement CellPressed.

I personally wouldn’t try updating a 2019 project to 2023 DesktopXYZ controls. There really is no reason to at this time.

In order to get used to the new API 2 controls, start with a fresh project and play around with them. Start small and build.

---

<div class="post-metadata">

**Author:** ![James\_Wagner](https://forum.xojo.com/user_avatar/forum.xojo.com/james_wagner/32/822_2.png) [@James\_Wagner](https://forum.xojo.com/u/James_Wagner)\
**Post date:** [November 16, 2023, 10:49pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/4 "2023-11-16T22:49:29Z")

</div>

Old project! When I select the listbox name, it says super is ListBox. When I right click the control name and choose Add an Event, it does seem to give the old event list. But something is going wrong in populating a popup (from a database). Must be something else going on.

So, how do a get a language reference for the older API?

Thanks for the fill!

Jim

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [November 16, 2023, 10:53pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/5 "2023-11-16T22:53:21Z")

</div>

> [@James\_Wagner](#):
>
> how do a get a language reference for the older API?

Keep Xojo 2019 installed and select ‘Use built-in documentation’ or search the deprecated section on the new documentation.

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [November 16, 2023, 10:57pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/6 "2023-11-16T22:57:13Z")

</div>

Also worth noting, on the coding tab of the preferences there is an option to have the autocomplete include the deprecated items along with the API2 ones, which may be of help. It generally does include them anyway on an older API1 project.

---

<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:** [November 16, 2023, 11:04pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/7 "2023-11-16T23:04:26Z")

</div>

there should be a few menus update controls to api 2 or update event names.  
handle with care and backup the project first.

---

<div class="post-metadata">

**Author:** ![James\_Wagner](https://forum.xojo.com/user_avatar/forum.xojo.com/james_wagner/32/822_2.png) [@James\_Wagner](https://forum.xojo.com/u/James_Wagner)\
**Post date:** [November 17, 2023, 1:33am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/8 "2023-11-17T01:33:55Z")

</div>

Thanks, Ian.

Well it looks like I am having the same problem with the ListBox CellClick event that I did in 2019.

If I have a few simple statements (inside the event method) such as

**Me.CellTypeAt(row, column) = ListBox.CellTypes.TextField**  
**Me.EditCellAt(row, column)**

It executes just fine with the clicked ListBox cell selected. BUT if I add a breakpoint on either of those lines, the cell is no longer selected. This really hampers debugging!

It also fails if I add a method call and there is a breakpoint inside the called method.

Jim

---

<div class="post-metadata">

**Author:** ![Ivan\_Tellez](https://forum.xojo.com/letter_avatar_proxy/v4/letter/i/a9a28c/32.png) [@Ivan\_Tellez](https://forum.xojo.com/u/Ivan_Tellez)\
**Post date:** [November 17, 2023, 2:31am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/9 "2023-11-17T02:31:31Z")

</div>

> [@James\_Wagner](#):
>
> Just updated to 2023R3.1 during the sale. I know that lots of changes have happened since my long suffering 2019 but this seems totally bizarre!

Remember that you have 90 days to return it 😅

I tried the last release, besides all the silly renaming and the extra work with no beneffits, it was painfully SLOW. Better to stick with my 2019r2.1

---

<div class="post-metadata">

**Author:** ![Arnaud\_N](https://forum.xojo.com/user_avatar/forum.xojo.com/arnaud_n/32/21824_2.png) [@Arnaud\_N](https://forum.xojo.com/u/Arnaud_N)\
**Post date:** [November 17, 2023, 9:34am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/10 "2023-11-17T09:34:37Z")

</div>

> [@James\_Wagner](#):
>
> It executes just fine with the clicked ListBox cell selected. BUT if I add a breakpoint on either of those lines, the cell is no longer selected. This really hampers debugging!
> 
> It also fails if I add a method call and there is a breakpoint inside the called method.

It might have to do with the app being deactivated, because the IDE is brought to the front since the breakpoint is meant for that. Once deactivated, the app invalidates the focus.  
There are rare times where breakpoints aren’t the best way to debug.

Also, remember you always have the option to convert your project to API2, if you wish.

---

<div class="post-metadata">

**Author:** ![TimStreater](https://forum.xojo.com/user_avatar/forum.xojo.com/timstreater/32/586_2.png) [@TimStreater](https://forum.xojo.com/u/TimStreater)\
**Post date:** [November 17, 2023, 10:01am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/11 "2023-11-17T10:01:34Z")

</div>

> [@James\_Wagner](#):
>
> Old project! When I select the listbox name, it says super is ListBox. When I right click the control name and choose Add an Event, it does seem to give the old event list. But something is going wrong in populating a popup (from a database). Must be something else going on.

Well, what do you expect? Your first step should be to change the Super of the listbox to DesktopListbox. Then you’ll see the new events. You can’t rename an event so you have to copy/paste the code from CellClicked into CellPressed. Then delete CellClicked. Tedious but doable.

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [November 17, 2023, 11:41am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/12 "2023-11-17T11:41:30Z")

</div>

> [@James\_Wagner](#):
>
> Well it looks like I am having the same problem with the ListBox CellClick event that I did in 2019.

The API 1 controls are not changing anymore, they’re deprecated. Only the new Desktop controls are will get updates.

---

<div class="post-metadata">

**Author:** ![AlbertoD](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@AlbertoD](https://forum.xojo.com/u/AlbertoD)\
**Post date:** [November 17, 2023, 2:41pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/13 "2023-11-17T14:41:56Z")

</div>

You can try converting instead of changing the Super. Please backup first and test often. This way you don’t need to manually add the renamed events, copy your code and delete the old events:  
 ![ezgif.com-video-to-gif (44)](https://forum.xojo.com/uploads/default/original/2X/1/11462458539b3812819a92eddb1b639b52e2d0ba.gif)

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [November 17, 2023, 4:31pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/14 "2023-11-17T16:31:39Z")

</div>

You can also convert a whole window to API 2 by right clicking on the window and choosing convert. One warning though. You cannot have an API 1 menu on and API 2 window and vice versa. So you will have to duplicate the your menu and convert that, using that on the API windows.

---

<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:** [November 17, 2023, 4:39pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/15 "2023-11-17T16:39:36Z")

</div>

my experience was that the convert by xojo context menues to Desktop… and API2 or Event Names  
was much better than manually one by one.

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [November 17, 2023, 9:46pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/16 "2023-11-17T21:46:45Z")

</div>

> [@James\_Wagner](#):
>
> if I add a breakpoint on either of those lines, the cell is no longer selected. This really hampers debugging!

Sometimes you can get around focus related issues by using remote debug, even on the same machine. Don’t know if that applies here, but it may be worth a try.

---

<div class="post-metadata">

**Author:** ![James\_Wagner](https://forum.xojo.com/user_avatar/forum.xojo.com/james_wagner/32/822_2.png) [@James\_Wagner](https://forum.xojo.com/u/James_Wagner)\
**Post date:** [November 18, 2023, 12:17am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/17 "2023-11-18T00:17:54Z")

</div>

Thanks for the comments and Tim’s suggestion. I never used Remote Debugging but this might be worth the efforts. Appreciate the idea.

Jim

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [November 18, 2023, 12:44am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/18 "2023-11-18T00:44:03Z")

</div>

The transition to a different language can be scary and frustrating, but if you transition to the right language, it is also incredibly rewarding.

It is a great feeling getting something back as a reward for your efforts.

---

<div class="post-metadata">

**Author:** ![Jeff\_Tullin](https://forum.xojo.com/user_avatar/forum.xojo.com/jeff_tullin/32/693_2.png) [@Jeff\_Tullin](https://forum.xojo.com/u/Jeff_Tullin)\
**Post date:** [November 18, 2023, 7:07am UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/19 "2023-11-18T07:07:35Z")

</div>

> [@Ian\_Kennedy](#):
>
> The API 1 controls are not changing anymore, they’re deprecated. Only the new Desktop controls are will get updates.

This worries me a lot. I don’t want to waste my time switching from 1 to 2 and then trying to spot what needs ‘fixing’ as a result.

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [November 18, 2023, 12:42pm UTC](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147/20 "2023-11-18T12:42:20Z")

</div>

As others have said the deprecated controls are there for a very long time. The IDE would have to be converted before they’ll ever be removed. That would be a massive undertaking.

That said if you have found a bug in the API 1 control it is unlikely to be fixed at which point you would need a workaround or to change to API 2. Given how long the API 1 controls have been around it seems unlikely that they can’t be made to work correctly.

[Next page](https://forum.xojo.com/t/listbox-events-arrrgghhh/78147.md?page=2)
