What libraries should I use for a Linux desktop panel? - gtk

I'm thinking about making a panel for Linux, that would include window list, menu, clock etc. My 2 requirenments are:
It should fit into MATE (Gnome 2 fork) and possibly Gnome 3 2D mode.
It should have smooth animations (for drag & drop window button reordering like tabs in Chrome).
What libraries should I use? GTK+ / Cairo / Clutter / something else?

You can start checking libgnome-panel (probably renamed to libmate-panel). The gnome-panel is built on top of that and libgnome-panel provides what is necessary to build applets (like the window list, etc.).
Each applet has its own dependencies, for instance, for window lists you will need libwcnk, for clock you might need cairo. For a panel with smooth animations, you might need clutter (that is OpenGL), however, that might not fit with the 2D you are looking for.

Related

Moving (repositioning) a Child Window or Dialog in Gtk / Gtkmm

A child Gtk::Window or Gtk::Dialog may be moved around by dragging on the title bar. Being top level windows this activity requires support from the window manager. What is the mechanism by which Gtk requests the window manager to move the position of the window?
Background
I have a Gtk application running on a custom Linux distribution (based on Yocto running Waland/Weston). The application is developed on Ubuntu 20 which has both X11 backend and Wayland backend. The child dialogs or windows that are spawned by the main window are perfectly centered on the main window (in Ubuntu on both backends). However on the target (with Weston) the dialogs or windows appear at random position. Now I understand that this is reported in several forums (like this one in stackoverflow itself).
Different Approach?
With what ever little I know I tried Gtk::Window::move, Gdk::Window::move and even dared to play with Wayland surfaces (gdk_wayland_window_set_transient_for_exported ) but with no avail.
That left me wondering how the user is able to move such child windows by grabbing the header bar (or title bar as Gtk::Window calls it) even under Weston. If I get to know how this works then perhaps I can emulate a grab-drag to position the window where ever I want.
I tried sifting through gtkwindow.c to find out what happens when one sets the title bar using the function gtk_window_set_titlebar but the rabbit hole went a little too deep.
It would be great if someone can point me in the right direction, at least quote some functions whose implementation I can study to get this working....
Your question consists of multiple smaller ones, so I'll try to give a shot at answering each and one of them.
The general idea is that Wayland is quite minimal, so to make it suitable for desktop use cases, you need a protocol extension. This extension is called XDG Shell.
A child Gtk::Window or Gtk::Dialog may be moved around by dragging on the title bar. Being top level windows this activity requires support from the window manager. What is the mechanism by which Gtk requests the window manager to move the position of the window?
This first part is described in the Wayland book, but the idea is that you forward an input event (usually a drag) back to the compositor, who will know what do with it. That might mean moving the window (or not moving it, if you've reached the edge of the screen.
However on the target (with Weston) the dialogs or windows appear at random position. Now I understand that this is reported in several forums (like this one in stackoverflow itself).
Note that your confusing 2 questions here: one is where to put a child window, compared to a parent window, while the second sentence here talks about position any toplevel window. There is also a section in the Wayland book on popups (part of XDG shell also) which also describe something similar.
So whether you can arbitrarily move windows: the answer is no.
The most important question then becomes: what can you do to solve your problems with Weston? It's hard to say without any kind of code. You might want to make sure you set the GtkDialog parent when constructing it (also known as the transient_for property. You might want to play around with the modal flag also. There might be other options too, but it's a bit of a blind guess.

Keybinding Wacom tablet control panel in windows

I'm looking for any help regarding changing a wacom tablet control panel option in Win 7. What i need to do;
I own a Wacom Tablet and I wish to change one of its options, "Tip Feel". This option controls how the pen works, set to "soft" it makes the pen require less pressure and acts like a felt tip or soft brush. Set to "firm" it makes the pen require lots of pressure and feels like a very hard pencil or technical pen.
Ultimately I would bind 3 keys to three different "tip feels" - soft, medium and firm
Below is the control panel interface and the option I'm interested in is highlighted in red
http://www.fuzzypiglet.com/crap/cp.jpg
Technically this would mean;
1. Opening the control panel
2. Selecting several options at the top (Tablet - Intuos4 L), (Tool - Grip pen), (Application - Painter 12 x64)
3. Changing the tip feel slider to "soft" (7 step option so maybe as a number "1")
4. Closing the control panel and restoring the Painter application
Is this software right for what I want to do? Ive no experience with programming at all apart from a bit of html.

How to develop interface like Eclipse using GTK?

I want a write a desktop application using GTKMM. I want the interface to be made of different panels like in Eclipse you have the Project Explorer, Console, Properties, etc. You should be able to drag the panels to change their position, close them and popout them (not sure if you can popout the panels in Eclipse but you can do it in Visual Studio).
I am using the word panels here as I am not sure what the right term is. I guess some call it dockable windows.
Any pointers on how this can be achieved in GTKMM?
The term is "docking" widgets and the GDL Library is the easiest way to get started with that. You may have seen GDL in action in applications like Anjuta and Inkscape. The documentation isn't that great, but, the source code includes a sample app and once you get going with it it's not that hard.
Basically, you add your widgets to a DockItem and those to a Dock. You put a DockBar somewhere in your application to which the docked items can be minimized. You can save and load the dock "layout" to XML files so that the user doesn't have to re-arrange the dock items every time they start the application.

netbeans gui panels don't stay where they are supposed to be

I am trying to create a java gui using netbeans but the swing panels that look great in the IDE are all over the place after I compile and run the program. what can be causing this?
NetBeans' Matisse GUI editor is not a WYSIWYG editor, even though it pretends to be one. The fundamental reason is the philosophy of Swing layout managers; there's no way to position the components to absolute positions, because the size of components vary with the platform as well as with the "look and feel".
In practice, it's best to code the layout by hand, using some third-party layout manager. MiGLayout is one of the best and amazingly easy to use.

How to wire up an editor to the location cursor icons?

I have built a graphical editor as an Eclipse plugin. Users may zoom into and pan about the graphical image.
I would like to employ the Back and Forward arrow icons in the Eclipse icon bar to step back and forth through the graphical image, in a similar manner to what is already possible in textual editors. All of my references go quiet on this subject
All clues or better references are most welcome.
M.
I think you need to define a RetargetAction
See an example at
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/rcp_actions.htm
(I haven't done this myself, but it sounds right...)
See also http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/guide/wrkAdv_retarget.htm