gtk3

GTK 3 How to connect one signal to multiple widgets?

痴心易碎 提交于 2019-12-08 13:11:08
问题 I need to create a form with the model created by the code bellow, composed by a window with two text entries and one button. I need to put some text in the entries, and when the button is pressed, put the text gotten in the two entries in an array, (or print them both, or any action with both at the same time) The code used to create the window is the following: #include <iostream> #include <gtk/gtk.h> using namespace std; GtkWidget *wventana; GtkWidget *wgrid; void ventana(string titulo,

Gtkglext and gtkglarea gtk3 windows does not work

老子叫甜甜 提交于 2019-12-08 04:18:24
I need to get working gtk3 with vtk6. Ive just built (after some effort) gtkglext for gtk3. Later I built vtkmm1.2 with the win32 patches and I do not see vtk widget. Due to this, I discovered I cant see any draw in the gtkglext examples. On the other side, Ive tried the excellent example of gtkglarea (the new, gtk built in one ) with plain opengl from https://www.bassi.io/articles/2015/02/17/using-opengl-with-gtk/ and I get no draw because "fb setup not supported". It seems the framebuffer is complete, checking gtkglarea.c. How can i solve this? Anyone have been able to draw something in gtk

Change the colour of pixels in a GdkPixbuf (GTK3)

我的梦境 提交于 2019-12-08 03:47:59
问题 I'm using Gtk.StatusIcon , and want to change the colour of some pixels; I have a working piece of code, this loads a 1x1 pixel PNG file with the colour I want to set, and then copies that to thhe icon Pixbuf. While this works, it has the obvious drawback of having to create a 1x1 pixel for every colour, so I can't use an arbitrary colour, only the predefined colours I created images for. How do I set a pixel to an arbitrary RGBA colour? The code I'm using now (simplified for demonstration

How to periodically update Gtk3 Label text?

一世执手 提交于 2019-12-08 03:30:12
问题 I am writing an app-indicator on Ubuntu 18.04. Getting started was the most difficult part. Docs don't help much. I found this blog and I have a POC that just shows a fixed text on my application bar like this - What I have not been able to figure out is how to update this text periodically or dynamically to display actual information that I need for example: CPU frequency, temperature etc. I have looked at the following places, however I think i am missing something. https://lazka.github.io

GTK+ CSS for one button

戏子无情 提交于 2019-12-08 03:20:56
问题 How to set color for one button in GTK+ GtkButton button8 { border-radius: 20; border-width: 1 1 1 1; font: Sans 16; color: black; background-image: -gtk-gradient (linear, left top, left bottom, color-stop(0.0,rgba(34,97,170,1)), color-stop(0.50,rgba(56,145,218,1)), color-stop(0.51,rgba(34,131,216,1)), color-stop(1.00,rgba(134,191,234,1))); } This css changes the color of al buttons in glade file.How should i change the css so that it affects only one button? 回答1: gtk_widget_set_name (widget,

Window freezes after clicking of button in python GTK3

时光总嘲笑我的痴心妄想 提交于 2019-12-07 22:44:40
问题 Hello I have some command, which runs for average 30 min, when I click on button created by GTK3, python starts to executing command but my all application freezes. My python code for button clicked is: def on_next2_clicked(self,button): cmd = "My Command" proc = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE) while True: line = proc.stdout.read(2) if not line: break self.fper = float(line)/100.0 self.ui.progressbar1.set_fraction(self.fper) print "Done" I also have to set output of

Python GTK3: how to create a Gtk.FileChooseDialog?

☆樱花仙子☆ 提交于 2019-12-07 18:21:51
问题 How to create a Gtk.FileChooseDialog properly? This popular tutorial says to use code like the following: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk dialog = Gtk.FileChooserDialog("Please choose a folder", None, Gtk.FileChooserAction.SELECT_FOLDER, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, "Select", Gtk.ResponseType.OK)) But, if you run this with python -W error (to catch the deprecated warnings) it says: File "test3.py", line 8, in <module> "Select", Gtk

unresponsive drag and drop in pygobject

百般思念 提交于 2019-12-07 17:43:34
问题 im trying to get drag and drop working well in pygobject, but it is slow and unresponsive, 90% of the time i have to wave the item i am dragging around before i can drop it successfully, can anyone see if i am doing it incorrectly or is this a bug with pygobject? here is my code from gi.repository import Gtk, GdkPixbuf, Gdk import os def got_data_cb(windowid, context, x, y, data, info, time): # Got data. tempArray = data.get_text().splitlines() for i in tempArray: i = i.replace('file://','')

How to include resources file in anjuta project

余生颓废 提交于 2019-12-07 13:48:14
问题 I'm trying to update a graphical project in vala, moving lot of code lines into an ui file. I want to use template (available with glib-2.38 and GTK+3.8, something like that). My project is managed with Anjuta and autoconf. In the src directory there are application.ui : <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.8 --> <template class="SpiWindow" parent="GtkApplicationWindow"> <property name="title" translatable="yes">Example Application</property>

Travis-ci & Gobject introspection

故事扮演 提交于 2019-12-07 12:43:33
问题 I'm trying to setup Travis for Getting Things GNOME!. My .travis.yml: language: python python: - '3.3' before_install: - sudo apt-get update - sudo apt-get install -qq python3-gi gir1.2-gtk-3.0 virtualenv: system_site_packages: true install: - pip install -e git+git://github.com/getting-things-gnome/liblarch.git#egg=liblarch - pip install -r requirements.txt script: - ./run-tests However, build fails: ====================================================================== ERROR: Failure: