Displaying sudoku grid with ncurses - c

I have wrote a c program to solve sudokus, and i would like to know if i can draw the grid and fill it using ncurses library.
i just would like to know how to control the lines and borders of boxes in ncurses
thank you very much

Yes, you can, using hline family of functions to draw your grid.
See http://osr600doc.sco.com/en/man/html.CURSES/hline.CURSES.html for more information.

Related

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 ;)

How to do simple shape drawing in GTK?

I am new to Gtk and want to do simple drawing of shapes like circles and rectangles. I was looking at the gnome tutorial and the hello word example. However the curves section is undocumented. I was wondering if someone could point me in the right direction as to what should I look at, and maybe if I need to include some other supplementary library to draw?
The preferred drawing API in GTK 2 and 3 is Cairo. But if you need to develop a diagram program, with nodes that can react to events, you will need also to use a canvas, like GooCanvas.
Check out http://developer.gnome.org/gtk3/3.2/GtkDrawingArea.html about the GtkDrawingArea, plus http://developer.gnome.org/gdk/stable/gdk-Drawing-Primitives.html about Gdk-Drawing-Primitives and you are on the go.
You might also go a bit further by using this link and check out Cairo directly http://www.cairographics.org

How can I draw a circle with Clutter?

I want to draw a circle with clutter but I am unable to figure how can I do that. I am using clutter with vala programming language but an example in c would be sufficient also in case you don't know vala. So how can i do that ?
you can use ClutterCairoTexture, and draw the circle using the Cairo API, if you want to have high-quality, 2D drawing.

How do I draw separators?

I am programming in C, using the Windows API, and would like to know how I could draw separators. I would appreciate a code example.
Edit: Here's an illustration.
(source: microsoft.com)
Use a static control/window with the SS_ETCHEDHORZ style (This is what explorer does and should give you the most accurate rendering when it comes to Visual Styles)
I don't suppose you're just looking for LineTo?
For menus and toolbars, generally the separators are drawn for you by the menu and toolbar APIs. For random separators in dialog boxes, etc, like in the picture you added you can just draw a line.
OK, you just want to draw straight lines on the form. That is trivial. When drawing your window, i.e. when processing the WM_PAINT message, simply draw a line using the MoveToEx and LineTo functions.
You insert separators in menus when you insert a normal menu item with a hyphen "-" as text.
Windows will automatically expand them to separators.

Gtk buttons over a Gtk drawing area

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/

Resources