gtk3

How do I handle keyboard events in GTK+3?

戏子无情 提交于 2020-01-01 18:54:07
问题 What signals/functions should I use to get keyboard input in GTK+3? I have looked around and the only tutorials I know of that cover GTK+3 (zetcode and gnome developer) don't seem to cover that. Anyone can point me in the right direction? 回答1: Thanks xing for your advice, It was really helpful. I was lost, hence my question that is perhaps too general to escape the traditional downvoting of part of the C community. I will summarize here how to handle keyboard events in GTK3, which I hope will

Is there a gi.repository documentation for python?

有些话、适合烂在心里 提交于 2019-12-31 09:10:23
问题 I'm looking for a gi.repository module documentation and I can't find anything on the internet. All I found is documentation of new Gtk3 libraries for C, or old PyGtk 2.0 Reference Manual I'm looking for something like PyGtk 2.0 Reference Manual but for Gtk3. Is there something similar for Python? (I'm not looking for dir(Gtk) or help(Gtk) in the Python console.) 回答1: I think you're looking for this. It's a work in progress, but basically is a tutorial for Gtk3 in python. I doesn't really

Setting Selected property of Row in TreeView dynamically in Gtk3 (python)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-31 05:10:19
问题 This is the same problem as in my previous question, but I moved to python3/gtk3 to be able to use a css for setting the basic properties. From the python file: self.w = Gtk.Window() self.w.set_name("App") I can use a css: #App GtkTreeView row:selected { border-color: #000000; border-top-width: 1px; border-bottom-width: 1px; color: #000; } And easily permanently change the style of the selection. To me this means that I should be able to dynamically get access to the row -object and its style

How to render SDL2 texture into GTK3+ window?

十年热恋 提交于 2019-12-29 10:07:04
问题 I am creating a music player and trying to use GTK3+ for creating user interface. I am using SDL_CreateWindowFrom function to let SDL2 use GTK3+ window rather than creating one but cann't figure out the steps I need to follow in order to render the SDL2 textures into GTK3+ window. Code getting GTK3 window ID window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "---"); gtk_widget_show(window); gdkWin = gtk_widget_get_window(GTK_WIDGET(window)); data-

Can I style GtkBox margin/padding with CSS only?

孤人 提交于 2019-12-29 08:55:12
问题 How can i make layout like this using CSS stylesheet for GTK app? Here is example code: #!/usr/bin/python import gi gi.require_version("Gtk", "3.0") gi.require_version("Gdk", "3.0") from gi.repository import Gtk, Gdk # Main application window # ======================= class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self) self.connect("delete-event", Gtk.main_quit) self.set_name("main-window") # load style from file cssProvider = Gtk.CssProvider() cssProvider.load_from

customizing completion of GtkComboBoxText

僤鯓⒐⒋嵵緔 提交于 2019-12-29 08:30:14
问题 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

How can I change the font size of a Gtk.Label in vala?

青春壹個敷衍的年華 提交于 2019-12-29 07:22:08
问题 I'm a Vala/Gtk newbie and I'm trying to change the font size of a Gtk.Label, but I can't find a good way to do it. I find out that I can use the markup like this : var welcome_message = new Gtk.Label ("<span size='17000'>Hello</span>"); welcome_message.set_use_markup (true); But it seems a little hackish. What is the right way to do it ? 回答1: You could try with css, I think lately this is the preferred way. Give your label a class, then load a css. If you are going to change the font size of

How can I change the font size of a Gtk.Label in vala?

浪尽此生 提交于 2019-12-29 07:21:01
问题 I'm a Vala/Gtk newbie and I'm trying to change the font size of a Gtk.Label, but I can't find a good way to do it. I find out that I can use the markup like this : var welcome_message = new Gtk.Label ("<span size='17000'>Hello</span>"); welcome_message.set_use_markup (true); But it seems a little hackish. What is the right way to do it ? 回答1: You could try with css, I think lately this is the preferred way. Give your label a class, then load a css. If you are going to change the font size of

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

时光总嘲笑我的痴心妄想 提交于 2019-12-28 22:07:52
问题 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? 回答1: GSettings looks at the compiled schemas in the directories pointed by the $XDG_DATA_DIR environment variable. You

Is there a easier way of creating a bordered Label in python Gtk3 than putting it in Frame?

萝らか妹 提交于 2019-12-25 15:53:13
问题 By easier i mean - can i define a style or something and apply it to all labels in my program? I have a lot of labels in it and I don't want to type so much. I heard about "Pango Style" but can I apply it to all label widgets at once? 回答1: The term: "lot of labels" is relative. Are we talking about 14 or 84? If it's closer to 84 you should probably be using Glade to create the interface then set the frames x-pad and y-pad properties. With CSS for gtk3 you'll have to pack any label in a frame