Re: Working with embedded images with GResource, GdkPixbuf and GtkWidget

2018-11-11 Thread infirit via gtk-app-devel-list
. ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: PyGObject: ask for system/theme colors

2018-09-15 Thread infirit via gtk-app-devel-list
style_context(). It hold the information you are looking for like font and colour information. You retrieve them with Gtk.StyleContext.get_property() with a Gtk.STYLE_PROPERTY_* property and Gtk.StateFlags.*. ~infirit ___ gtk-app-devel-list mailing list gtk-

Re: Own drag icon with same color and font settings as the default drag icon in a Gtk.TreeView

2018-09-15 Thread infirit via gtk-app-devel-list
Op 15-09-18 om 14:13 schreef infirit: > You use the Gtk.render_* range of functions. There is one for for every > type of content you will want to render onto a cairo surface. > > If you want to render text put it in a Pango.Layout and use > Gtk.render_layout(). Below is a modifie

Re: Own drag icon with same color and font settings as the default drag icon in a Gtk.TreeView

2018-09-15 Thread infirit via gtk-app-devel-list
nt you will want to render onto a cairo surface. If you want to render text put it in a Pango.Layout and use Gtk.render_layout(). ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Appending to treestore - how to set selection on new entry?

2018-08-28 Thread infirit via gtk-app-devel-list
r stored in column 2) Next is to get the selection from your view with gtk_tree_view_get_selection and call gtk_tree_selection_select_iter with the toplevel iter from earlier. It should now have selected the newly added row. ~infirit ___

Re: Using SVG for icons (and scaling)

2018-07-18 Thread infirit via gtk-app-devel-list
ace) rsvg_handle_render_cairo(svg, ctx) image = gtk_image_new_from_surface(surface) You may need to handle scale changes by listening to changes of the scale-factor property on the GtkWidget. ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.

Re: PyGObject: cell_data_func or own Renderer for date column?

2018-05-11 Thread infirit
ime):     super().__init__()     self._datetime = datetime     do_render(self, cr, widget, bg_area, cell_area, flags):     # implement your own rendering here ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: PyGObject: Which types accepted in a Gtk.ListStore

2018-05-11 Thread infirit
h it can’t accept all custom types However, if I remember correctly, in the bindings several native python types like int, float and str are mapped to GObject types automatically. ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.or

Re: GtkRevealer glitches the text view drawing

2018-05-04 Thread infirit
und it by queuing a resize which is worth a try. ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Set number of visible items for

2018-03-12 Thread infirit
Op 12-03-18 om 13:39 schreef Igor Korot: > On Mon, Mar 12, 2018 at 7:20 AM, infirit . <infi...@gmail.com> wrote: >> G > Does this suppose to mean something? Yes, don't forget to lock your phone before putting it in your pocket :-(. Sorry abo

Re: Set number of visible items for

2018-03-12 Thread infirit .
G Op 5 mrt. 2018 11:43 p.m. schreef "Igor Korot" : > Hi, ALL, > In Windows it is achievable thru > https://msdn.microsoft.com/en-us/library/windows/desktop/ > bb775915(v=vs.85).aspx. > > In OSX/Cocoa - thru >

Re: Accelerators for GtkNotebook to switch between pages

2018-02-03 Thread infirit
ead up on [1] for the details on getting/settings notebook pages. ~infirit [1] https://developer.gnome.org/gtk3/stable/GtkNotebook.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Scrolling a GtkTreeview cell

2018-01-24 Thread infirit
a specific size. I would try to drop that limitation and force the size on the parent instead and let the TreeView add scrollbars when needed. ~infirit ps: attachments are not allowed ___ gtk-app-devel-list mailing list gtk-app-devel-list@

Re: How do you tell another process which widget to put into a plug?

2018-01-18 Thread infirit
ire app into a window, > but I have not been able to find anything about how to embed a certain > widget. One approach is calling the app to be plugged into the socket with a command-line argument (eg --socket-id) . Another would be to set an environment variable but that is

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread infirit
ace in the GtkIconView.  You should be able to translate this pretty easily to C/C++. ~infirit [1] https://bugzilla.gnome.org/show_bug.cgi?id=765167#c5. ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread infirit
cairo surfaces at [1], maybe this helps. The moment you write to png and use it as source on a widget things go blurry. ~infirit [1] https://gist.github.com/infirit/7434371b93cf727f7517c4601df602b9 ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list

