How to show the toolbar only in certain modes? - emacs

Is it possible to toolbar only when certain modes are used for the current buffer?
What I am aiming at is have the toolbar only active when gdb-gud or newsticker are running,
so that a quick interaction with it is possible. As soon as e.g. newsticker is closed, the toolbar-mode should be disabled.
Is there a general way to achieve this behavior, or do I have to write something myself?

tool-bar-mode is a global mode. You can of course turn it on or off on a mode hook, but it affects all buffers in all frames.
As #legoscia mentioned, you can make the tool bar frame-specific. tool-bar-here-mode makes this easier (togglable). It is in library tool-bar+.el
I don't think you can easily limit use of the tool bar to a particular mode.
However, you can make showing the tool bar be on-demand when you click Buttons in the menu bar. This saves screen real estate: Show the tool bar temporarily, for the space of a single use.
This is available with tool-bar-popup-mode, which is also in library tool-bar+.el.
Screenshots and description.

Related

what is the name of the very bottom of the eclipse window? I want to turn it off but can't until I know what its called

I like to keep as much of my Eclipse screen as possible for code. So I try to disable or turn off as many of the extra bars and such as possible. The area at the very bottom of the Eclipse screen is my next target but I don't know what it's called.
Can anyone tell me the name of this area and how to reclaim it? Thanks.
Here is an eclipse plug-in which hides/shows Menu bar and/or Status bar.
User can change these options in Windows > Preferences > Full Screen
But Hiding Status bar was NOT working on my machine
Ubuntu 13.10 Eclipse Version: Kepler Release Build id: 20130614-0229
This are is called the Status Line but it composed of a number of different components such as the progress indicator, editor current line and row, and the message area.
I am not aware of anything that will turn it all off.
I can see why you're eager to close that. It looks like your screen resolution is extremely low. Are you using a netbook perhaps?
Here's the problem though: On your screen, that part looks quite large and looks empty but it's because of your screen size. I'm fairly certain it doesn't have a name and having scoured the options, I'm convinced it can't be removed. On my screen, that section contains only a few words: "Writable | Smart Insert | 423:32"
Essentially, the words that show up there are a guide for your current editing mode and location in the file. I don't think it can be turned off. If you hit Ctrl + M, it will hide almost everything possible on maximize your editor view.
On my screen, that little bar is very small. That is of course because I have a high screen resolution. If possible, try increasing the resolution on your screen to something more appropriate. You'll find you have a lot more space to code, and that little bar will become much smaller.
In eclipse oxygen there is option to hide status bar:
Windows->Appearance->Hide_status_bar

Let a window display above a fullscreen window in GTK+

I have a full-screen window (winA) and another window (winB) which is always on top.
Now I need to let winB display above winA, while winA is still above any other windows.
How to do this in GTK+? Thanks. (Maybe this needs Xlib?)
PS1: I won't use POPUP windows because it will put all the windows under it. I just need put winB on winA but not all the others. For example, if I am watching videos in the fullscreen mode, I wouldn't like to see winB. But if winA it's here, winB is just above it.
PS2: winA & winB are in the same program. In this case, it may simplify the solution.
The main way to tell the window manager to keep winB above winA is through the "transient for" hint, set in GTK+ with gtk_window_set_transient_for().
If your window is not a dialog, the behavior may not come out quite how you'd like; you could try setting a semantic hint with gtk_window_set_type_hint() and see if that gets you anywhere.
But the behavior is basically going to vary with window manager (which is intended). So you kind of need to just live with that and assume people will use a WM that works how they want it to.

How to highlight current method body in Eclipse?

There is a nice feature called "show selected element only" in Eclipse. When it's turned on, clicking on a method in the outline pane will show just this method only in the editor, allowing to focus on this one only, especially useful in that you don't need to worry about scrolling hard and overshooting this method when there are many nested parenthesis inside.
But sometimes I would like to have a glance of more codes around here, so have to turn this off, then back, time and time again, which is quite inconvenient. So I wonder if there is a better mechanism?
I know a built-in feature called "range indicator" (http://stackoverflow.com/questions/7049098/how-to-forbid-eclipse-to-highlight-current-method-class-in-the-margin) , but I always tend to overlook that because it's too thin.
One better solution I can imagine is using distinguished background color for currently investigated method body, and when move cursor to other methods, background highlight turn to them accordingly (works like the range indicator, but renders more obviously). In this way, both navigation flexibility and reading assistance are gained.
Is this solution possible?
Take a look at the Editbox plugin.
You might have to do a bit of tweaking to the colors to set it up. Here is a sample screenshot :
Is this what you wanted ?
Yes, with editbox and the following settings may suit your need.

App preferences in Settings.app

I'm trying to achieve something similar to the "Clear History" and "Clear Cookies" cells in my apps settings (see screenshot):
I already have a few settings implemented that use toggle switches and Multi Value options.
When I edit my Root.plist the only options for an item are group, multi value, slider, text field, title & toggle switch. I'm pretty much trying to replicate the "Clear History" (ie press it once and clear an array), it doesn't store any settings or preferences, it's a one off event.
I hope that makes sense. How is this achieved?
Thanks for your help.
There is no way to do this (yet), so you'll have to find another solution.
You could simply use a switch and check it every time your app is started for this purpose and resetting the switch programmatically (since iOS4) :)
Unfortunately you can't do this. Apple have not exposed (or at least documented) the functionality. You'll either have to find some other way doing it (a toggle that causes the reset the next time the program is launched?) or just have the button in the app itself.

Eclipse RCP Splash Screen

I'm involved in a project that is attempting to use the Eclipse RCP splash screen to gather user credentials, language, etc. If this screen loses focus, it is not available (under Windows at least) through the ALt-Tab functionality, and can only be found by minimizing all other windows and uncovering it. Any way of having this screen allow itself to be activated in this way? They're avoiding creating an intermediate screen, for reasons unknown at this point.
I think it might be time to examine those unknown reasons. Even eclipse doesn't use the splash screen in this way. If it needs to prompt for information, it opens a new dialog to ask for it.
Good luck.
[Edit] I stand corrected. This thread seems to have a solution to this. Good luck, I'm no SWT/RCP guru.
See this page. From one of the comments:
The splash screen window is created natively with the extended window style WS_EX_TOOLWINDOW which makes it not appear in the task bar. This corresponds to the SWT constant SWT.TOOL.
I don't know if it's possible to change the window style after it is created on Windows. You can always drop down to JNI if that's necessary.
Create your own implementation of AbstractSplashHandler.
When creating the shell, don't use the SWT.TOOL style.
The shell will be accessible through the windows task bar.