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

2018-05-11 Thread infirit
Op 09-05-18 om 23:50 schreef c.bu...@posteo.jp:
> From the api-reference here
> 
>
> it is unclear for me what types are accepted for the columns.
> The parameter "*column_types" is not explained.
>

Quoting from the link.

>The |Gtk.ListStore|

can accept most |GObject.Object|

types as a column type, though 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.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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

2018-05-11 Thread infirit
Op 10-05-18 om 00:06 schreef c.bu...@posteo.jp:
> I want to have a date column in a Gtk.ListView. The field in the model
> is a real "datetime.date". Based on that the content of the column
> could display this:
>
>   "2018-05-07"
>   "2 days ago"
>   "this week"
>   "7th May"
>   "7. Mai '18"

Store this string in the Gtk.List/TreeStore, keep the datetime.date
somewhere and update the string when the user changes the date format.

I never used it but you may want to experiment with storing a GLib.Date
object.

> This is all based on the same "datetime.date" instance. The user decide
> how to display. So I need maximum flexibility.
>
> A cell_data_function is an option here to implement this. Is it a good
> choice?

You can of-course do all sorts of things and manipulate to your hearts
content but I think you are making it too complicated. You could have
two strings, one for the display and another that stores a version that
is easily parsed by the datetime module.

> What is about deriving from Gtk.CellRendererText?
> But I don't see how to do this. May I only overload the render()
> function? But how can I read from datetime.date object and convert it
> to a string?

You subclass and override the virtual methods [1] with your own. For
example something like below.

class MyRenderer(Gtk.CellRendereText):
    def __init__(self, datetime):
    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

Fwd: gtk_file_chooser_dialog in windows - hot to enable network places

2018-05-11 Thread Wojciech Puchar

nobody program for windows?



 Forwarded Message 
Subject:gtk_file_chooser_dialog in windows - hot to enable network 
places
Date:   Wed, 9 May 2018 09:39:34 +0200
From:   Wojciech Puchar 
To: gtk-app-devel-list list 



tried gtk_file_chooser_set_local_only to false and it doesn't change
anything.


Is it possible for gtk_file_chooser under windows to be able to browse
network locations?

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_file_chooser_dialog in windows - hot to enable network places

2018-05-11 Thread Luca Bacci
 Maybe you can try GtkFileChooserNative

You should be able to select network locations with that.

Luca

2018-05-11 13:16 GMT+02:00 Wojciech Puchar :

> nobody program for windows?
>
>
>
>
>  Forwarded Message 
> Subject:gtk_file_chooser_dialog in windows - hot to enable network
> places
> Date:   Wed, 9 May 2018 09:39:34 +0200
> From:   Wojciech Puchar 
> To: gtk-app-devel-list list 
>
>
>
> tried gtk_file_chooser_set_local_only to false and it doesn't change
> anything.
>
>
> Is it possible for gtk_file_chooser under windows to be able to browse
> network locations?
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_file_chooser_dialog in windows - hot to enable network places

2018-05-11 Thread Luca Bacci
Anyway GtkFileChooser uses GIO and GVFS
, which supports many protocols
, including SMB.
It's very likely that GtkFileChooser is able to browse network shares on
Windows.
Do you use MSYS2 or vcpkg?

2018-05-11 14:05 GMT+02:00 Luca Bacci :

> Maybe you can try GtkFileChooserNative
> 
> You should be able to select network locations with that.
>
> Luca
>
> 2018-05-11 13:16 GMT+02:00 Wojciech Puchar :
>
>> nobody program for windows?
>>
>>
>>
>>
>>  Forwarded Message 
>> Subject:gtk_file_chooser_dialog in windows - hot to enable
>> network places
>> Date:   Wed, 9 May 2018 09:39:34 +0200
>> From:   Wojciech Puchar 
>> To: gtk-app-devel-list list 
>>
>>
>>
>> tried gtk_file_chooser_set_local_only to false and it doesn't change
>> anything.
>>
>>
>> Is it possible for gtk_file_chooser under windows to be able to browse
>> network locations?
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>
>
>
___
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 c.buhtz
> However, if I remember correctly, in the bindings several native
> python types like int, float and str are mapped to GObject types
> automatically.

What exactly is "mapped" to GObject here?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


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

2018-05-11 Thread c.buhtz
>     do_render(self, cr, widget, bg_area, cell_area, flags):
>     # implement your own rendering here

How do I "render"? I have no idea about it.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

PyGObject Maybe bug with alternate row colors in a Gt.TreeView

2018-05-11 Thread c.buhtz
Please see this StackOverflow question.
https://stackoverflow.com/q/50281987/4865723

Is there an official bug about setup alternate (even & odd) row colors
with CSS in a Gtk.TreeView?

Can someone give a link to the bug ticket?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list