gtk2

glib.h and gtk.h not found

房东的猫 提交于 2019-12-05 04:32:28
问题 hi every one i have a program in which i have include gtk/gtk.h glib.h i have used commands sudo apt-get install libgtk2.0-dev glib sudo apt-get install glade but still getting error that glib not found ans gtk/gtk.h not found. i am first time using this gtk . no idea how it works how to install it kindly help me thanks i am doing c programming 回答1: The command you're supposed to use (in more recent releases of linux/gtk) is pkg-config, not gtk-config. gtk-config is intended for pre 2.0 gtk

glib.h and gtk.h not found

被刻印的时光 ゝ 提交于 2019-12-03 22:12:54
hi every one i have a program in which i have include gtk/gtk.h glib.h i have used commands sudo apt-get install libgtk2.0-dev glib sudo apt-get install glade but still getting error that glib not found ans gtk/gtk.h not found. i am first time using this gtk . no idea how it works how to install it kindly help me thanks i am doing c programming The command you're supposed to use (in more recent releases of linux/gtk) is pkg-config, not gtk-config. gtk-config is intended for pre 2.0 gtk development. Consider the file you're compiling is called foo.c, to compile it under gtk-2.0, you would use,

GTK+-based graph?

*爱你&永不变心* 提交于 2019-12-03 02:14:48
I want to be able to make a line graph using GTK+ but I'm unsure how to approach this. Has anyone got any hints or tips? Have a look at the gnuplot there are some C++ libraries that interface with gnuplot, which do what you are looking for and then some. It is very easy to use if you've ever used gnuplot. Edit: Here are GTK+ 2 and GTK+ 3 versions of that program: https://github.com/liberforce/gtk-samples/tree/master/c/gtk2-graph https://github.com/liberforce/gtk-samples/tree/master/c/gtk3-graph Original answer: Here's a GTK2 application using cairo to draw a simple math function: #include <gtk

How to get as many information as possible about an OpenGL context

时光怂恿深爱的人放手 提交于 2019-12-01 21:06:12
问题 Hello world and thanks for taking some time to read this ! I am writing a program in GTK2/3 + OpenGL, I got two versions of the program running: (a) GTK+2 + GtkGlext Extention -> works great ! (b) GTK+3 + LibX11 -> works just fine ! Everything looks fine, except that the rendering in (a) is significantly faster that the rendering in (b) ... and I got no clue why. Here are some example of the code parts used to create the OpenGL context: (a) // To create the context, and the associated

gtk_main() and unix sockets

纵饮孤独 提交于 2019-12-01 20:58:43
问题 I'm working on a chat application using C and unix low level sockets. I have succeeded in making the console version, but I want to make a GUI for the application. I would like to use GTK for the GUI. my problem is how to "synchronize" the socket and the GUI. because I have to call gtk_main() as the last GTK statement and the application itself is an infinite loop. How can I update the GUI when a message comes in? 回答1: You are facing the problem that you have several event systems at once but

gtk_main() and unix sockets

陌路散爱 提交于 2019-12-01 19:57:04
I'm working on a chat application using C and unix low level sockets. I have succeeded in making the console version, but I want to make a GUI for the application. I would like to use GTK for the GUI. my problem is how to "synchronize" the socket and the GUI. because I have to call gtk_main() as the last GTK statement and the application itself is an infinite loop. How can I update the GUI when a message comes in? You are facing the problem that you have several event systems at once but only one thread. Gtk+ comes with its own event handler, that eventually boils down to a select() which will

How to get as many information as possible about an OpenGL context

萝らか妹 提交于 2019-12-01 18:57:09
Hello world and thanks for taking some time to read this ! I am writing a program in GTK2/3 + OpenGL, I got two versions of the program running: (a) GTK+2 + GtkGlext Extention -> works great ! (b) GTK+3 + LibX11 -> works just fine ! Everything looks fine, except that the rendering in (a) is significantly faster that the rendering in (b) ... and I got no clue why. Here are some example of the code parts used to create the OpenGL context: (a) // To create the context, and the associated GtkWidget GdkGLConfig * glconfig = gdk_gl_config_new_by_mode (GDK_GL_MODE_RGBA | GDK_GL_MODE_DEPTH | GDK_GL

GObject Gtk, Gnome, Gtk+, Gl, Gtk2, Gtk3…I don't understand?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 16:00:22
all I need some window to host webkit or/and cairo drwaing, but i have to deal with all that first to understand what I'm doing. now. I'm lost and no more understand what's all that about. and things get worse when I try working with binding or trying to figure what are dependencies for something. for example: in python, pyGtk deprecated and replaced by pyGObject(sometimes called pyGl!!) there are many sites, many downloads and versions, mixed outdated and new references, but not one architectural view of the whole thing . what I don't understand..is how all these things mixed with each other

How to create a cairo_t on a Gtk 2 window

社会主义新天地 提交于 2019-12-01 08:25:50
I have an old app, now compiling on Gtk 2, but I need to introduce the use of Cairo. I can't figure out how to create the necessary cairo context (cairo_t) from my Widgets. Here's the code I'm trying to learn with so far, modified (*ahem* cribbed) from a Gtk 3 tutorial. The crux of the matter is creating a cairo surface from the window widget. As it stands, that call is a sketch and it won't compile, let alone run. Remember, my target is Gtk2, not 3, at least at this point. /* Snitched from http://zetcode.com/gfx/cairo/cairobackends/ on 13 Jan 2014 */ #include <cairo.h> #include <cairo-xlib.h>

Get colors of current gtk style

时间秒杀一切 提交于 2019-12-01 08:22:15
I use PyGTK and I want to get colors of a widget (for example bg color), I run such a code: gdkColorToRgb = lambda gc: (gc.red//257, gc.green//257, gc.blue//257) widget = gtk.HBox() ## for example style = widget.get_style() for i in range(5): print i, gdkColorToRgb(style.bg[i]) But it does not give colors of my current gtk theme(style). It seems to be for default gtk theme (my current theme is dark, while this code gives light colors) I use ArchLinux and PyGTK 2.24.0 (GTK 2.24.5) I just stumbled upon the same issue, saw your question and found a solution: You have to wait until the widget is