GtkIconView empty rows

2017-04-04 Thread zahlenmeer
Let's start with what I try to achieve in the end: I want to have a grid widget where I can freely fill the cells (so its possible - and likely - that there is empty space between the items) and have the same convenience for rendering (I just have to specify the label and the pixbuf, rendering

GtkIconView with custom icons

2017-03-28 Thread zahlenmeer
Usually, a GtkIconView uses a GtkTreeModel with a few important columns. A column of type G_TYPE_STRING for the label or the markup and a column of type GDK_TYPE_PIXBUF for the icon. In my application I have a G_TYPE_OBJECT derived object that resembles such an icon in the few, a row if you wish.

Re: Which icon for GTK_STOCK_EDIT?

2017-03-07 Thread zahlenmeer
On Tue, 07 Mar 2017 07:40:59 +0100 Tilo Villwock wrote: > Hello, > > I think when it comes to icons you're not supposed to use the stock > item facilities anymore. Exactly. That's why I am porting away from using them. > > and browse through the available icons. Once

Which icon for GTK_STOCK_EDIT?

2017-03-06 Thread zahlenmeer
Stock items are deprecated and the documentation mostly shows which named icon to use instead. Such information is missing for GTK_STOCK_EDIT (although I assume it is missing for a good reason). Now, I want to use an "edit" icon. Which one should I use? "gtk-edit" seems to work, but probably not

Re: Identifying monitors

2017-02-10 Thread zahlenmeer
On 02/09/17 18:23, Norbert de Jonge wrote: >> I save preferences per monitor > > I think giving us more context might be useful. What kind of things do > you save per monitor, and why? These are not things you could recreate > by scaling and positioning based on detected monitor dimensions? The

Identifying monitors

2017-02-09 Thread zahlenmeer
I am rephrasing my question from a few weeks ago to hopefully be more precise this time to get an answer: I save preferences per monitor and I want to load the matching settings for each monitor at application startup. However, I do not know how to reliably identify which plugged monitor matches

How to replace gdk_screen_get_monitor_at_window?

2017-01-23 Thread zahlenmeer
I am specifically interested in the number of the monitor, which is returned by gdk_screen_get_monitor_at_window. However, its advertised replacement gdk_display_get_monitor_at_window only returns the pointer to the monitor. My try would be: gint display_helper_get_monitor_num_at_window

Re: Debugging propagated events

2016-11-29 Thread zahlenmeer
I added some logic and after that I got a warning that there is a mismatch between cairo_save and cairo_restore. So I fixed that and I got it working. The cairo logic was faulty all the time but only some new lines of code triggered that warning. So I guess I was just lucky that I stopped

Re: Debugging propagated events

2016-11-28 Thread zahlenmeer
This was one of the first things I did. Debug compilation option, debug CFLAGS, no stripping - without a change. The backtrace only shows 3 lines, my draw function and two from libc. The faulty address is not null. But the segfault happens after the return where all local variables are no longer

Debugging propagated events

2016-11-28 Thread zahlenmeer
For a custom widget I have a draw function. I do some drawing there and when I am finished I return FALSE to let the parent draw. Immediately after the return statement I get a segfault. gdb's backtrace only shows my draw function and an address I cannot associate to any object. Are there some

Porting Gtk2 styles to Gtk3

2016-11-12 Thread zahlenmeer
I am struggling how to translate operators of the form color = >light[GTK_STATE_PRELIGHT]; into proper Gtk3. The documentation says: "One notable difference is the reduction from fg/bg/text/base colors to only foreground/background, in exchange the widget is able to render its various elements

Re: GtkApplication with different ApplicationWindows

2016-08-14 Thread zahlenmeer
I tested it with "normal" GtkWindows, and yes, they work the same way GtkApplicationWindows do. But in my case I have multiple application windows with different semantics. And this is not the intention behind GtkApplication. I guess I could make it work, but it would be really happy and result in

Re: GtkApplication with different ApplicationWindows

2016-08-13 Thread zahlenmeer
This is exactly what I thought of, but I also want to allow to run my program without the main window (like ./prog --task which only opens a task window). So I would have to run a GtkApplication without any GtkApplicationWindow. As the applications life cycle is tied to its ApplicationWindows this

GtkApplication with different ApplicationWindows

2016-08-13 Thread zahlenmeer
Hi everyone, I am working on a project where I am struggling to decide which classes/objects I should use. I use gtk3 but it's still a classical application, so no fancy appmenu, CSD and not primarily designed for the Gnome DE. The program works as follows: - A unique main window, with a main