gtk

GTK+ compilation undefined reference C

为君一笑 提交于 2019-12-24 03:42:59
问题 I'm trying to compile and link a simple program downloaded from the web to learn how to make a GUI using the gtk+ library. Here is my makefile: CC = gcc BIN = gtk_led SRC = main.c gtkled.c OBJ = main.o gtkled.o CPPFLAGS =-Wall -W -ansi -pedantic -O2 `pkg-config --cflags gtk+-2.0` LDFLAGS = `pkg-config --libs gtk+-2.0` all: $(BIN) $(BIN): $(SRC) $(CC) $(CPPFLAGS) -c $(SRC) $(CC) $(LDFLAGS) -o $(BIN) $(OBJ) clean: rm -f *.o *~ core $(BIN) When I do make , the build fails with the following

linking error in gtk2 application in ubuntu 12.04

ぐ巨炮叔叔 提交于 2019-12-24 02:02:46
问题 I've a C GUI application (in GTK+2.0 ) that I used to link as follows : gcc -O2 -std=gnu99 -pipe -Wall -lm `pkg-congig gtk+-2.0 `pkg-config --libs gtk+-2.0` -o exec a.o b.o c.o which eventually converted into : gcc -O2 -std=gnu99 -pipe -Wall -lm -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64 linux

GTK/GDK Algorithm to take full screenshots of all monitors

ε祈祈猫儿з 提交于 2019-12-23 22:30:15
问题 I'm fairly new to the whole GTK game and want to create an algorithm to take screen shot of all monitors. I was thinking something along these lines: gdk_display_manager_list_displays each display can have multiple screens (screens means monitors?) so use gdk_display_get_n_screens to get monitors per display from 1 get root gtk window of all screens from 2 create new Pixbuf for each root gtk window for each screen from 3 with gdk_pixbuf_new fill each pixbuf from 4 with gdk_pixbuf_get_from

How to develop interface like Eclipse using GTK?

大兔子大兔子 提交于 2019-12-23 21:33:31
问题 I want a write a desktop application using GTKMM. I want the interface to be made of different panels like in Eclipse you have the Project Explorer, Console, Properties, etc. You should be able to drag the panels to change their position, close them and popout them (not sure if you can popout the panels in Eclipse but you can do it in Visual Studio). I am using the word panels here as I am not sure what the right term is. I guess some call it dockable windows. Any pointers on how this can be

How do I style user-defined function names in gedit?

♀尐吖头ヾ 提交于 2019-12-23 21:25:44
问题 I'm trying to tweak a gedit style so that user-defined functions have a different colour. I've searched through http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-reference.html but I couldn't find anything. I thought <style name="def:function" /> might do it, but it seems have no effect in gedit. <?xml version="1.0" ?> <style-scheme id="wombat" name="Wombat" version="1.0"> <author/> <_description>Wombat theme</_description> <style background="#2d2d2d" name="current-line"/> <style

Gtk ComboBox width based on contents

半腔热情 提交于 2019-12-23 21:00:31
问题 I'm dynamically populating the options to a GTK3 ComboBox that has an Entry. Some the options can be quite long, and I'd like to be able to make the ComboBox wider if there are wide items in my model. Is there a way to do this? (It would be especially nice if the combobox could be expanded automatically but with an upper limit that could be set.) 来源: https://stackoverflow.com/questions/11975230/gtk-combobox-width-based-on-contents

Gtk3 | Python: Namespace Gtk not available, Typelib file for namespace 'Gtk' (any version) not found (using macos)

怎甘沉沦 提交于 2019-12-23 19:35:09
问题 I'm trying to start making a little GTK program, and to test GTK installation and config I'm trying to execute a simple helloworld script. Just using a simple example given by pygobject documentation: import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk window = Gtk.Window(title="Hello World") window.show() window.connect("destroy", Gtk.main_quit) Gtk.main() First issue (resolved): from gi.repository import Gtk Gtk not found, but a new autoimport give me this import: from

Gtk/GtkD Detect release of mouse button on window resize?

微笑、不失礼 提交于 2019-12-23 18:48:38
问题 I'm trying to improve a plotting library that I wrote with GtkD (the D bindings for Gtk). Scatter plots with a lot of points take a long time to resize. I want to rescale the image, allowing pixelation, while the user is dragging the window edge to resize, and only re-render it when the mouse button is released. Is there an API to detect whether the user is still holding down the mouse button to drag the window edge when a window is being resized? If you are not familiar with GtkD, a response

Dynamically modifying/refreshing menu contents in PyGTK

帅比萌擦擦* 提交于 2019-12-23 17:03:14
问题 I am trying to implement a list of recently opened items in the menu of a GUI I am writing with PyGTK. I initialize the menu like so: self.filemenu = gtk.Menu() self.init_file_menu() self.fileitem = gtk.MenuItem("File") self.fileitem.set_submenu(self.filemenu) menubar = gtk.MenuBar() menubar.append(self.fileitem) outerframe.pack_start(menubar, False, False) def init_file_menu(self): for widget in self.filemenu.get_children(): self.filemenu.remove(widget) openitem = gtk.MenuItem("Open") self

Overriding virtual methods in PyGObject

懵懂的女人 提交于 2019-12-23 16:12:37
问题 I'm trying to implement the Heigh-for-width Geometry Management in GTK with Python for my custom Widget. My widget is a subclass from Gtk.DrawingArea and draws some parts of an Image. As I understood the GTK Docs (link above) I have to implement the following 4 methods: GtkWidgetClass.get_preferred_width() GtkWidgetClass.get_preferred_height() GtkWidgetClass.get_preferred_height_for_width() GtkWidgetClass.get_preferred_width_for_height() Now wondering where to implement this in Python. I