Gtk buttons over a Gtk drawing area - c

i' working with Gtk developing some app. I must put some buttons over a map. I'm drawing the map on a GtkDrawingarea, but i'm not able to put buttons over it.
Any suggestion?
Thanks

Suggestions:
Put both the drawing area and the buttons inside a GtkFixed container. Probably not the best solution, because GtkFixed has no way of controlling the z-ordering (other than the order in which you add the widgets to it?)
Instead of using GtkDrawingArea, use a canvas widget that can include other widgets, such as GooCanvas.

Why no other library? Any specific reason?
There is a library for exactly what you want
http://geocanvas.sourceforge.net/

Related

Create a square progressBar with Transparent Background in React Native

Hello to All react Native developers!
I am new to React Native.
and i didn't know how to create a square Progress-Bar.
Is there any way to create a square Progress-Bar with transparent background in React Native?
my requirement is that, i want to create a progress-Bar around a QR Code, and you already know that the QR Code is Square.
Please! Any one help me.......
I think what you're going to want is to wrap the QR code with 2 separate layered Views and fill in the top layered one similar to the standard methods for circular progress bars using whatever your progress metric is to define the radius of the fill.
https://www.dottedsquirrel.com/circular-progress-css/#:~:text=Circular%20progress%20bars%20are%20a%20staple%20of%20web%20development.&text=While%20it's%20easy%20to%20cheat,bar%20with%20a%20percentage%20progression. is a good resource to show what I mean

is it possible to draw trapezoid with border radius in react native

Here is the actual shape I want to draw using maybe view style properties or are there any alternatives, thanks
Depending on your needs I would choose something like react-native-canvas they have pretty much everything you gonna need to draw.
Other option would be GCanvas.
With those options you will be able to draw free forms as you wish
But there`s always the option to use SVG as well.
In my past experiences SVG forms solved most of the cases, but sometimes I had to use this canvas libs to draw some more complex or dynamic forms.
Hope this can be of any help to you.

drawing with cairo over a GtkBox not using GtkDrawingArea

I program my application in C using GTK+3 and cairo.
is there a way to draw a line on top of a Vertical GtkBox ?
the thing is that I need to mark an area with a line. the area is a row of a vertical GtkBox, which is not a GtkDrawingArea.
is that possible?
any information regarding the issue would be greatly appreciated.
I'm using glade in order to create the Gtk Vertical Box.
I connected a callback to the draw signal and I marked 'After' in glade which actually calls my callback after the basic drawing. which allows me to draw on top of the elements inside it.
as simple as that ;)

Creating a grid layout for GTK+

I'm writing an application in C and i'm using GTK+ for the GUI part. I was reading about the layout part and how I need to organize my into into grids using vertical boxes and horizontal boxes. However I read on some forum that the use of gtk_vbox_new() function is deprecated. What are the best ways to create a grid so that I can position my widgets using GTK+? Should I use a table and just juggle with that or is there any way that I can position my elements similar to how I position elements in HTML with CSS?
gtk_vbox_new is deprecated in favor of using gtk_box_new and passing in GTK_ORIENTATION_VERTICAL. If you need a tabular layout, GtkGrid is the way to go (don't use the deprecated GtkTable).
A good way to design your layout is to use Glade. Even if you end up hard-coding the widgets instead of using GtkBuilder, Glade will allow you to quickly layout the widgets and experiment with different designs in real time.

How to build the following visual

I am not a real designer and I would like to know if anyone have an idea how can I build the following visual :
The idea is to get 2 rings where inside I will draw secific number of pie represented as "Interactive shape or button". Base on the number of shape, they should cover the whole circle.
In addition to that, I need to be able to interact with each pie shape, and inside and oustide edge of those shape should be a perfect arc based on the circle diameter.
As I am not a perfect designer, how can I represent this visual ?
I was thinking of using a custom panel but then how to draw each panel shape in order that they gets perfect inside and ouside arc and offer interactivity with each of them ?
Thanks for your help
I would appreciate samples as well
Theres actually a Silverlight tutorial on making something exactly like this.
If you didnt want to use that, you could always do it in javascript. Here's an example using Rapheal js
I would recommend looking into WPF Geometry and how you can create custom controls (such as the Circular Gauge Custom Control over on CodeProject) using said Geometry.
I've never created a control quite like what your suggesting, but I would image you would define some form of area that can contain children and style it so that it forms the circular shape you want. Then, adding interactive regions should be as simple as adding controls to standard containers.
Here's a link to a "generic radial panel that can be used to host any items" which subclasses Panel.

Resources