gtk2

How do I make a GTK 2 list with multiple selection?

老子叫甜甜 提交于 2020-06-29 03:33:28
问题 In a GTK 3 release, the ListBox widget added supported for multiple elements being selected from the list: I'd like to achieve the same effect with GTK 2. I'm considering using a ScrolledWindow with a VBox of CheckButton 's. I fear it's not going to look very good though; like this, but with a scrollbar: Does anyone know a good way to emulate the functionality in the first image using GTK 2? 回答1: It turns out there was a method of doing just this buried in the documentation! In fact, you

Drag file from Program and Drop file to anywhere (Ex Desktop etc) using gtk#

我只是一个虾纸丫 提交于 2020-04-17 21:29:24
问题 I tried to Drag a file from my application to the desktop. I am need to set Drag.SourceSet to program. I do not know, how to set Drag.DestSet for Desktop The below example is useful for me while file Darg file from desktop to Drop at my application. https://stackoverflow.com/questions/14273471/drag-and-drop-files-into-program Can you please help me on this. Thanks 来源: https://stackoverflow.com/questions/61188963/drag-file-from-program-and-drop-file-to-anywhere-ex-desktop-etc-using-gtk

Drag file from Program and Drop file to anywhere (Ex Desktop etc) using gtk#

ε祈祈猫儿з 提交于 2020-04-17 21:27:50
问题 I tried to Drag a file from my application to the desktop. I am need to set Drag.SourceSet to program. I do not know, how to set Drag.DestSet for Desktop The below example is useful for me while file Darg file from desktop to Drop at my application. https://stackoverflow.com/questions/14273471/drag-and-drop-files-into-program Can you please help me on this. Thanks 来源: https://stackoverflow.com/questions/61188963/drag-file-from-program-and-drop-file-to-anywhere-ex-desktop-etc-using-gtk

Drag file from Program and Drop file to anywhere (Ex Desktop etc) using gtk#

家住魔仙堡 提交于 2020-04-17 21:26:29
问题 I tried to Drag a file from my application to the desktop. I am need to set Drag.SourceSet to program. I do not know, how to set Drag.DestSet for Desktop The below example is useful for me while file Darg file from desktop to Drop at my application. https://stackoverflow.com/questions/14273471/drag-and-drop-files-into-program Can you please help me on this. Thanks 来源: https://stackoverflow.com/questions/61188963/drag-file-from-program-and-drop-file-to-anywhere-ex-desktop-etc-using-gtk

Cannot reduce size of gtk window programatically

混江龙づ霸主 提交于 2020-01-30 10:47:40
问题 I seem to be facing a problem when resizing a gtk window programatically. The problem is that once I have increased the width and height of the window to 800x600, I cannot seem to reduce it back to its original size of 400x200. Below is the sample code. Has anyone faced such a problem? #include <gtk/gtk.h> static gboolean is_clicked = FALSE; static void Child_window_resize( GtkWidget *widget, GtkWidget *window) { if(!is_clicked) { g_print("Inside If block increase bool value %d\n",is_clicked)

GObject Gtk, Gnome, Gtk+, Gl, Gtk2, Gtk3…I don't understand?

故事扮演 提交于 2020-01-21 10:58:07
问题 all I need some window to host webkit or/and cairo drwaing, but i have to deal with all that first to understand what I'm doing. now. I'm lost and no more understand what's all that about. and things get worse when I try working with binding or trying to figure what are dependencies for something. for example: in python, pyGtk deprecated and replaced by pyGObject(sometimes called pyGl!!) there are many sites, many downloads and versions, mixed outdated and new references, but not one

In PyGTK, what is a simple way to show a PNG file?

夙愿已清 提交于 2020-01-14 13:32:13
问题 The following PyGTK code displays a PNG file in a window. Is there a simpler or better way of displaying the PNG file, like, by using a gtk.DrawingArea? For example, how do you resize the file? import gtk import pygtk pygtk.require('2.0') class Gui: def __init__(self): # Create an Image object for a PNG file. file_name = "file.png" pixbuf = gtk.gdk.pixbuf_new_from_file(file_name) pixmap, mask = pixbuf.render_pixmap_and_mask() image = gtk.Image() image.set_from_pixmap(pixmap, mask) # Create a

Porting GTK3.0 project to GTK2.0

我与影子孤独终老i 提交于 2019-12-24 17:35:29
问题 I am building a simple GUI application which I have successfully deployed and run on my Raspberry PI dev board. However, due to issues with OpenCV being dependent on GTK+ v2.0, I have to back-port my application to an old version of GTK+. I'm already familiar with changing include paths, and so on, and library linking orders in my makefiles. However, when I make all the necessary changes, a fatal error occurs during build. Building dependencies file for main.o In file included from /opt/rpi

How do I capture the selected row and column in a TreeView in PyGTK?

随声附和 提交于 2019-12-24 12:35:20
问题 I have a table created using gtk.TreeView . I want to know which row and column is selected by the user. How is this possible? 回答1: The methods for the rows you want are gtk.TreeSelection.get_selected or gtk.TreeSelection.get_selected_rows, depending on the selection method you have chosen (SELECTION_SINGLE, SELECTION_MULTIPLE OR SELECTION_BROWSE). http://www.pygtk.org/docs/pygtk/class-gtktreeselection.html#method-gtktreeselection--get-selected For columns you would work with gtk.TreeView.get

GTK+-based graph?

瘦欲@ 提交于 2019-12-20 12:38:38
问题 I want to be able to make a line graph using GTK+ but I'm unsure how to approach this. Has anyone got any hints or tips? 回答1: Have a look at the gnuplot there are some C++ libraries that interface with gnuplot, which do what you are looking for and then some. It is very easy to use if you've ever used gnuplot. 回答2: Edit: Here are GTK+ 2 and GTK+ 3 versions of that program: https://github.com/liberforce/gtk-samples/tree/master/c/gtk2-graph https://github.com/liberforce/gtk-samples/tree/master