Edit: Looks like im_append_menuitems is not the function to get a popup menu. Vte inherits from Gtk.Widget so the way to get a menu is probably to connect to a right mouse click and generate a custom menu. I will look into this and if it works that will be the answer.
I'm using gtk3 with python.
When opening a vte window created in python gtk I can do all the normal things one would expect from a terminal except right click for a dropdown menu.
In the C documentation there's vte_terminal_im_append_menuitems ().
I haven't tried it yet because it requires a GtkMenuShell and I've only used GtkMenu. So I might have trouble using it.
The documentation isn't the best for edge cases, and I'm using python which doesn't always have the bindings made right. Some of the abstract gtk classes I've tried in python have given me trouble too.
I'm wondering if there is an easier way than GtkMenuShell.
If not an example of GtkMenuShell would help.
In the meantime I'm going to try to do it on my own. If I come up with the code soon I'll post it as an answer.
Related
This is kind of a random question, but in Textmate, there was a really nice feature. You could highlight a URL, press a keyboard shortcut, and it would automatically create for you.
I just searched tirelessly for about a half hour trying to find a similar package that would do it, but I can't seem to think of what search term to even look for. Anyone know off the top of their head a package that does this? I really loved that feature; it would hit the other website, grab the title attribute, and drop it in for you.
Any advice would be much appreciated!
I don't think you can do that easily with standard sublime abilities. But I've found a package that is inspired by Textmate and it's called HyperlinkHelper.
Simply install via PackageControl, restart sublime and you are ready to go. The default keyboard shortcut for generating a hyperlink out of the current selection is STRG+ALT+L. Tested it in sublime 2 and works perfectly.
I am creating a windows using win32:
HWND mainWnd = CreateWindow(...);
Now I can add gui elements as children of mainWnd. However this soon becomes a bit tedious and I want to use the designer built into Visual Studio to help me.
I noticed that under Add Resource there is a Dialog entry. Among the dialogs IDD_FORMVIEW seems the most general so I added one of these. Next I added gui elements to it using the designer.
Now I want to use this as a child of my mainWnd. How do I do this?
I found some examples using DialogBox, but I do not want a separate dialog, I want this window as a child of my mainWnd.
The designer in Visual Studio is appropriate for creating dialog boxes, not arbitrary windows.
That being said, there are a couple of approaches (in increasing order of difficulty):
Make your main window a dialog. Petzold's book has an example of using a dialog as the main window of the program. (If I recall correctly, it's the calculator example.)
Create the dialog and, before you show it, change its style to WS_CHILD, change its extended style to WS_EX_CONTROLPARENT, and parent it to your main window. For all the navigation stuff to work, you'll have to add IsDialogMessage calls in your message pump. This is do-able, but it's likely hard to get everything working well.
A mixture of 1 and 2 where you create one dialog for your main window, then create a second dialog for the content (with DS_CONTROL), and put the second dialog in the first. I've never tried this approach myself, but it seems like it should work.
Write your own code to parse the dialog resource and create the child windows, which is basically re-doing a lot of the work that CreateDialog does for you.
Given your desire to use the GUI to design the UI, I suspect only the first solution is simple enough that you would be interested.
Use the CreateDialog API to create the window from the resource. If you do not want it to look like a dialog then remove the titlebar style from the resource properties.
To use a dialog created from a dialog resource template you have to specify the DS_CONTROL window style in the template.
Read more about dialog boxes here.
Dialog resources are explained here
I am working on a Lua file. I have some methods in it. I wanted to know if its possible to configure Textmate to show the list of methods inside a file and a way to quickly reach the first line of a method by choosing a method from that list. I do have Lua and Corona specific Textmate bundle installed for syntax highlighting Lua and Corona APIs.
what a bummer. Found the answer. Its in the bottom pane of Textmate window. Next to tab size.
A quick shortcut would be to ⇧⌘T or go to Navigate -> Go to Symbol.
I just started using the QT Creator but there's some stuff that really annoys me...
I like that i can show the coding window and the context help window next to each other.
But the shortcut for showing the context help for the currently selected Symbol is F1, which is just terrible as Mac-User #_#
Now it would be nice if I could either put in on alt+"left mouse button".
What would be even better is, if i select a word with the mouse and it's a QT-Object like QSlider, to automatically change the content of the help window to the selected word.
Any help on that matter? :/
Yes, you can customise the Keyboard short-cuts in Qt Creator:
Open the Options dialog (on Windows, it's via Tools->Options - I presume it'll be somewhere different on a Mca)
In the Environment page, select the Keyboard tab.
Scroll down to the Help section, and change the setting on the Context command from F1 to whatever you want it to be.
This should go some way to making it easier for you to use.
Edit
If you want to make wider changes, you could always import a .kms QtCreator keyboard definitions file that someone else has created. For example, searching for 'qt creator kms' points to:
TextMate key mapping scheme for Qt Creator
XCode Keyboard Mapping for Qt Creator
Is there anything like the input manager for TextMate (at the very end of the page) which allows to edit from any Cocoa text edit controls in TextMate? It basically installs a menu "Edit in TextMate...". I tried to search for it, but I have not find anything. I think it would be very nice to have such a feature.
Thanks.
I haven't tried it (I keep meaning to), but QuickCursor is supposed to do that (for any editor, not just Emacs).
As noted in the comment, this requires ODB support, for which EditorClient can be used.
Aquamacs just added ODB support. You should be able to try it in a nightly build.
I don't know of one, but it should be fairly straightforward to hack one. You'd simply want to call emacslient with the path.