Is chatGPT good enough?

Here’s a chatGPT reply. Is it correct to say that ‘Xojo’s ListBox doesn’t natively support text formatting within cells’?

CHATGPT
To add highlighting to the parts of the search results that match the search query and to display a spinner during the search, you can follow these steps:

  1. Highlight Matching Parts: You’ll need to manipulate the text to highlight the matching parts. Xojo’s ListBox doesn’t natively support text formatting within cells, so you’ll have to use a workaround, such as using a Canvas or an HTMLViewer in a cell to display rich text.

That’s a ridiculous answer.

4 Likes

Look at the Documentation:

ListBox: Here

How to set some characters of a Cell to Bold

Look for other styles there.

1 Like

ChatGPT is only able to tell what someone gave it previously.

1 Like

Like most of us… :person_shrugging:

1 Like

You are correct, but there are ChatGPT believers at large !

No

ChatGPT isn’t trained well enough on Xojo specific needs to be useful answering questions you don’t already know to find the answer for.

I continually check in to see if it gets any better. Recently, I gave it a chance to assist writing a Windows declare. It provided a declare to execute a Shell command to perform the task I asked it to do natively without Shell. :man_facepalming:

It can be fun to toy with (and can even be useful sometimes) but it is not a good learning tool for Xojo at this time.

4 Likes

Hope springs eternal. It is so easy to ask ChatGPT; it is easier than querying the Documentation.

To reiterate what you (and others above) have said, I offer a recent example of the problems of succumbing to this temptation.

I had forgot in my own mind the order of the opening event Window vs the Controls inside. So I asked the latest version of ChatGPT (ChatGPT4-o)

ChatGPT confidently gives the wrong answer. I include the exchange below.


In Xojo does the window opening method run before or after the opening methods of controls?

In Xojo, the Opening event of the window runs before the Opening events of the controls contained within the window. This means that when a window is being opened, its Opening event is triggered first, followed by the Opening events of its child controls.

Here’s a brief outline of the sequence of events when a window is opened:

  1. Window Opening Event:

The window’s Opening event is triggered first. This is where you can initialize properties and perform setup tasks that might affect the controls within the window.

  1. Controls’ Opening Events:

After the window’s Opening event has finished, the Opening events of the controls within the window are triggered. Each control’s Opening event is executed in the order the controls were added to the window.


From the Documentation:

Opening

The window is opening but hasn’t been displayed yet. Controls also receive Opening events. A window receives its Opening event after all of the controls have received their Opening events.


I hope that there will come a time that we will be able to ask questions of the Xojo Documentation in the easy way of ChatGPT.

First off, you have to make sure you tell it you’re using Xojo API 2.0. Tell it you’re using a DesktopListBox. Then if in doubt, copy and paste the entire page from documentation.xojo.com for the DesktopListbox into the prompt following your question.

Here’s a query I might give it:

I’m writing code in Xojo API 2.0. I would like to change the text formatting in my cells in a DesktopListBox in column 2 and row 4. Please write me a sample method that will populate an empty DesktopListbox with data and change the font as specified to Times New Roman in red. For your reference, here is the documentation for DesktopListBox:

—paste docs here—

Most of the time it will get you most of the way there. It loves to use the old .Append instead of .Add to create a new array element, look out for that one. It also mixes up 0 and 1 based string functions fairly often, so double check that as well.

Edit: In this particular instance, the DesktopListbox docs were too long to paste in one go. So here’s what I did: First chat:

I’m writing code in Xojo API 2.0. I’m going to paste you the documentation for the Xojo DesktopListbox class in two halves. Don’t do anything het, here’s the first half, just confirm your receipt and understanding:
—paste here—

It replies:

I have received and understood the first half of the documentation for the Xojo DesktopListBox class. Please proceed with the second half.

I continue:

Below is the rest of the documentation for DesktopListBox. I would like to change the text formatting in my cells in a DesktopListBox in column 2 and row 4. Please write me sample code that will populate an empty DesktopListbox with data and change the font as specified to Times New Roman in red.

—paste here—

It proceeds to tell me to create a DesktopListBox called listBox1 and use the following two methods:

