Oh I replied to this comment here Redefine the SelectTool cursor
Yes. You need to set self.keyboardShortcut
in the setting method of you plugin. It was missing in the plugin example.
Hey Georg, that wasnât the question Iâll post it here
Also anyone have any idea why the color changes from purple to red depending on how far Iâm zoomed in, it should be red all the time, the RGBs are (0.5, 0, 0, 0.4)
Same with any colors defined like this, itâs always somehow offâŠ
Edit, actually might be hardware problem? Screen recorder is showing it the right color, but the red is rendering as purple up until a certain zoom before it becomes red, and the green, is more blue before becoming green at a certain zoom. It seems as if thereâs too much blue somehow?
That sounds indeed like a hardware problem. Try a different color profile in display settings.
How can I set the cursor in a reporter plugin? I just donât really understand which graphicView is what. I tried to set it to the activeEditViewController().contentView(), its enclosingScrollView(), the contentView(), etc. In which ever view I try to print the default cursor, I just get None, which tells me that I am not looking in the correct view.
Once I know which view I need, I can do the rest myself. Or if it needs to be set to the documentCursor, then how, please? This doesnât do anything in a reporter:
def standardCursor(self):
return NSCursor.crosshairCursor()
this should work. what view is not important, you just need to get to the right scrollview.
activeEditViewController.contentView().enclosingScrollView().setDocumentCursor_(cursor)
Okay, thank you! Since you confirmed what I already had, I tried again in another spot where it indeed works. It just does nothing inside of my MOUSEMOVED
notification (even though the notification is intact). So I just try to fire the cursor change in a different way then. Thank you @GeorgSeifert
Glyphs set the cursor in the mouseMove method itself. So you change seems to come first. You could try to delay the setting through `performSelector_withObject_afterDelay_(âsetCursor_â, cursor, 0.0)```
this will run the code in the next run loop. But that might result in a great flicker.
It seems that I need to add an API for it.
This sounds also cool.
What I did and what works is a toggle variable. Inside of the mousemoved I got another condition. This one sets the toggler to true, and in the foreground method I ask for this togglerâs state. No flickering and it seems to not slow anything down.
Iâll play around with your suggestion, too. But donât rush with implementing it, I got it working. Thank you again! Youâre the best.
I wonder how to keep the select tool behaviour when making a custom Glyphs Tool Plugin in objective-c
I manage to draw and get the mouse events, as well as having the temp tool. but what I cannot figure out is
a) How to be able to select and move elements with the own tool active?
b) how to keep the drawing when the temp tool is acitve (e.g. command key).
Somehow I want it to behave like a reporter, but since I got dragging operations, I really hate that I cannot override the selection marquee rect there.
Again, some little bricks that I need to fully understand the API in obj-c, soon Iâll shut my mouth. Iâm already pretty far into it
You might have a look at the plugins.py file from the wrapper. There you see all the API you need to have. And there are some protocols in the core docs that should have all the pieces.
Looks like there is nothing that I havenât already seen in the Xcode templates and by clicking myself through the definitions of the methods and types there
I donât understand. I started a Select Tool from a template and it doesnât do any selection at all. After digging the forum and some python plugins I saw the selectAtPoint_withModifier_
, selectInRect_withModifier_
, drawSelection
and similar methods, but all one can read here about them is that you need to override them if you donât want them to do their job. But I just want them to work, as well as the usual path operations. It seems that the Select Tool disables everything the user do with the layer.
*) working in objective-c, so I tried to apply/call/override the methods mentioned above not in python syntax, of course