gtk3

How to make buttons different colours in Python GTK3 (using gi)?

拈花ヽ惹草 提交于 2019-11-29 15:13:44
问题 My latest head-scratcher is to build a silly little app in Python3 using GTK3, with colours other than fog-grey on the buttons. I have spent the last few days googling for how to do this, and so far everything I have tried has failed. Not just failed, but failed silently , with no error messages to give me any clue as to what is going on. This is my test app: from gi.repository import Gtk, Gdk class ButtonWindow(Gtk.Window): def __init__(self): super().__init__(title="Button Test") self.set

customizing completion of GtkComboBoxText

China☆狼群 提交于 2019-11-29 13:19:01
How can I customize the completion of a GtkComboBoxText with both a "static" aspect and a "dynamic" one? The static aspect is because some entries are known and added to the combo-box-text at construction time with gtk_combo_box_text_append_text . The dynamic aspect is because I also need to complete thru some callback function(s), that is to complete dynamically -after creation of the GtkComboBoxText widget- once several characters has been typed. My application uses Boehm's GC (except for GTK objects of course) like Guile or SCM or Bigloo are doing. It can be seen as an experimental

glDrawArrays not working. Using GtkGLArea in GTK3

时光总嘲笑我的痴心妄想 提交于 2019-11-29 12:31:28
I'm experimenting with using the GtkGLArea widget at the moment. None of the answers to similar questions seem to pertain to this situation. glClear() can set the background colour just fine but actually drawing arrays of triangles isn't. According to this tutorial, the code below should work. EDIT: 21/5/2015: Added shaders, still getting same results. New code below Here's the main.c and the SConstruct so you can build with scons: SOLVED: Working code under the heading SOLUTION: main.c the same SConstruct file can be used to build example main.c #include <stdlib.h> #include <stdio.h> #include

Compiling a GTK3 program in Visual Studio 2012

*爱你&永不变心* 提交于 2019-11-29 12:02:31
With the release of Gtk 3 for windows I thought of upgrading my Gtk 2 C application to take advantage of the new GtkGrid widget. The program compiles fine under linux or using MinGW (with codeblocks) under windows, however when I try the same set of files under Visual Studio 2012, giving me 50 or so compilation errors saying gutils.h, gtrashstack.h and gstring.h have a bunch of syntax errors (assuming I only use a basic program, with just a gtk_init and gtk_main). Visual Studio handled gtk2 very well. Why is it refusing to compile with gtk3? Any way to get it to work with it? As much as I love

How to draw a GdkPixbuf using GTK3 and PyGObject

╄→尐↘猪︶ㄣ 提交于 2019-11-29 06:47:17
I have a small application that uses a DrawingArea to draw a simple map using PyGObject and GTK3 . I load a Pixbuf using from gi.repository import Gtk, GdkPixbuf pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size("logo.png", 25, 25) and then try to draw it in the DrawingArea 's draw event signal def draw(self, widget, context): window = widget.get_window() ctx = window.cairo_create() ctx.set_source_pixbuf(pixbuf, 0, 0) but I get the error message "AttributeError: 'cairo.Context' object has no attribute 'set_source_pixbuf'" If I'm reading the Gtk2 to Gtk3 migration guide correctly, this should

how to set a specific css class to a widget in gtk3? (c)

做~自己de王妃 提交于 2019-11-29 03:48:09
I'm trying css in gtk3 and I don't understand how to use specific class. C code: provider = gtk_css_provider_new(); display = gdk_display_get_default(); screen = gdk_display_get_default_screen (display); gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_USER); gtk_css_provider_load_from_path(GTK_CSS_PROVIDER(provider),"styles.css",NULL); enter_button = gtk_button_new_with_label("Print"); g_signal_connect(G_OBJECT(enter_button), "clicked", G_CALLBACK(print_entry_dialog),&t_data); gtk_box_pack_start(GTK_BOX(hbox3), enter_button, TRUE,

How do I make a gtkwindow background transparent on Linux?

孤者浪人 提交于 2019-11-29 02:31:46
I would like to make the background transparent, and only the widgets are visible. Here is my code: #include <gtk/gtk.h> int main (int argc, char *argv[]) { gtk_init (&argc, &argv); GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); // Title gtk_window_set_title(GTK_WINDOW (window), "Transparency"); //gtk_window_set_opacity(GTK_WINDOW(window), 0.5); // CSS GtkCssProvider *provider = gtk_css_provider_new(); GdkDisplay *display = gdk_display_get_default(); GdkScreen *screen = gdk_display_get_default_screen(display); gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER

How do you install GTK+ 3.0 on Windows?

元气小坏坏 提交于 2019-11-28 18:15:31
Trying to setup GTK+ 3.0 on Codeblocks Win7. Having some trouble finding exactly how to do this. The GTK website directs you to msys2. It seems there was once a direct download on the GTK site for an all-in-one Windows bundle that is no longer there. Having followed the instructions, installed and updated msys2, I see no reference to GTK+, in the installed files or on the mysys website that GTK directs you to. Its seems very linuxy in terms of being unnecessarily and stupidly unclear to do something that should be simple. Maybe im missing something but should it not be as simple as downloading

Can I make Eclipse on Ubuntu look more compact? [duplicate]

馋奶兔 提交于 2019-11-28 15:40:16
Possible Duplicate: Gigantic Tabs in Eclipse on Ubuntu Back when I was using Eclipse on Ubuntu 10.04 LTS, I found that the tabs and bars used a bit too much vertical spacing, which made the interface a bit too spacey for my taste. However, I didn't find a good way to make this right, and I learned to work with it. But now, after installing Ubuntu 12.10 (or actually Linux Mint 14 Cinnamon), it has gotten even bigger, the vertical spacing. If you have three tabbed windows with two toolbars in your normal vertical workspace, this easily hides 6 lines of code with useless UI spacing, which I

GLib-GIO-ERROR**: No GSettings schemas are installed on the system

℡╲_俬逩灬. 提交于 2019-11-28 12:13:14
Unfortunately, I am using Windows (Windows7 x64). With MinGW compiler in Code::Blocks and GTK+3.6.4. I compiled manually all the schemas from glib. When I use File Chooser dialogue / colorpicker - it doesn't matter, I am getting the following error: GLib-GIO-ERROR**: No GSettings schemas are installed on the system and the program terminates. What do I have to do to fix this? GSettings looks at the compiled schemas in the directories pointed by the $XDG_DATA_DIR environment variable. You can either use a launcher script that sets up the environment for you, or you can rely on the prefix, and