Sub Opening() Handles Opening
  listBox1.ColumnCount = 3
  listBox1.HasHeader = True
  listBox1.HeaderAt(0) = "Column 1"
  listBox1.HeaderAt(1) = "Column 2"
  listBox1.HeaderAt(2) = "Column 3"
  
  // Populating the ListBox with some sample data
  For i As Integer = 0 To 10
    listBox1.AddRow("Row " + i.ToString)
    listBox1.CellTextAt(listBox1.LastAddedRowIndex, 1) = "Data in Column 2, Row " + i.ToString
    listBox1.CellTextAt(listBox1.LastAddedRowIndex, 2) = "Data in Column 3, Row " + i.ToString
  Next
End Sub

Function PaintCellText(g as Graphics, row as Integer, column as Integer, x as Integer, y as Integer) Handles PaintCellText as Boolean
  // Changing the font in cell (row 4, column 2) to Times New Roman in red
  
  If row = 4 And column = 1 Then
    g.FontName = "Times New Roman"
    g.FontSize = 12
    g.DrawingColor = Color.Red
    g.DrawText(listBox1.CellTextAt(row, column), x, y)
    Return True
  End If
  Return False
End Function

These work, but they only change the color/font in Row4 Col2, not the entire Column 2 and entire Row 4 as I had anticipated. So it got me most of the way there, but I have to adjust the logic a bit. Also it technically changed column 1, again mixing up the 0 and 1 base.

1 Like

At times like this, it annoys me that Xojo Inc. doesn’t have enough resources to actually keep up with the times. I think we are all sure that Xojo Inc. will not implement LLM’s support in the IDE until it is already an old hand for everyone else…


Since I understand that Xojo Inc. can’t do anything else in this situation, I think it’s all the more important to invest more resources in providing interfaces through which external providers can provide extensions for the IDE. So that the community can find an adequate solution itself.

1 Like

in the cell paint events you can custom draw whatever you need.
very useful is also the row.tag or cell.tag where you can store something.

i did use it for some declares on windows and it did the job eventually but i used the paid version, as the free version is complete nightmare, I guess it would help a lot if XOJO could provide let’s say the xojo docs in a format that could be used to train this and i guess it would do a pretty good job. I don’t trust it but most of the times it provides a working solution and faster than loosing time on forums or searching on the internet. Just keep in mind that the free version has very outdated knowledge about XOJO , paid one with a proper config and with a nice XOJO agent let’s say it does. the job nicely.

1 Like

I’m good with keeping AI out of my IDE, I’d rather not lose my private personal work and have some corp scanning everything I write to reuse somewhere else. If you want LLM help, get an LLM.
They are everywhere now, not sure why every app needs to be integrated into the data mine.

If they do make an integrated tool, I seriously hope it is a plugin I can remove or I think I would leave.

1 Like

Why do you think they’d use your Code to train their LLM for public use? I’d assume such a training would be an opt-in/-out feature.

Local LLM’s need a machine with Horsepower and Memory. Something my Mx Airbooks do not have. :wink:

Because that’s exactly what Microsoft did to train Copilot. It stole from any project posted on Github regardless of license, and there’s no guarantee it didn’t use private repositories.

1 Like

There are quite a few free online LLMs, copilot built into any IDE isn’t a local LLM… It communicates with an API.

I know of very few LLM projects with true opt in/out.

I understand. And of course it is not OK to train the LLM with data without the consent of the authors.

But without our source codes and instructions, an LLM doesn’t know what to do with the programming language. The LLM has to be trained with something. And I’m happy to make my code available for this if I can expect really helpful support from the LLM in return.

But I completely understand the objections and support the demand for more transparency in the training of these LLMs and that information should only be used with the consent of the rights holders.

There was an event lately, in Germany, where Geoff was talking about that. None of you read the report nor watch the videos ?

I have… :unamused:

https://www.youtube.com/watch?v=fEkFrspP9oM&t=3781s :+1:

1 Like

They take much more than what you willingly give. TOS are rapidly changing to allow LLMs to look at and learn from everything.

Adobe- Total access and rights to redistribute, alter claim and sub-license your work for their profit under AI in their software
Microsoft- Github abuse, copilot+PC recording every second of your computer use (stored locally until everyone accepts it then it’ll move to the cloud with a more permissive license for their needs)

And the list goes on and is growing daily it feels like. Don’t let convenience be more important and cost your total privacy and ability to do anything in the future without an LLM taking its cut first.

I hate the meme but “You will own nothing and be happy” is a scary possible future now.

1 Like