How to use the GtkHeaderBar in glade 3.20? - glade

I tried to do a GtkHeaderBar application with glade 3.20, but I have the oldschool bar on top every time, when creating my python app.
In glade 3.19, checking the client-side decoration property created a line on top, in which I could put the GtkHeaderBar. This is not the case in the latest version.
I tried to check/uncheck every property, I could not find the way to do this. That is very surprising, since this should be the default way to do a Gnome application.
I looked on the internet, but there is dramatically no documentation on gladeā€¦
After searching, it seems that I must add a GtkHeaderBar as child in the main window. But how, that is the mystery.

Create the window, set the "Client side window decorations" property to True. Next, get the HeaderBar widget from the toolbox and drop it on the top part of the window that just appeared:
And here you are, the header bar:

Ok, I found by myself a workaround:
We need to create the GtkHeaderBar apart, and after activating the client side decoration property, we close the project. Then, by editing the XML file, we put the header bar section into the titlebar section, instead of the placeholder xml tag. When we reopen the glade project, that's ok, the header bar is in the window.

Related

IntelliJ Plugin Development: LookupElement with class preview

For a custom language I created a CompletionContributor. Everything works fine. But I'm limited to the information I can display (only in the list or the bottom "advertisement" and only 1 line).
When trying to auto-complete on a java class name it will display more information on the selected line in a small side window. I would like to exploit that mechanism but I really don't know how it is done.
When looking at the options provided, I can use a custom LookupElementRenderer but there is no method in LookupElementPresentation related to the right window.
Any idea how it is done?
Are you referring to documentation popup which may be displayed if the corresponding setting (Setting->Editor->General->Code completion->Show the documentation popup in) is turned on?
If you want the feature to work for your language you have to use lang.documentationProvider extension point.

xcode 8.1 xib editing hang, text editor workaround?

So, since updating, the gui randomly hangs editing a xib file. The scenario goes like this:
click an object - i.e, array controller
expand a parameter, Filter Predicate here
Select target object in pull down
try to enter model key path - HANG
In different xib files, the hang comes when trying to enter the model key path textfield. I've also seen errors citing bogus fields like 'Hidden3' for some attribute bindings - only workaround was to remove them.
Has anyone ventured to editing the xml directly, but I guess I can do that in code :-(
Well, I know this is an old question, but I found an answer.
My situation was similar to the one described above: Xcode hanging whenever I edited the key path of any binding in Xcode 8.1. Nothing described here or elsewhere worked.
However, what did work was to edit the storyboard outside of the actual Xcode project: open the offending StoryBoard by itself, do not access it through the project.
This appears consistent with a Sample/Spindump through the Activity Monitor when Xcode hung that showed functions that appeared related to auto-completion/edition. Unchecking auto-completion did not work though (in Prefs).

How to reopen ViewPart?

I am working to make an Eclipse Plugin. I used a plugin project template that generated a View class which extends ViewPart. I think that it is part of SWT.
My problem is that the View is like a window inside of the main Frame which has buttons for close, minimize. I clicked on the X button of the View by mistake. Now I cannot make it visible again even if I relaunch the Eclipse Application.
Now, my Eclipse application looks like this:
It had some panels and buttons before. But I cannot make the View visible again. How should I make to bring it back? I have tried to delete the plugin project from Eclipse and import it again. But it did not work.
I bet that there it is an easy way to make the View visible again but I do not know how. Is there any setting through MANIFEST file? Or other file?
Specify the -clearPersistedState argument when you run the RCP (this assumes you are using Eclipse 4.x).
1) quick solution
restart workbench with clear workspace option checked under run configuration ..
2) Full Solution
you should add a menu in menu bar to open your view so that you can open your view when ever you want
create a command say openMyMenu
create a handler for it and call below code from handler execute method.
add that command to main menu bar..
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(<view ID>);

How to add a button to the main toolbar in Eclipse programmatically

I've a question. I cannot find the way, how to add buttons to main toolbar programmatically. My problem is, that I've the task to dynamically (based on XML configuration file) build menus and toolbar. I found how to add a menu item programmatically, but not toolbar button.
Tutorials mostly show how to create buttons and menus using plugin descriptor (plugin.xml), but not how to do it programatically. It seems, that it is out of bounds of Eclipse plugin philosophy.
I've just found this:
There might be layout problems with this approach. I also don't
believe the framework will try and re-create your dynamic item except
at random toolbarmanager updates. With Menus they can be updated on an
SWT.Show event, which is why CompoundContributionItem only applies to
Menus.
What shall I do? Can I say Sorry, there is no way to build toolbar dynamically. I can do it just for menus? Collegue says, that it must be possible, but he does neither know how.
The only way to be able to create main toolbar entries programmatically is in an RCP app, where you supply the ActionBarAdvisor for the workbench window. This isn't dynamic, however, just called on window creation.
Another way to do it would be to use org.eclipse.ui.menus and contribute org.eclipse.ui.menus.ExtensionContributionFactory. It also works only on workbench window creation (not really dynamic), but you could read your own XML and provide IContributionItems for the main menu or toolbar.
How dynamic are you trying to be? Most solutions work well on startup/window creation.
PW
Whenever you try to do something programmatically in Eclipse that is normally done through plugin definitions you are walking on thin ice. I've tried it on a few occasions and it rarely ended up being easy or good.
Instead, think of what it is that you only know at runtime and need to be able to change on the fly. Is it the name or icon of the button? That can be changed at runtime.
Take a look at runtime commands, they can be confusing to define properly, but with them you can for example create buttons that are only visible if a condition is active. That condition could be set at runtime.

Is there a way in Intellij IDEA to see the name of the method the current line belongs to?

In our code base there are a few very long methods (several pages worth of code). When reading the code, it would sometimes be good to be able to see the name of the method the current line belongs to, without paging up to the beginning of the method. Is this possible in Intellij IDEA? I am using Intellij IDEA 7.0.3.
You can use View | Context Info (Alt+Q, Ctrl+Shift+Q on Macs). It will display a pop-up on the top of the editor with the current context information (class/method signature).
IntelliJ 2018
This is shown by default at the bottom.
Unfortunately, the method is shown only by name (not including the parameters). If a method is overloaded you won't know for sure where you are.
If you want to move it from bottom to top, go to File > Settings... > Editor > General > Breadcrumbs > check Top:
In the structure panel select the "Autoscroll from source" option.
This way when you place the cursor inside any method the structure panel will show which method you're in.
Intellij now has support for breadcrumbs. Go to settings > appearance and tick "Show breadcrumbs". In this way you can view class/method name without Alt+Q.
For some reason (Alt-Q) wasn't consistent in Android Studio for me. I find (Ctrl-F12) to be pretty satisfactory for this purpose (Navigate|File Structure) though it can be a little laggy in larger files. And by pressing the hotkey again it will populate the list with all the inherited methods as well.