Use what instead of Deprecated GTK CList? - gtk

I'm just learning GTK (I'm using C) and I see from https://developer.gnome.org/gtk2/2.24/GtkCList.html#GtkCList-struct that "GtkCList is deprecated and should not be used in newly-written code", but I can't seem to find what should be used instead. Can someone point me in the right direction?

On top of that same page, you have a "description" section where you may read:
GtkCList has been deprecated since GTK+ 2.0 and should not be used in
newly written code. Use GtkTreeView instead.
There's a navigation bar on top which easily allows you to access specific sections of the documentation of the class.

Related

How to make window centered in GTK4?

In GTK3 there was a property on the Gtk.Window class called window-position. By setting this property to Gtk.WindowPosition.CENTER it was possible to tell the window to render in the center of the screen.
In GTK4 this property has been removed. How to achieve the same behavior in GTK4, i.e. how to make the main window of my application to be rendered in the center of the screen?
I checked the migration guide but I couldn't find the solution.
There is no replacement API, since it can't possibly work cross-platform, so it is broken API by definition. As such, it was removed.
For example: this is impossible to implement when running on top of a Wayland session, since the protocol doesn't allow getting/setting global coordinates. If you still want to have something similar working, you'll have to call the specific platform API (for example, X11) for those platforms that you want to support.

How to add elements to Outline panel in custom extension?

I have a VS Code extension for ST language support. Right now it provides only syntax highlights and some snippets. I wanted to create a tree structure of the document showing programs, functions and their parameters in the Outline panel. But I cannot find an example of how to do that.
Can you refer me to the right direction but not to LSP as it is too complicated for now I want to make it programmatically.
The outline view is populated by a DocumentSymbolProvider (see also: registerDocumentSymbolProvider()). In the language server protocol, this corresponds to the textDocument/documentSymbol request.
All in all, it currently provides the data for all of these:
Outline view
Breadcrumbs
Go to Symbol in File
You can find an example implementation of one here, though you'll want it to return DocumentSymbol rather than SymbolInformation instances. Only the former supports the hierarchy needed for the outline view via it's children property.

What is LeftNav in material-ui?

I keep seeing references to a component called "LeftNav" in the material-ui react library (example: Material UI - Open LeftNav / Drawer on AppBar click), but I can't find anything about it in the documentation. What is it? How does it differ from Drawer? Why is it apparently undocumented, despite being hugely popular (at least judging by the number of questions I see about how to use it)? What is its toggle() method for, and is there a similar method for Drawer (the documentation suggests not, but for all I would know by reading the documentation there was no such component as LeftNav at all, so I don't think the documentation can really be trusted here)?
<LeftNav/> is the same as <Drawer/>. The name was changed from "LeftNav" to "Drawer" with the release of material-UI version 0.15. Take a look at the change log here and you will see this.

Is there a manual/list of special Gtk CSS properties?

I'm trying to redesign some Gtk3 widgets in my application (like scrollbars or paned) but was unable to set borders and other properties for paned specifically.
I then found some CSS data in /usr/share/themes/Adwaita/gtk-3.0/gtk.gresource, which use special Gtk properties like "-GtkPaned-handle-size", "-GtkCheckButton-indicator-size" etc.
These were not listed in DevHelp, nor was I able to find it on developer.gnome.org. I think such properties could be exactly what I need. Is there a listing of them with or without a possible description?
EDIT: I wouldn't mind too much searching for them in source code if it is the only way to find names of the properties. Could anyone point me to the right place where to look, please?
Thank you.
These are taken from the names of "style properties" - you can find them in Devhelp, in the sections below the regular properties.
The corresponding CSS property names are built like -ClassName-property-name; so -GtkPaned-handle-size would be the handle-size property of GtkPaned.
Note that style properties are going to be removed in GTK 4, and everything will be customizable by regular CSS properties.
Is there a listing of them with or without a possible description?
Run your program
open the inspector (Ctrl + shift + i)
How to enable GTK inspector
select the widget you're interested in.
From the combo-box, select CSS Nodes

ICEFaces: values for the "icon" attribute

I'm writing a menu bar made up of icons.
The easiest way, in my opinion, is relying on the icon attribute of the ace:menuItem component.
Unfortunately, I couldn't find, neither in the showcase nor in the documentation, a complete list of the built-in values allowed for that attribute (i.e. ui-icon, ui-icon-contact etc.).
Where could I find it? In case there isn't such a list, how could I work it out?
You can check the source of the page, then open theme.css
Have a look at:
http://jquery-ui.googlecode.com/svn/tags/1.6rc5/tests/static/icons.html