Author Topic: Updating an editor control  (Read 3051 times)

dorza

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Updating an editor control
« on: August 16, 2010, 01:34:53 pm »
Hi,

I have created a simple form which has only an editor control, basically I use it to show UNIX manuals in SlickEdit.
Next I created a new toolbar with the aforementioned form ( I dock it to the left where the project window is typically found).

The thing is, now I want to update this form whenever a I call a specific command, I have tried calling the show function within my command and update the form accordingly in the on_create event, but no success there.
I'm aware that since the form is already created there won't be another on_create event, so how can I update the form every time I run the specific command?

It's important to note that when the form wasn't attached to a tooblar and I've used show with the -new option It worked perfectly.

Thanks in advance,
Dor

Graeme

  • Senior Community Member
  • Posts: 2432
  • Hero Points: 322
Re: Updating an editor control
« Reply #1 on: August 24, 2010, 11:09:03 am »
Did you figure this out?  If all you're updating is the editor control, can't you just delete everything from the editor control and replace it with something else?

If you have the toolbar hidden and make it visible, does it get updated?

Graeme

dorza

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Updating an editor control
« Reply #2 on: August 25, 2010, 09:21:02 am »
Yes I did figured it out. My problem was updating the form after it was created when I call a certain command.

I did it using a global function (similar to the update function a lot of tool windows use), within this function I also call activate_toolbar().

Regarding the editor control, When I update it  I do delete everything (using delete_all()) before updating.

About hiding the tool window, I only update this window when I call a certain command so I don't expect it to update whenever it becomes visible. If I call the command while it's hidden then it becomes visible and gets updated.