gtk

Gtk+ and serial input (UART)

◇◆丶佛笑我妖孽 提交于 2021-02-08 10:14:00
问题 I have following problem: I receive sensor data via UART (every 10ms) and I want to process this data in gtk. The idea is to process this data in specific time intervalls (e.g. every 100ms). Due to that I use the g_timeout_add() function. The called function contains the common sets for UART communication -> in my case it blocks until I receive 10 chars. And here is the problem - at my read() (-> system call) function the program hang up. My serial settings are as follows: struct termios

OpenCV - Getting picture from default webcam in C/C++ - GTK Issues

﹥>﹥吖頭↗ 提交于 2021-02-08 08:51:13
问题 I have a simple GTK+ v3 GUI application, and I am making use of the OpenCV library so that I have a simple function for taking pictures from the one webcam connected to my computer. The code is included at the bottom of this post. I'm able to successfully acquire image data and render it on screen, but when I include this code in my GTK+ v3 project, I get a startup error like so: (result:2944): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+3 in the same process is not

Resizing gtk widgets by user

荒凉一梦 提交于 2021-02-08 07:26:51
问题 I am working on a project in python using gtk and in it the is a gtk notebook on top of a vte console. I am having trouble getting it to be resizable by the user (i.e. I want the user to be able to drag the border of the 2 up and down and resize both accordingly). Could anyone point me in the right direction on how to do this? 回答1: Try this: vpan = gtk.VPaned() vpan.show() vpan.pack1(box1, shrink=False) vpan.pack2(box2, shrink=False) 来源: https://stackoverflow.com/questions/4560048/resizing

How can i retrieve Window ID of gtk window

♀尐吖头ヾ 提交于 2021-02-07 22:40:33
问题 I am having an application where i need to display streaming video using XV. I will pass top-level window ID to underlying video playing application which will Attach/Add child window (child window with streaming videos in it) to my window. So for that I need to get ID of top level window provided by operating system. I am using GTK+ and C on Linux. 回答1: You use the GDK_DRAWABLE_XID() macro, assuming you're on X11: GtkWindow *mywindow; GdkWindow *gwin; gwin = gtk_widget_get_window(GTK_WIDGET

CMake error with gtkmm

不打扰是莪最后的温柔 提交于 2021-02-07 20:32:29
问题 I'm using Debian 8 and have installed libgtkmm-3.0 (and also -dev). Now I have a very simple program using gtkmm, basically a Hello World: main.cpp: #include "../include/BrowserWindow.class.hpp" #include <gtkmm/application.h> int main(int argv, char *argc[]) { Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); BrowserWindow helloworld; //Shows the window and returns when it is closed. return app->run(helloworld); } BrowserWindow.class.cpp: #include

CMake error with gtkmm

白昼怎懂夜的黑 提交于 2021-02-07 20:30:01
问题 I'm using Debian 8 and have installed libgtkmm-3.0 (and also -dev). Now I have a very simple program using gtkmm, basically a Hello World: main.cpp: #include "../include/BrowserWindow.class.hpp" #include <gtkmm/application.h> int main(int argv, char *argc[]) { Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example"); BrowserWindow helloworld; //Shows the window and returns when it is closed. return app->run(helloworld); } BrowserWindow.class.cpp: #include

Get active gtk window in python

北城余情 提交于 2021-02-07 19:48:14
问题 How would I get a handle to the active gtk.Window in python? (not a window I created, but the currently focused window). 回答1: The answer is actually not OS-specific -- you can do it within GTK. You can get a list of all the toplevel windows from the application using gtk.window_list_toplevels() , then iterate through it until you find one where window.is_active() returns True . If you want to consider other windows than the ones from your application, then you could try gtk.gdk.screen_get

Get active gtk window in python

会有一股神秘感。 提交于 2021-02-07 19:47:14
问题 How would I get a handle to the active gtk.Window in python? (not a window I created, but the currently focused window). 回答1: The answer is actually not OS-specific -- you can do it within GTK. You can get a list of all the toplevel windows from the application using gtk.window_list_toplevels() , then iterate through it until you find one where window.is_active() returns True . If you want to consider other windows than the ones from your application, then you could try gtk.gdk.screen_get

Force background of matplotlib figure to be transparent

余生长醉 提交于 2021-02-07 14:44:26
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as

Force background of matplotlib figure to be transparent

橙三吉。 提交于 2021-02-07 14:44:25
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as