Re: Border of GtkTreeView through CSS

2017-08-24 Thread infirit
the widget the treeview was packed in. A common case is packing a treeview in a scrolledwindow and the css would then look like: scrolledwindow {   border-color: yellow;   border-style: solid;   border-width: 2px;   border-radius: 10px; } ~infirit __

Re: GdkPixbuf and click events

2017-08-03 Thread infirit
le button-press-event) and do what you want in a callback function. Note that you have to handle drawing yourself which the docs provide an example of. ~infirit [1] https://developer.gnome.org/gtk3/stable/GtkDrawingArea.html ___ gtk-app-devel-list mai

Re: GtkLabel max-width-chars with ellipsize broken?

2017-06-13 Thread infirit
On 10/06/17 19:39, cecas...@aol.com wrote: > Hi infirit, Hi > Give the hexpand a try and see if that works. It works for me on Python3.5 > and GTK3.18 Define works :) Does it limit to what was set as maximum width chars? When resizing does it use the available space to show mor

GtkLabel max-width-chars with ellipsize broken?

2017-06-10 Thread infirit
character with ellipses or just ellipses. Am I missing something? is this the correct way to force a certain width on the label? Thx ~infirit from gi.repository import Gtk, Pango class MyWindow(Gtk.Window): def __init__(self, *args, **kwargs): super().__init__(default_width=400, default_

Re: Live Thumbnail of Widgets

2017-06-02 Thread infirit
ich one usually draws on but I can imagine you could just as well create a pixbuf miniature. So, get the surface from the cairo context with cairo_get_target, then use gdk_pixbuf_get_from_surface to create the pixbuf. ~infirit ___ gtk-app-devel-list m

Re: A toggled toggle button visually almost indistinct from untoggled

2017-04-19 Thread infirit
color change remains slight. I modified your script and made the background in checked state red by loading some css. This is of course a silly example and you should adjust it to your needs but it shows how it is done. One option is to set a border colour. https://gist.github.com/i

Re: Weather API

2017-02-23 Thread infirit
is almost 2 years ago and looking at how broken they are today it seems nobody from the gnome team cares. Don't you think it is a shame that the python binding api docs for libgweather is better than the official ones? So I have no problem is saying gnome documentation suck

Re: Weather API

2017-02-23 Thread infirit
ions > sections. But they are empty, e.g.: > https://developer.gnome.org/libgweather/stable/GWeatherLocationEntry.html > Maybe someone needs to run GTK-Doc to create the manual? Yeah gnome documentation sucks. A reasonable C example can be found in gnome-applets [1]. ~infirit [1] https://gi

Re: GNOME Help Method

2017-02-14 Thread infirit
Op 02/15/2017 om 12:01 AM schreef infirit: > Op 02/14/2017 om 11:29 PM schreef Sascha Manns: >> actually i'm working on a new GNOME-App. >> The codebase is already done. Now i would like to implement a small >> method, which launches yelp with the installed apps helpfiles. &

Re: GNOME Help Method

2017-02-14 Thread infirit
in /yourappname [1]. Then have your app launch the uri relative to the docdir [2]. If you want to integrate this with your autotools build system see [3]. Several tools are available to help you create and edit the pages [4]. ~infirit [1] this is typically /usr/share/doc [2] example uri help://you

Re: gtk3 and fork/exec of non-gtk child

2017-01-14 Thread infirit
l interactions > between forking and system calls like malloc, or threading primitives. There is an example [1] under python that demonstrates why this is a problem quite well. Hope this helps. ~infirit [1] https://jameswestby.net/weblog/tech/14-caution-python-multiprocessing-and-glib-dont-mix.

Re: German "Umlaute" in drag and drop

2017-01-08 Thread infirit
ymbol, but it just shows me a messed up filename. > If you plan to do further processing or monitoring of the file you may want to look at a glib GFile [2] and use g_file_new_for_uri which will transparently unescape for you. If you just want to unescape the uri use g_uri_unescape_string [3]. ~infirit

Re: pango_scan_string() deprecation

2017-01-05 Thread infirit
the looks of it there is no intention just yet to remove it. And there is no replacement but its fairly simple and self contained so you could just copy [2] it and include it in your own code. ~infirit [1] https://bugzilla.gnome.org/show_bug.cgi?id=682840 [2] https://git.gnome.org/browse/pango/tree/pango/pango-uti

Re: Why GTK+ ignore, that someone want's to create own widget ?!

2016-12-13 Thread infirit
dkRGBA *color; gtk_style_context_get (GtkStyleContext, GtkStateFlags, "background-color", , NULL); gdk_rgba_free (color); ~infirit ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Why GTK+ ignore, that someone want's to create own widget ?!

2016-12-13 Thread infirit
ccomplish and others may have alternative solutions. My guess is that you were using the border colour to paint or set something to that colour. A possible option is to use your own CSS and loading it with a GtkCssProvider [1]. ~infirit [1] https://developer.gnome.org/gtk3/unstable/GtkCssProv

Re: Can we install a gtk program without root privileges?

2016-12-01 Thread infirit
nguage definition you can copy them to |~/.local/share/gtksourceview-3.0/language-specs/| and it should get picked up automatically, see [2]. With that you should be able to keep root out :-). ~infirit [1] https://developer.gnome.org/gio/stable/running-gio-apps.html

