can gtk drawing area be styled with css? - gtk

I want to add a box-shadow to a gtk drawing area. As of now, I can't find a direct way to do so. The only way is to add the drawing area in a gtk box and then style the box accordingly. I would like to know if there is a css node for gtk drawing area.

Related

How do i create a scrollable mask on a static image in Unity?

Lets say i have a canvas with a panel containing a plain white image.
Hidden by mentioned panel, there is a panel with a coloured image on it.
Now lets take a scrollrect, fill it with some smaller panels as content, add a mask to each of those, and put the scrollrect in a panel on top of the plain white panel.
How could i make these scrollable small panels mask out the white panel and show the coloured panel below while the white panel and coloured panel are static and don't move?
I am well aware of the fact, that the white panel and coloured panel would have to be children of the mask component, and that's the problem, because then they would scroll along.
I searched the web a bit, but could only find stuff related to scrollrect viewport masking but not putting masks in a scrollrect.
EDIT: One way would be to directly mask the coloured panel by using each of the small panels as masks and make the coloured panel scroll inside each small panel by *-1 to counter the parent scroll, but that seems like a bad solution
Thanks for any kind of advice <.<
Use a mask or better yet a rect mask 2d. You add this component to a parent, and all of the children get masked based on its ‘rect transform’ which will show up in the top right of the editor on applicable UI elements. Also you can toggle the gizmo on and off to view a green outline.
https://docs.unity3d.com/Packages/com.unity.ugui#1.0/manual/script-RectMask2D.html
Combing rect mask 2d with scroll rect can give you some powerful results and definitely accomplish what you need.
https://docs.unity3d.com/Packages/com.unity.ugui#1.0/manual/script-ScrollRect.html

Drawing borders around a group of components in Matlab Appdesigner

I am using Matlab 2019b Appdesigner.
I have an app with many buttons, user input boxes etc and for making the navigation easier, I want to draw borders around a group of components which are under the same functionality. How can I do this?
Edit: Thanks to Rotem, I see that I can use the Panel Container for this. But is there a way to change the color or width of the border. I see only option to do it if it was created with GUIDE, but not Appdesigner.

Scrolling of text using cairo

How to make text scrollable (horizontal and vertical) using Cairo library?
Are there any cairo API which provide scrolling functionality without the use of gtk library?
Cairo only draws things. It has nothing to do with user interaction and thus the whole question does not really make sense, sorry.
Of course you can draw text with cairo at whatever position you want. Thus, to make text scroll you just have to redraw your text based on user input and use a slightly different position each time.

Gtk+: How to Draw Custom Window Borders Like Chrome or Steam

I was wondering if it would be possible to draw (ie design) window frames with Cairo in Gtk, so that the Cairo API could be used to decorate the surface such as adding gradients.
How would I tone down GTK decorations and redesign them with something like Cairo?
Normally on Linux window decorations (borders, title bar, close and minimize buttons etc) are drawn by Window Manager, which helps to maintain similar look and behavior amongst different windows.
However, application may signal to window manager that it wants to disable decorations provided by window manager and draw their own. In Gtk+, that can be achieved by calling gtk_window_set_decorated on GtkWindow, and then using Cairo to draw own borders.
You would have to write a window manager. An example of a window manager (now obsolescent) that used GTK and Cairo to draw its window decorations was Metacity.

PyGtk draw mark over scrollbar

Is there any way to draw some marks "over" a scrollbar in PyGtk as done, for example, in Chrome with the search results?
I found some help in this FAQ but I still need to place a drawing area over the scrollbar which is, in fact, part of a scrolledwindow...
Any idea?
You don't need to put a drawing area on the scrollbar - just do your drawing in the do_expose_event handler.