gtk

Change selected row in gtk_tree_selection from C function

て烟熏妆下的殇ゞ 提交于 2021-02-11 11:44:46
问题 I have some efficiency concerns in my application using GTK3 and hope you can provide some help. I have a gtk_list_store that is shown within a gtk_tree_view. The tree view allows selecting multiple rows. I have connected a callback function to the "changed" event of the tree_selection. This callback is called whenever the user selects or unselects any row. Then some calculations are done and some images and contents of other gtk widgets are updated accordingly. This is fine so far. I also

Change selected row in gtk_tree_selection from C function

徘徊边缘 提交于 2021-02-11 11:44:31
问题 I have some efficiency concerns in my application using GTK3 and hope you can provide some help. I have a gtk_list_store that is shown within a gtk_tree_view. The tree view allows selecting multiple rows. I have connected a callback function to the "changed" event of the tree_selection. This callback is called whenever the user selects or unselects any row. Then some calculations are done and some images and contents of other gtk widgets are updated accordingly. This is fine so far. I also

Python Indicator stops updating after 3 times on Ubuntu

醉酒当歌 提交于 2021-02-10 18:13:59
问题 i am writing an Indicator in Python which should update every 5 minutes. Unfortunately the label is updated only 3 times, but then the label stays the same, although the thread still runs. For demonstration purpose, I replaced the data with the current time. #!/usr/bin/env python3 import signal import gi import threading gi.require_version('Gtk', '3.0') gi.require_version('AppIndicator3', '0.1') from gi.repository import Gtk, AppIndicator3, GObject import time class Indicator(): def __init__

Gtk::Button with standard Icons

余生长醉 提交于 2021-02-10 07:28:12
问题 if I use: Gtk::Button* button = Gtk::manage( new Gtk::Button(Gtk::Stock::DELETE)); it works perfect, but the documentation and the header says: Deprecated, use label _Delete But if I simply write Gtk::Button* button = Gtk::manage( new Gtk::Button("_Delete")); the button shows simply the text _Delete . How can I create a standard button in the "new" fashion? Update: There is simply no plan to make anything automated anymore in gtk. There was a long discussion on the developers mailing list.

Using an X11 Window with GTK

半世苍凉 提交于 2021-02-10 06:31:11
问题 My C application uses X11 calls to create and manage a window. I only want to use GTK3 for menus. I create a window using Window wnd = XCreateWindow(...); Now I want to use GTK to add menus to wnd . GTK APIs such as gtk_container_add(GTK_CONTAINER(gtk_wnd), vbox) want a GtkWindow, which I do not have. How do I accomplish this? Ideally I'd like to get a X11 handle to work with GTK, potentially via a conversion. Alternatively, I'd also settle for getting the current window via some GTK API. 来源:

Using Python GTK GUI front end with C++ backend

一笑奈何 提交于 2021-02-09 07:00:23
问题 I have some C++ code and am now building a GUI for an application. In the past I've used python and pygtk for GUI programming and occasionally link to some C++ code to do some heavy lifting. I would like to continue that trend but have one question on how to do it in this case. Part of the C++ code gets images from a camera and I would like to display those images on the GUI. I've used libvlc in the past and could pass the xid from a DrawingArea to vlc to draw the video on. I would like to do

Using Python GTK GUI front end with C++ backend

穿精又带淫゛_ 提交于 2021-02-09 06:58:41
问题 I have some C++ code and am now building a GUI for an application. In the past I've used python and pygtk for GUI programming and occasionally link to some C++ code to do some heavy lifting. I would like to continue that trend but have one question on how to do it in this case. Part of the C++ code gets images from a camera and I would like to display those images on the GUI. I've used libvlc in the past and could pass the xid from a DrawingArea to vlc to draw the video on. I would like to do

Using Python GTK GUI front end with C++ backend

依然范特西╮ 提交于 2021-02-09 06:57:28
问题 I have some C++ code and am now building a GUI for an application. In the past I've used python and pygtk for GUI programming and occasionally link to some C++ code to do some heavy lifting. I would like to continue that trend but have one question on how to do it in this case. Part of the C++ code gets images from a camera and I would like to display those images on the GUI. I've used libvlc in the past and could pass the xid from a DrawingArea to vlc to draw the video on. I would like to do

Setting GtkEntry font from Pango.FontDescription

爷,独闯天下 提交于 2021-02-08 13:35:14
问题 I have a GtkEntry that's I'd like to allow users to style with their choice of font (or system default). I end up with a Pango description string like "Monospace 10" to describe the font. I'm currently using override_font , which is deprecated in favour of CSS styling. I'd like to at least attempt to do it "right", but it seems like a pretty convoluted and fragile workflow now to get the CSS from the Pango string. Here's an example from Github: def _get_editor_font_css(): """Return CSS for

Store Gtk.Textbuffer in SQL database. Encoding troubles

纵饮孤独 提交于 2021-02-08 11:51:34
问题 I'm working on a note taking app using python2/Gtk3/Glade . The notes are stored in a MySQL Database and displayed in a TextView widget . I can load/store/display plain text fine. However I want the ability to add images to the note page, and store them in the Database.so the data has to be serialised and I'm having some trouble figuring out how to encode/decode the serialised data going in and out of the Database. I'm getting unicode start byte errors. If was working with files I could just