Sublime Forum

Problem using panel_output command

#1

I’m trying to use the command panel_output

This is the full code

class MyClass:
    def __init__(self, window, text):
        self.name = 'Output Panel '
        self.window, self.view = find_in_opend_view(self.name)
        if self.view is None:
            self.window = window
            self.view = self.window.new_file()
            self.view.set_name(self.name)
        self.view.run_command('toggle_setting', {'setting': 'word_wrap'})
        self.view.set_scratch(True)
        self.window.focus_view(self.view)
        self.view.set_read_only(False)
        self.view.run_command('panel_output', {'text': text})
        self.view.set_read_only(True)

MyClass(self.windows, 'Test Text')

But when I run the code, the new window opens, but I can’t see the text, what I’m doing wrong? there is someone who has used this option?

0 Likes

#2

Can you point to a source for where you found this panel_output command? I have never heard of it.

0 Likes

#3

In this plugin to develop with Arduino boards, it is used to show the data of the serial monitor:

https://github.com/Robot-Will/Stino/tree/new-stino

0 Likes

#4

I figured it would be something by a third party, and I was right:

You will need to have the Stino package installed in order to be able to use this command.

Fortunately, Sublime Text 3 provides the append command by default, which does the same thing. The parameter is named "characters", just like for the insert command.
I don’t know which build it was introduced in exactly, but it wasn’t recent.

0 Likes

#5

@FichteFoll I didn’t saw it, I feel fool xD

I’ve used the append command:

run_command("append", {"characters": text})

Thanks for the help, I needed!

0 Likes