Re: SpinButton: how to avoid calling signal handler when set_value()

2016-11-03 Thread infirit
y code (when the dialog is > shown) and by the user (when he wants to change the volume speaker). So you need to keep properties in sync with each other, right? Binding widgets properties is possible even with some conversion, see [1]. As you refuse to give proper example code I'll leave it at t

Re: How does one add an item to the “recently used” file list (from Python)?

2016-10-08 Thread infirit
Op 10/08/2016 om 11:52 PM schreef Laurence Gonsalves: > On Fri, Oct 7, 2016 at 3:13 PM, infirit <infi...@gmail.com> wrote: >> That is how you do it, however you _require_ a main-loop running for >> this to work. Working example below. > ... >> from gi.reposit

Re: How does one add an item to the “recently used” file list (from Python)?

2016-10-07 Thread infirit
ection of Nautilus or in > file dialogs. It doesn't even show up in the results returned by > recent_mgr.get_items(). The call to add_item returned True. That is how you do it, however you _require_ a main-loop running for this to work. Working example below. ~infirit from gi.reposito

Re: Nim GTK3 editor

2016-07-10 Thread infirit
chema globally in /usr/share/glib-2.0/schemas/. Add --schemadir where you have the schema. ~infirit ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list

Re: Nim GTK3 editor

2016-07-10 Thread infirit
Op 07/10/2016 om 07:44 PM schreef Stefan Salewski: > On Sun, 2016-07-10 at 19:19 +0200, infirit wrote: >> You delete the whole file without restarting your session? Then you may >> expect breakage like this, it is like forcefully removing the file you >> are editing a

Re: Nim GTK3 editor

2016-07-10 Thread infirit
session or do it properly with "gsettings reset-recursively ". ~infirit ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list

Re: Changing the GtkTreeView Bar Color....

2016-07-04 Thread infirit
d {background-color: #D02B2B; color: #2B5FD0;} ~infirit ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list

Re: Tooltip over dark background

2016-06-14 Thread infirit
ttach the style provider to the GtkStyleContext ~infirit ___ gtk-list mailing list gtk-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-list

GtkTreeModelFilter: get_path function returns None

2016-03-27 Thread infirit
Hi All, I have been trying to implement a filter function for a GtkTreeStore and I run into a problem. In the below code example when I call 'get_path' on the TreeModelFilter object it returns None. I would have expected to see a TreePath. Am I missing something? Thx ~infirit import gi

dbus-glib to gdbus - interface question

2016-01-13 Thread infirit
terface = dbus.Interface(proxy, 'org.freedesktop.DBus.Properties') I tried calling Gio.DBusInterface in the same way but it takes no argument and is not "constructable". What would be the equivalent with gdbus? Thanks ~infirit sample code of the gdbus proxy object in python.