gtk3

Adding custom widget to GLADE

青春壹個敷衍的年華 提交于 2019-12-12 12:35:44
问题 Hi am using gtk3 and glade 3.14...I want to add a custom widget to glade so that i can add that to my user interface easily. I found knob widget is missing in glade and i found knob widget in http://sourceforge.net/projects/giw/ I downloaded and installed instrumentation widgets but it wont get added to Glade. Is a knob widget available in glade. I tried using the knob.c and knob.h file and tried example and got some examples working but couldn't integrate them to gade. 回答1: What you need is

How I can get DrawingArea window handle in Gtk3?

柔情痞子 提交于 2019-12-12 11:26:17
问题 I get this code on CEF Python 3 (link) ... self.container = gtk.DrawingArea() self.container.set_property('can-focus', True) self.container.connect('size-allocate', self.OnSize) self.container.show() ... windowID = self.container.get_window().handle windowInfo = cefpython.WindowInfo() windowInfo.SetAsChild(windowID) self.browser = cefpython.CreateBrowserSync(windowInfo, browserSettings={}, navigateUrl=GetApplicationPath('example.html')) ... This code [ self.container.get_window().handle ] don

Python GTK signal handler not working

隐身守侯 提交于 2019-12-12 11:02:19
问题 I am writing a Python application using GTK for the GUI. I noticed that closing it with Ctrl-C from the terminal isn't working and I discovered this is because of a bug, so I tried to manually handle the signal. The problem is that if I set the default behaviour to the default one, the signal is caught and the application is closed correctly, but if I use a custom handler it doesn't work. Here is my (simplified) code: from gi.repository import Gtk import signal class MainWindow(Gtk.Window):

How can one update GTK+ UI in Vala from a long operation without blocking the UI

余生颓废 提交于 2019-12-12 10:25:23
问题 When I use any of the codes in this page without modifying anything: https://wiki.gnome.org/Projects/Vala/AsyncSamples I always get: warning: ‘g_simple_async_result_new’ is deprecated: Use 'g_task_new' instead. So I proceed with the recommendation of using GTask. However, when I try to use GLib.Task in Vala, I get stuck just declaring a task. So instead of using async from GIO in my own code, since it is deprecated, I try to use GLib.Task to simply update the label of a Gtk Button with

Creating print job in gtk3/python

拈花ヽ惹草 提交于 2019-12-12 10:08:28
问题 I have some information (a list of participants to an event) which I want to print out easily. No need for fancy layout, just a table with several columns, and if possible a drawn line in between the lines of text for better readability. Will need to print landscape to make it all fit (can be done via a GtkPageSetup). I'm using Python, and I'm on Linux so will have to use the GtkPrintUnixDialog interface. I've been searching on Internet but can't find any example on how this could possibly be

Python GTK3 Treeview Move Selection up or down

泄露秘密 提交于 2019-12-12 09:52:04
问题 How do I move a selection up or down in a Treeview? The idea is that I can have an up and down buttons to move the selection up a row or down a row. My Treeview is using a ListStore. Not sure if that matters. 回答1: First off, I will be using C code as that's what I'm familiar with. Should you have problems translating it to Python, then say so, and I will do my best to help. The class you want to use for this is GtkTreeSelection . Basically, what you do is: Get the selection object of the view

How to create a live updating matplotlib graph in gtk3

谁说胖子不能爱 提交于 2019-12-12 09:43:57
问题 I wanted to put my live plotting app into a nice gtk3 programm and so far I got this but it doesn't show a window. What am I missing? Thanks in advance! import serial import numpy as np from matplotlib.figure import Figure from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas from gi.repository import Gtk class MyWindow(Gtk.ApplicationWindow): def __init__(self): Gtk.Window.__init__(self, title="Toolbar Example") self.set_size_request(700, 500) self.box = Gtk

Cannot compile Cairo C code on Windows 10

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:25:27
问题 I am trying to compile the zetcode lines on Windows 10 using msys64. I use the following compilation command: gcc example.c -o example `pkg-config --cflags --libs cairo gtk+-3.0` and get the following error: -bash: pkg-config: command not found example.c:1:19: fatal error: cairo.h: No such file or directory #include <cairo.h> However I did pacman -S mingw-w64-i686-cairo before and the installation was successful. When I type **pacman -Ss mingw-w64-i686-cairo ** I get the following: mingw32

catch mouse motion in gtkmm

怎甘沉沦 提交于 2019-12-12 03:54:41
问题 I am trying to catch the mouse motion when I hold the mouse middle button. The goal is to implement a rotation feature in an stl viewer. I found the event mask BUTTON2_MOTION_MASK . But I have a hard time figuring out which signal catches it. Here's the two line I use to create and hook the event. These two line are inside a GtkApplicationWindow Constructor. glWidget.add_events(Gdk::BUTTON2_MOTION_MASK); glWidget.signal_motion_notify_event().connect(sigc::mem_fun(*this,&mainWindow::rotate));

set dialog not resizable or create another gtk window

人盡茶涼 提交于 2019-12-12 03:49:03
问题 I have a gtk_window which contain 4 buttons. One of these buttons will open a file selection dialog (another function) which - when the file has been choosed - will show up a dialog with 3 gtk_entry (this function). static void function_with_3_gtk_entry (gchar *message, gpointer mainwin){ GtkWidget *dialog, *label, *content_area, *entry1, *entry2, *entry3; /* Create the widgets */ dialog = gtk_dialog_new_with_buttons ("Nome File", mainwin, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_OK, GTK