Sublime plugin how to write text in the background (not interactable) - sublimetext

I'm trying to write a plugin that will show text that is not user-interactable. In other words, the text is part of the background--visible but does not affect the text on screen. Is this possible?

If I understand what you're asking (which I'm not sure I do), then no, this is not possible using the ST3 public beta. You can set a view to be read-only using the set_read_only() method of sublime.View, but that only disables editing of the view's contents - users can still select and copy any text present.
Alternatively, if you're using the ST3 dev builds and Build 3072 or later, you can use the new tooltip API to create a popup. It is my understanding (I haven't played around with it on all platforms yet) that text in a tooltip cannot be selected, at least on Windows.

Related

Prevent manual scrolling to the "preselected" folder being required when using `TSelectDirectoryDialog`

When I'm setting the InitialDir property of TSelectDirectoryDialog the folder will be "selected" but I still have to scroll to it if it's below the currently visible area.
Is there a way I can make TSelectDirectoryDialog not to start at the beginning? Or is it possible to use a different dialog to select an existing folder the behaves the way I'm looking for?
Currently I'm using it on a Windows 7 64bit system.
For me (Laz 1.8.4, Win 10) the TSelectDirectorydialog immediately goes to the InitialDir by default. The dialog looks like a FileOpen dialog, though. If you prefer the old dialog with the treeview alone you should turn the option ofOldStyleDialog ON and ofEnableSizing OFF (the latter is due to a bug in Windows).

Setting Default Keyboard Layout for Electron Application on Windows (Unable to copy UTF-8 text propely)

We have this problem where a Farsi UTF-8 text that is programmatically copied from an electron application, loses encoding when pasted into one specific application and is displayed as a set of ? characters. The issue persists even with manual text selection and copy command invoked via either context menu or Ctrl+C. Texts copied from other sources such as browsers or text editors are transferred just fine.
We tried clipboard API of electron. We also implemented our own helper to verify the issue is not with the clipboard itself.
We also prepended the text with UTF-8 BOM character before writing it to the clipboard.
One interesting observation was that once the text is pasted into some text editor and then recopied, target app received the text properly. We also noticed that changing the keyboard layout to target language when the electron app is focused, resolves the issue as well. In addition, we realized that Windows changes default keyboard layout to English when the application is launched.
Following on these clues, we configured NSIS bundler to set the default language to Persian so that maybe Windows detects it as default keyboard language as well. Description of the application shows Persian as the language but Windows does not respect it and reverts the language to system default upon launch.
We tried running a script on application startup to mimic a Farsi character keyboard input, creating temporary input fields, and a set of other hacks to maybe trick the Windows/application into properly handling these texts. Keep in mind we can't rely on user to perform idiotic actions on every application launch, to fix a problem that shouldn't exist in first place. That's why we need this issue to be resolved programmatically.
Right now the only solution that comes to mind is to force Windows to set the keyboard layout for our application to Persian via registry entries by some separate script that user need to run only once, or can be run after each installation. I'm not familiar with the windows registry entries. My searches came up empty and the results were focused on how to do it for the whole system, but we don't wanna mess with their whole system configurations since.
Any other suggestions regarding this issue is highly appreciated.
Other information that you might find relevant:
OS is Windows 7.
Target app is an accounting software and the vendor rejects to provide any support with the integration, so I have very little information about inner workings of that application.
html lang attribute of electron template is set to fa.
meta charset attribute is set to utf-8.
Application is bundled with electron-builder and NSIS.

Making a label selectable in wxHaskell

I am writing a utility application in wxHaskell, and the users of this application will frequently need to copy-and-paste from the output of the application into other programs on their computer. The output of the program is fundamentally textual, and is displayed in a staticText widget.
How can I make it possible for the user to select the text in this staticText control? I can't find any attributes for making non-editable text selectable in the wxHaskell documentation.

How to connect multiple windows in gtk+?

I have created a window in gtk+ .in this window i am displaying some text and have button"next" through which i want to move to next window and my previous window should disappear.my new window should display something say,text.
Can someone tell me how to implement this?
I am new to gtk+.
It seems you want to use GtkAssistant, which is a widget precisely for the kind of interaction you are looking for. Run gtk-demo in your system to check the example with the code. It is likely you have it installed.
Also, you can check the code online in Gtk+ repository. (Check the version you want to view, either for GTK+2 or GTK+3).

Disable substitution in Lion

My Cocoa application uses NSTextView. It is sort of an editor application. Now in 10.6 there is character substitution so (c) becomes copyright. My application was not doing the substitution in 10.6. And I did not add any additional code for that. But in 10.7 the substitution is taking place. This is causing confusion to clients who have just migrated to lion. I know that I can write an applescript to disable the checkbox in language and text. But is there any other option ?.
I also tried
defaults write -g WebAutomaticDashSubstitutionEnabled -bool false.
but this also did not work.
In Cocoa, the substitutions feature is called “automatic text replacement”. To disable it in an NSTextView, send the text view a setAutomaticTextReplacementEnabled: message.
You should consider whether it's really appropriate to disable that in your application, though. If your editor is intended to be used on code or data files, then yes, you probably should disable it. If it's for editing text files, however, it's probably better to leave it set to the default and let users discover the feature on their own (and turn it off themselves if they don't want it). If your application is a text editor that may be used on text or code, you can probably set it based on what format the file is in—for example, enable it for Markdown but disable it for Python.
The WebAutomaticDashSubstitutionEnabled preference is not relevant because, as its name says, it's a WebKit feature. NSTextView is part of AppKit and does not use WebKit. Also, automatic dash substitution, which is supported in NSTextView as well, is a different feature.

Resources