Re: Treeview (liststore) CSS question

2019-03-18 Thread Daniel Kasak via gtk-app-devel-list
On Tue, Mar 19, 2019 at 3:01 AM Mike Martin via gtk-app-devel-list <
gtk-app-devel-list@gnome.org> wrote:

> Is it possible to set different background for a treestore, with a
> liststore, for populated rows v blank area.
>
> ie: If I have a dynamic treeview I would like to have one background colour
> for the rows and another for the treestore where there are no rows
>
> The particular example has the following tree
> Grid,Notebook,grid,scrolledwindow,treeview
>

Use set_cell_data_func:
https://developer.gnome.org/gtk3/stable/GtkTreeViewColumn.html#gtk-tree-view-column-set-cell-data-func

You'd have to do this for every GtkTreeViewColumn you wanted to colour.
Your callback would then fetch whatever value you want to use as a test (
ie to test whether the row is 'empty' or not ), and set the renderer's
"background' property to whatever colour you're after ( the callback get's
passed the renderer ).

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


Detecting the gdk backend

2019-02-06 Thread Daniel Kasak via gtk-app-devel-list
Hi all. Is there a way to detect the gdk backend an app is using? I know
about the environment variable - GDK_BACKEND. But often this is not set,
and gtk just picks whatever's available. I need ever-so-slightly different
app behaviour, depending on the backend. Any ideas?

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


Find path under mouse

2017-06-19 Thread Daniel Kasak
Hi all. Reposting from the gtk-perl list ... no responses there ...

Back in gtk+-2.x, I had some code that could find the path underneath
the mouse ( I was looking for double-click events in a treeview in
this case ):

---

my ( $self, $treeview, $event ) = @_;

if ( $event->type eq '2button-press' ) {

# A double-click event

if ( $event->window == $treeview->get_bin_window ) {

my ( $path, $column, $cell_x, $cell_y ) =
$treeview->get_path_at_pos ( $event->x, $event->y );

---

Now I'm doing something similar in gtk+-3.x. I've set up an event
handler for keypress events, and I'm successfully catching the CTRL-C
keypress event. But I don't see immediately how to get the path /
position under the mouse ...

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


Re: Glade crash

2017-03-02 Thread Daniel Kasak
There is no attachment. Try sharing it a different way - pastebin or
something.

Dan

On Wed, Mar 1, 2017 at 5:18 AM, pozzugno  wrote:

> Most probably this isn't the most appropriate mailing list, because I
> think my issue is related to Glade (and not Gtk libraries).
>
> Attached is one of my graphical interface, designed with Glade.
> Unfortunately when Glade opens this file, it seems it is very unstable if I
> try to change something.
>
> For example, let's try to delete the row in the fans_store GtkListStore
> object. Glade 3.20 will crash (at least in Windows).
>
> Do you understand why? I tried many things, even editing manually the
> .glade file with a text-editor. Many times, Glade wil crash during opening
> the edited file.
>
>
> ___
> 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: GTK3 Glade and rendering in Windows/Linux]

2017-02-02 Thread Daniel Kasak
I'm not sure of the licensing implications ( maybe there are none ),
but the current Ubuntu theme is implemented exclusively in css. If you
have a Ubuntu box, you can locate them in /usr/share/themes ( eg
/usr/share/themes/Ambiance/gtk-3.20 is one particular theme ). If you
copy these into the right directory ( depends on your gtk+ environment
), you can use them under Windows. Note that you'll need a theme
that's written for your gtk+ version - the theming spec is now stable
for current gtk-3.x.

Dan

On Wed, Feb 1, 2017 at 3:16 AM, Michael Torrie  wrote:
> On 01/31/2017 05:54 AM, Happy wrote:
>>
>> Thanks for the note. Hope the following links work. As you can see the
>> windows are much different in size as well as the spacing.
>>
>> Ubuntu:
>> https://drive.google.com/file/d/0BxjwKUaYdW_zYnUydWExX2NNdE0/view?usp=s
>> haring
>>
>> Windows:
>> https://drive.google.com/file/d/0BxjwKUaYdW_zeFhZdFYtelViUGM/view?usp=s
>> haring
>>
>> Glade.glade file:
>> https://drive.google.com/file/d/0BxjwKUaYdW_zYWY4UnZweDhRbGc/view?usp=s
>> haring
>>
>> Thanks
>
> The differences are due to different themes used.  If you used the same
> theme between Windows and Linux, the output should look near identical.
> But if you want it to look somewhat native on Windows, stick with the
> default Windows-ish theme there.  The Windows UI look and feel has
> gotten rather big and spaced out in recent years, so maybe the theme is
> just reflecting this.  Does your GTK+ GUI look very different than
> native Win32 apps?
>
> There's no reason I can think of to expect or want things to look pixel
> per pixel identical between different operating systems and desktop
> environments, though like I said you can do that by manually picking the
> same theme as you use on the other platform.  GTK's layouts are flexible
> and can adapt and adjust to many different sizes and spacings.
>
> Just a note that your Windows example appears to be scaled by Windows
> because of the UI DPI setting; you can turn that off by right-clicking
> on the executable and going to properties, compatibility and disabling
> the scaling option.
> ___
> 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: GTK3 Glade and rendering in Windows/Linux]

2017-01-31 Thread Daniel Kasak
Neither of your messages had any attachments. Probably they're
stripped out by the mailing list server. If you're trying to point
people to files, screenshots, etc, try  chucking them on a blog or
pastebin or something.

Dan

On Sun, Jan 29, 2017 at 12:44 PM, Happy  wrote:
>
> Attached is a glade file. These render as seen in the attachments in
> Windows and Ubuntu(16.10). In Windows(10) the window is far larger as
> well as is for the spacing. It there a away to get the spacing and size
> down alike the rendering in Windows ? I guess this is not so much
> related to glade but more towards GTK, but if this assumption is wrong,
> then apologies for posting.
>
> ___
> 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: The Big Gtk limitations: a reliable GUI builder

2016-11-30 Thread Daniel Kasak
On Thu, Dec 1, 2016 at 12:32 AM, Pozz Pozz  wrote:

> So this is a Windows only *Gtk* bug, it isn't related to Glade.
> Considering it affects all drag operations for every Gtk applications,
> it's very strange it wasn't fixed yet.
>
> My first impression is Gtk is a product for Linux applications. Using Gtk
> for Windows-only application isn't so smart... I don't know why I selected
> Gtk as my Windows GUI framework.

Frankly, this attitude will get you nowhere, fast. If I was at all
inclined to investigate and further assist, that motivation just
evaporated.

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


Re: The Big Gtk limitations: a reliable GUI builder

2016-11-29 Thread Daniel Kasak
I can confirm both these bugs ( crash copying the treeview, margins
not rendered under altering properties ) under Linux. Actually the top
and bottom margins are rendered immediately, but the left and right
margins need you to alter them before they're rendered correctly.
Sounds like a pretty simple fix for this one. No idea why the treeview
is crashing for you - you've possibly gotten the XML file into an
invalid state that Glade doesn't like. Anyway, you should enter these
in bugzilla :)

I don't drag + drop either - I just cut/copy/paste things around.

Re: the treeview being rendered with 0 space ... you can set it to
'expand' and it should take up some space ... either that or set a
minimum width.

My normal workflow is to lay things out *roughly* in glade, then
actually run the app and see what it looks like. This is partly
because I'm writing database apps and generating lots of content based
on dynamic data. It really doesn't take long to switch back to glade,
tweak things, then re-open the app ( or window ) and see the results.

Dan

On Wed, Nov 30, 2016 at 10:28 AM, pozzugno <pozzu...@gmail.com> wrote:
> First of all, I'm using Glade 3.20.0 for Windows, installed through Msys2
> project. I don't know if Glade is more stable under Linux OS.
>
> When I open a file, non-null margins aren't rendered correctly. Take a look
> at the screencast [1]. As soon as I change one margin (from 10 to 11, for
> example), it is rendered correctly.
>
> Another problem, is very difficult to drag one or more widgets (under a
> sub-tree) between two places. When I click on a widget (or container) and
> start moving, the mouse pointer disappears at all, so the target place is
> very difficult to find (see [2]). During dragging movement, something
> appears at the top-left corner of the window.
>
> It is very simple to have a crash when working with Treeviews. Open the
> attached file, select the Treeview, press Ctrl+C (or select Copy) and...
> puff! Other times Glade crashes when I try to create a column in the
> Treeview.
>
> When I copy a box filled with widgets from one container to another
> container, it seems the margins value aren't copied. I don't know if there
> are other parameters that aren't copied.
>
> Daniel, you wrote you don't populate liststore associated to treeviews. I
> agree with you, but if you don't populate the associated liststore (at list
> the columns description), the treeview is rendered with zero space. Even if
> you add columns in the treeview, you need to associated a compatible
> liststore to see the real effect.
>
> Those are bugs related strictly to Glade, so this post could be off-topic
> for this mailing list. However my goal wasn't to list all the bugs I found
> in Glade, but to understand if my Gtk/Glade workflow/setup is wrong someway.
>
>
> [1]
> https://drive.google.com/file/d/0B1s7dNPGsJ3CQmpxTTVfZkZfdFE/view?usp=sharing
> [2]
> https://drive.google.com/file/d/0B1s7dNPGsJ3CQmpxTTVfZkZfdFE/view?usp=sharing
>
>
>
> Il 29/11/2016 23:08, Daniel Kasak ha scritto:
>>
>> Glade crashes sometimes, yes. It's been much better recently - 3.20
>> seems pretty stable for me. I don't edit liststores in glade at all,
>> so I can't comment on that - I construct and populate them
>> dynamically, and use glade just to place the treeview. I don't really
>> have the other issues you're talking about. I can move things around
>> freely without issues - cut and paste. I've written quite a few apps
>> over the past 15 or so years, using glade and gtk ( 2 and 3 ) - most
>> recently an ETL framework's UI - this is quite a complex beast. No pen
>> and paper involved. No QT either. Maybe record a screencast of your
>> issues so we can get an idea of what you're doing wrong.
>>
>> Dan
>>
>> On Wed, Nov 30, 2016 at 3:51 AM, Pozz Pozz <pozzu...@gmail.com> wrote:
>>>
>>> I don't know why, but some weeks ago I selected Gtk as my next GUI
>>> framework to learn. After some work, I have a very big issue: the
>>> associated GUI builder Glade is not stable at all.
>>>
>>> Many times, when I work with Treeview and Liststore, Glade crashes. I
>>> can't
>>> press Ctrl+C to copy a sub-tree to another place.
>>> The render is not good: margins aren't shown correctly after loading the
>>> file.
>>> It's impossible to move widgets from one place to another (maybe from one
>>> box element to a grid element).
>>>
>>> I know I can design the GUI directly in the code, but it's a big effort
>>> for
>>> me. Usually my GUIs are full of widgets and I'd like to preview them.
>>>
>>> How do you create com

Re: The Big Gtk limitations: a reliable GUI builder

2016-11-29 Thread Daniel Kasak
Glade crashes sometimes, yes. It's been much better recently - 3.20
seems pretty stable for me. I don't edit liststores in glade at all,
so I can't comment on that - I construct and populate them
dynamically, and use glade just to place the treeview. I don't really
have the other issues you're talking about. I can move things around
freely without issues - cut and paste. I've written quite a few apps
over the past 15 or so years, using glade and gtk ( 2 and 3 ) - most
recently an ETL framework's UI - this is quite a complex beast. No pen
and paper involved. No QT either. Maybe record a screencast of your
issues so we can get an idea of what you're doing wrong.

Dan

On Wed, Nov 30, 2016 at 3:51 AM, Pozz Pozz  wrote:
> I don't know why, but some weeks ago I selected Gtk as my next GUI
> framework to learn. After some work, I have a very big issue: the
> associated GUI builder Glade is not stable at all.
>
> Many times, when I work with Treeview and Liststore, Glade crashes. I can't
> press Ctrl+C to copy a sub-tree to another place.
> The render is not good: margins aren't shown correctly after loading the
> file.
> It's impossible to move widgets from one place to another (maybe from one
> box element to a grid element).
>
> I know I can design the GUI directly in the code, but it's a big effort for
> me. Usually my GUIs are full of widgets and I'd like to preview them.
>
> How do you create complex GUIs? Do you really use pen and paper and write
> it directly in code?
>
> IMHO this is a very big limitation and I'm tempted to migrate to QT
> libraries, even if I loose many working days.
> ___
> 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 glade SQLite Problem

2016-10-24 Thread Daniel Kasak
Have a look at one of my projects. They're in Perl, but the logic flow
is the same:

http://search.cpan.org/~dkasak/Gtk3-Ex-DBI-3.2/lib/Gtk3/Ex/DBI/Form.pm

Briefly, there are issues in your example code. In insert_sqlite() you
need to fetch values back from your builder object. In perl, you'd do
that like:

$builder->get_object( 'some_widget_name' )->get_value

 ... assuming the widget actually has a 'get_value' method. Some
widgets will have other ways of getting at their values. Sorry - I'm
not a huge Python fan. Maybe there are some libraries you can leverage
already. I've actually considered porting my 'form' and 'datasheet'
classes to Python, but ... well ... I'm not a huge Python fan :)

If you're going to push ahead, first implement and test the logic to
insert a record into SQLite, with some hard-coded values. Then
implement the logic to fetch values from your builder object. Then
combine the 2.

Dan

On Mon, Oct 24, 2016 at 4:34 PM, Sangram Kakade
 wrote:
> Hello Everyone,
>
> I am Newbie in Python and i want some help
> I already created DB and in glade two Text Entry Box and one button
> and i want when i put some value in text entry it must be stored in db
>
> here is my code:
>
> import gi
> gi.require_version('Gtk', '3.0')
> from gi.repository import Gtk
> import sqlite3
> import sys
>
>
> class Handler:
>
> def insert_sqlite():
> connection = sqlite3.connect('mydatabase')
> cursor = connection.cursor()
> sql ="INSERT INTO person_info (name,lastnm) VALUES ('%s','%s')"
> cursor.execute(sql)
> data = cursor.fetchall()
>
> for d in data:
> print(d)
>
>
> connection.commit()
> connection.close
>
>
> def display_details():
> connection = sqlite3.connect('mydatabase')
> cursor = connection.cursor()
> sql = "SELECT * FROM person_info "
> cursor.execute(sql)
> data = cursor.fetchall()
>
> for d in data:
> print(d)
>
> connection.commit()
> connection.close
>
>
> builder = Gtk.Builder()
> builder.add_from_file("cool.glade")
> builder.connect_signals(Handler())
> window = builder.get_object("window1")
> window.show_all()
>
> Gtk.main()
>
>
>
> I also set signal in glade
> clicked signal( insert_sqlite)
> on save button
>
> but data is not save in Database
> Please Help me guys
> --
> Thanks & Regards,
> Sangram Kakade 
> Python/Django Developer
> Mob.No. 9975159162 / 8796535503
> ___
> 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


Transparent proxy / multiplexing for Gtk+ / broadway applications

2016-10-04 Thread Daniel Kasak
Hi all.

I've written a blog post with an approach that I've just gotten
working for transparent proxying of broadway applications ... so you
can have a single port ( eg https ) open, and proxy each client to
their own broadway instance.

It's not pretty, but it works :)

http://tesla.duckdns.org/transparent-proxy-for-broadway-gtk3-html5-backend/

There is some example code and instructions for how to set things up.

Hopefully someone finds it useful :)

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


Re: GtkStack and needs-attention property

2016-08-08 Thread Daniel Kasak
OK never mind. I've found this one myself:

https://developer.gnome.org/gtk3/stable/GtkContainer.html#gtk-container-child-set-property

On Tue, Aug 9, 2016 at 10:03 AM, Daniel Kasak <d.j.kasak...@gmail.com> wrote:
> Hi all.
>
> I can see how to set the 'needs-attention' property while creating and
> adding children to a GtkStack. However I don't see how to set the
> 'needs-attention' property once all widgets are constructed.
>
> If I later use 'gtk_stack_get_child_by_name' I can get the widget that
> I added to the stack ( in my case, a GtkBox ), but can't set the
> 'needs-attention' property on it:
>
> Gtk3::Box does not support property 'needs-attention'.
>
> Is there a way to do this?
>
> Dan
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GtkStack and needs-attention property

2016-08-08 Thread Daniel Kasak
Hi all.

I can see how to set the 'needs-attention' property while creating and
adding children to a GtkStack. However I don't see how to set the
'needs-attention' property once all widgets are constructed.

If I later use 'gtk_stack_get_child_by_name' I can get the widget that
I added to the stack ( in my case, a GtkBox ), but can't set the
'needs-attention' property on it:

Gtk3::Box does not support property 'needs-attention'.

Is there a way to do this?

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


Re: Re[2]: argv revisited

2016-05-08 Thread Daniel Kasak
On Mon, May 9, 2016 at 2:24 AM, Andrew Robinson  wrote:

> Because you are entertaining.

Ditto. In fact every single one of your posts has had multiple dummy
spits. Your particular balance of begging for more help vs pouring
scorn on those who try to help is unique. Where else do you post? I
must subscribe there too ...

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


Remote gtk3 app rendering issues

2016-04-20 Thread Daniel Kasak
Greetings all. I have a bizarre issue that makes me wonder if I
understand how remote X applications work ...

I'm running Sabayon Linux on my dev laptop. My work has a bunch of
Ubuntu 14.04 LTS servers. When I ssh into a server and run a gtk3 app,
it renders widgets in a horrible 3.1 style, and many icons are
missing.

But if I tar up /usr/share/themes/Ambiance on the server, and dump it
into my ~/.themes on my laptop, the widgets render in the 'Ambiance'
theme - but *only* if I *also* tell my local window manager (
Enlightenment ) to use the Ambiance theme. I usually use the Adwaita
theme. I see that Ubuntu 14.04 LTS doesn't have the Adwaita theme -
maybe it's too old for this?

What's going on here? I thought the X client did all the rendering,
and pushed pixmaps to the ( in this case, remote ) X server. But
clearly resources on my laptop are being used here.

Perhaps I'm approaching things incorrectly? What's the "recommended"
way of running remote ( gtk3 in particular ) apps and having them
render nicely - ie as they would if I was actually on the server I'm
ssh'd in to?

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


Re: Get a list of object *names* from GtkBuilder

2015-11-26 Thread Daniel Kasak
OK so based on Emmanuele's suggestion ( thanks, by the way ), I've
done it like this, which is dodgy, but still pretty simple, and could
be of use for others who might bump into this thread with similar
requirements.

First, in the abstract 'window' class, I've got a global variable to
store the names of GtkPaned widgets:

---

my @all_gtkPaned_names;

---

Then just after I've generated a window from a gtkBuilder file, I go:

@all_GtkPaned_names = ();

if ( $window->{options}->{builder_path} ) {

my $xml_parser = XML::Parser->new( Style => 'Subs', Pkg => 'window' );
my $whatever   = $xml_parser->parsefile(
$window->{options}->{builder_path} );

}

foreach my $paned_name ( @all_GtkPaned_names ) {

my $state_name = $class . ':' . $paned_name . ':position';
my $state = $globals->{config_manager}->simpleGet( $state_name );
my $widget = $window->{builder}->get_object( $paned_name );

if ( $state ) {
$widget->set_position( $state );
}

$widget->signal_connect(
notify  => sub { $window->save_gtkPaned_state( @_,
$state_name ) }
);

}

---

Then I have a *static* *function* ( ie not a method ) in the same
class, which gets called by XML::Parser because of the options passed
to its constructor ( ie the style and pkg ):

---

sub object {

my ( $expat, $object, $class, $gtk_object_class, $gtk_object_name,
$gtk_object_name ) = @_;

if ( $gtk_object_class eq 'GtkPaned' ) {
push @all_GtkPaned_names, $gtk_object_name;
}

}

---

In here I'm obviously just appending to the global list of widgets.

I've also got:

---

sub save_gtkPaned_state {

my ( $self, $widget, $some_boolean_thing, $state_name ) = @_;

$self->{globals}->{config_manager}->simpleSet( $state_name,
$widget->get_position );

}

---

That's pretty much it ( I think ). Hopefully it's useful to someone.

I still think it would be handy to be able to enumerate over the list
of widget names without having to use an external parser, but I
concede it's kinda a corner case, and not too difficult to work
around.

Dan

On Wed, Nov 18, 2015 at 12:14 PM, Daniel Kasak <d.j.kasak...@gmail.com> wrote:
> I anticipated this question :)
>
> Here's what I'm trying to do ...
>
> I've got an abstract 'window' class that handles loading windows from
> a builder file, and attaching some convenience functions and stuff. I
> want to save the state of various things in a SQLite database. For
> example, GtkPaned positions are causing me issues on different
> resolutions and DPIs. So I'd like to be able to do:
>
> foreach my $item ( $window->{builder}->get_objects() ) {
> if ( ref $item eq "Gtk3::Paned" ) {
> my $name = $item->get_name;
> my $state_name = $class . ':' . $name . ':position';
> my $state = $globals->{config_manager}->simpleGet( $state_name
> ); # simpleGet fetches from a SQLite key/value pair config db
> $item->set_position( $state );
> }
> }
>
>  ... on startup. I'd of course have signals on the 'notify' signal of
> each Gtk3::Paned to save the state each time it's altered ( with some
> work-arounds for initial state ). This code would similarly have to
> know the name of each item, so it could write it to the SQLite DB.
>
> I've done this all manually for a couple of widgets ( ie by having
> special code per widget ), but being able to do it generically as
> above would be a far better solution. Thoughts?
>
> Dan
>
>
> On Tue, Nov 17, 2015 at 4:57 AM, Emmanuele Bassi <eba...@gmail.com> wrote:
>> Hi;
>>
>> On 16 November 2015 at 02:26, Daniel Kasak <d.j.kasak...@gmail.com> wrote:
>>> Greetings all.
>>>
>>> I'd like to get a list of object names from a GtkBuilder object ( I'm
>>> using Perl ). I know about
>>> https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-get-objects
>>> - which returns a list of objects, but I really need the names. Is it
>>> possible?
>>
>> The question would be "why do you think you need the names from the
>> XML, considering you wrote the XML definitions in the first place" —
>> i.e. since you're the author, you're supposed to already know those
>> names, not figure them out programmatically.
>>
>> In practice, you could load up the XML yourself and figure those names
>> out using the XML::Parser or XML::LibXML modules in Perl; but the
>> question betrays some confusion as to what GtkBuilder UI definition
>> files are, and how they are used, so it's probably better for you to
>> answer the question: what is it that you're trying to achieve?
>>
>> Ciao,
>>  Emmanuele.
>>
>> --
>> https://www.bassi.io
>> [@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Get a list of object *names* from GtkBuilder

2015-11-17 Thread Daniel Kasak
I anticipated this question :)

Here's what I'm trying to do ...

I've got an abstract 'window' class that handles loading windows from
a builder file, and attaching some convenience functions and stuff. I
want to save the state of various things in a SQLite database. For
example, GtkPaned positions are causing me issues on different
resolutions and DPIs. So I'd like to be able to do:

foreach my $item ( $window->{builder}->get_objects() ) {
if ( ref $item eq "Gtk3::Paned" ) {
my $name = $item->get_name;
my $state_name = $class . ':' . $name . ':position';
my $state = $globals->{config_manager}->simpleGet( $state_name
); # simpleGet fetches from a SQLite key/value pair config db
$item->set_position( $state );
}
}

 ... on startup. I'd of course have signals on the 'notify' signal of
each Gtk3::Paned to save the state each time it's altered ( with some
work-arounds for initial state ). This code would similarly have to
know the name of each item, so it could write it to the SQLite DB.

I've done this all manually for a couple of widgets ( ie by having
special code per widget ), but being able to do it generically as
above would be a far better solution. Thoughts?

Dan


On Tue, Nov 17, 2015 at 4:57 AM, Emmanuele Bassi <eba...@gmail.com> wrote:
> Hi;
>
> On 16 November 2015 at 02:26, Daniel Kasak <d.j.kasak...@gmail.com> wrote:
>> Greetings all.
>>
>> I'd like to get a list of object names from a GtkBuilder object ( I'm
>> using Perl ). I know about
>> https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-get-objects
>> - which returns a list of objects, but I really need the names. Is it
>> possible?
>
> The question would be "why do you think you need the names from the
> XML, considering you wrote the XML definitions in the first place" —
> i.e. since you're the author, you're supposed to already know those
> names, not figure them out programmatically.
>
> In practice, you could load up the XML yourself and figure those names
> out using the XML::Parser or XML::LibXML modules in Perl; but the
> question betrays some confusion as to what GtkBuilder UI definition
> files are, and how they are used, so it's probably better for you to
> answer the question: what is it that you're trying to achieve?
>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Get a list of object *names* from GtkBuilder

2015-11-15 Thread Daniel Kasak
Greetings all.

I'd like to get a list of object names from a GtkBuilder object ( I'm
using Perl ). I know about
https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-get-objects
- which returns a list of objects, but I really need the names. Is it
possible?

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


Re: gtk3 (GtkTextView) and MacOS

2015-02-25 Thread Daniel Kasak
Sorry to wander slightly away from the original topic, but I'm also
building gtk3 for OSX using jhbuild, and I've found a bunch of issues with
themes and icons and fonts, as per the above discussion. I'm wondering
where the 'responsibility' of setting up a nice vanilla configuration lies?
Would this be in, eg, jhbuild? It would be good to nail these issues so
people can more easily build cross-platform apps.

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

Re: GtkHeaderBar, broadway window manipulation ( moving, resizing ) with broadway

2015-02-17 Thread Daniel Kasak
Thanks :)

On Tue, Feb 17, 2015 at 6:34 PM, Jerome Flesch jfle...@gmail.com wrote:

 Hello,

 I'm also currently playing with GtkHeaderBars.
 In order for it to work, you must specify that the headerbar is a
 child of type titlebar. I did it in the XML directly, so I'm not
 sure how you can specify it in code.

 Here is an example:
 * the GtkApplicationWindow:

 https://github.com/jflesch/paperwork/blob/ff333d488f40acfd58b9a7cf58310c5ef1b13bef/src/paperwork/frontend/mainwindow/mainwindow.glade#L209
 * the child tag:

 https://github.com/jflesch/paperwork/blob/ff333d488f40acfd58b9a7cf58310c5ef1b13bef/src/paperwork/frontend/mainwindow/mainwindow.glade#L215
 * the header bar:

 https://github.com/jflesch/paperwork/blob/ff333d488f40acfd58b9a7cf58310c5ef1b13bef/src/paperwork/frontend/mainwindow/mainwindow.glade#L231



 2015-02-17 2:40 GMT+01:00 Daniel Kasak d.j.kasak...@gmail.com:
  Greetings.
 
  I just tried using a GtkHeaderBar in a window in my app. I'm using Glade,
  which doesn't support GtkHeaderBar yet, so I've generated the
 GtkHeaderBar
  in code, and in Glade, disabled the 'Decorated' checkbox for the window.
 I
  believe this is the proper way of disabling the window manager's title
 bar
  ... and I've told the GtkHeaderBar to include the Close Window button.
 
  It works great running under X. When I try it out in broadway, I can't
 move
  *or* resize windows, which is a deal-breaker for GtkHeaderBar
  functionality. I can move the window in code - which is OK for a single
  window, but not really good enough if there will be multiple windows.
 
  Is this a known issue? Is there something I'm missing to allow moving 
  resizing under broadway? I should note that if I *don't* use the
  GtkHeaderBar, I can move and resize windows under broadway.
 
  Dan
  ___
  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


GtkHeaderBar, broadway window manipulation ( moving, resizing ) with broadway

2015-02-16 Thread Daniel Kasak
Greetings.

I just tried using a GtkHeaderBar in a window in my app. I'm using Glade,
which doesn't support GtkHeaderBar yet, so I've generated the GtkHeaderBar
in code, and in Glade, disabled the 'Decorated' checkbox for the window. I
believe this is the proper way of disabling the window manager's title bar
... and I've told the GtkHeaderBar to include the Close Window button.

It works great running under X. When I try it out in broadway, I can't move
*or* resize windows, which is a deal-breaker for GtkHeaderBar
functionality. I can move the window in code - which is OK for a single
window, but not really good enough if there will be multiple windows.

Is this a known issue? Is there something I'm missing to allow moving 
resizing under broadway? I should note that if I *don't* use the
GtkHeaderBar, I can move and resize windows under broadway.

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


Re: draw on textview, gtk3 3.14

2015-02-16 Thread Daniel Kasak
Not answering your question, but just FYI there are win32 binaries around.
I have Gtk-3.14.3 ( bundled with Perl and other stuff ) at:
http://tesla.duckdns.org/gtk3-perl-windows/ - in the JewelKit package.
Sorry I don't have the time to unbundle gtk from everything else at this
point.

I believe other people have their own Gtk3 binaries around, and build
scripts as well. I have build instructions ... not quite at the level of
having build scripts yet.

Dan

On Tue, Feb 17, 2015 at 3:13 AM, Gilzad Hamuni gil...@gmx.net wrote:

 Hi list,

 I'm trying to draw lines on a text view.

 In my current solution I have placed a transparent drawing area on top of
 the text view. This does work unless the compositor is different from
 mutter (I guess). As a result in XFCE the drawing area isn't transparent
 while in Cinnamon and Unity I get the expected result.

 Someone who used gtk2 managed to draw into the textview's 'expose-event' (
 http://stackoverflow.com/questions/2027379/draw-lines-on-gtk-textview ).
 But using gtk3's 'draw-event' I can't come any close to his approach.
 'drawable' has been abandoned and if I do anything inside the 'draw-event',
 the whole content of the textview will be replaced by the new cairo buffer.
 Anyway to mix the old content?

 I realized there's a 'draw_layer()' virtual function in gtk 3.14 and using
 it with the condition 'GTK_TEXT_VIEW_LAYER_ABOVE' is very much what I need.
 But I don't think I can update my libraries that easily, especially because
 I need to create win32 compiles of my app soon.

 So if you can point me to a way on how to draw lines on a textview using
 gtk3 but without the need of a compositing manager and without new versions
 like 3.14, I'd be very glad.

 My gtk3 lib is 3.8, I'm using Vala but I'll be glad about any C- or
 Python-example as well. I should be able to adopt it after all.

 Thanks a bunch in advance.

 gilzad

 ___
 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_progress_bar thickness related to theme?

2014-11-14 Thread Daniel Kasak
Progress bars got a LOT thinner recently - I think in gtk-3.14.x? This is
even with text in them. I don't know if there is an easy way to revert to
the old appearance.

Dan

On Sat, Nov 15, 2014 at 8:20 AM, rastersoft ras...@rastersoft.com wrote:

 Hi:

 Try to set a text into the bar.

 El 14/11/14 a las 21:35, Mark Cianfaglione escribió:

  I've developed an application using GTK3 and the theme seems to be more
 important on the look and feel than with GTK2.

 In my GTK3 application (for Windows 64 using MinGW-w64) the
 gtk_progress_bar is thin. Is the thickness of the progress bar related
 to the theme? (I only have Adwaita)

 How would you change the theme for a compiled app that will be
 distributed on Windows? (Without having to install MSYS2 or MinGW=W64)

 Mark




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


 --
 Nos leemos
  RASTER(Linux user #228804)
 ras...@rastersoft.com  http://www.rastersoft.com


 ___
 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+-3.14.x - icons super sized

2014-11-04 Thread Daniel Kasak
Maybe this is an icon-theme issue. It seems to be strictly isolated to the
icon them ubudao-style-1.4.5.

Sorry for the noise.

Dan

On Sun, Oct 26, 2014 at 3:59 PM, Daniel Kasak d.j.kasak...@gmail.com
wrote:

 Hi all. I'm back with more icon issues. Sorry :)

 I've just built glib ( gtk+ wanted a newer version )  gtk+ on Gentoo by
 bumping the ebuild version numbers and using emerge. I build manually to
 enable the broadway backend. I just came from gtk+-3.12.2.

 In pretty much all cases using X11 now, my icons are HUGE. This happens in
 my own applications, and also in apps like Glade - ie the menu bar.
 Interestingly, the icons render at the correct size when using the broadway
 backend.

 Example:
 http://tesla.duckdns.org/images/x11_vs_broadway.png

 In this particular example, I've used Glade to create the buttons with
 icons. Other cases though - where I construct things in code, are similarly
 affected. Example code:

 my $icon   = Gtk3::Image-new_from_icon_name( $this_item-{icon_name},
 button );

 I assume this change is not to be expected? Any ideas?

 Dan

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


gtk+-3.14.x - icons super sized

2014-10-25 Thread Daniel Kasak
Hi all. I'm back with more icon issues. Sorry :)

I've just built glib ( gtk+ wanted a newer version )  gtk+ on Gentoo by
bumping the ebuild version numbers and using emerge. I build manually to
enable the broadway backend. I just came from gtk+-3.12.2.

In pretty much all cases using X11 now, my icons are HUGE. This happens in
my own applications, and also in apps like Glade - ie the menu bar.
Interestingly, the icons render at the correct size when using the broadway
backend.

Example:
http://tesla.duckdns.org/images/x11_vs_broadway.png

In this particular example, I've used Glade to create the buttons with
icons. Other cases though - where I construct things in code, are similarly
affected. Example code:

my $icon   = Gtk3::Image-new_from_icon_name( $this_item-{icon_name},
button );

I assume this change is not to be expected? Any ideas?

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


x11 vs broadway - icon theme

2014-10-25 Thread Daniel Kasak
Yet another icon issue.

The screenshot is the same as in my previous issue:
http://tesla.duckdns.org/images/x11_vs_broadway.png

When my app is using X11, gtk+ is using my selected icon theme, but when
using broadway, I'm getting the default icon theme. Why? I'm launching both
from a terminal with the same environment variables, other than
GDK_BACKEND. Do I have to set another environment variable under broadway
for the icon theme?

Thanks :)

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


http links in broadway

2014-07-11 Thread Daniel Kasak
Hi all.

I'm writing a simple broadway session manager. It starts out in modperl -
which looks for an available broadway session, then launches a new broadway
instance, then launches a gtk3 app in that broadway instance. From there,
the idea is there'll be more complicated stuff going on - authenticating
against a DB, showing a list of running applications, allowing
authenticated users to connect to existing sessions or kill them, spawning
new sessions  applications.

I realise this isn't the most efficient way of doing things, but I'm not a
modperl / html person, and this is much easier for me. It's not intended
for a high volume site, obviously.

All this is working up to the point where I need to redirect the browser to
a new URL. I should have thought this through more at the start I guess. If
I have a user viewing a Gtk3 'session manager' app in their browser, how do
I then, from inside that Gtk3 app, redirect the browser to a new URL? Is
this possible? I've tried a LinkButton, but that seems to want to spawn a
new firefox process on the server, which isn't really what I'm after.

If someone can help me out, I'd be SO grateful that I'd open-source this so
others have an easy way to deploy gtk3 apps via broadway :)

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


Re: Redistribution of GTK DLLs

2014-03-04 Thread Daniel Kasak
Standard disclaimer: I am not a lawyer.

If you're in doubt, I think the best way to do this is to distribute things
separately. Just make an installer / updater for the GTK libs ( that would
be handy, by the way ... oh and if you build some Windows themes, *please*
distribute these too ). Then in your MIT licensed app, say You'll need GTK
libs ... and an installer / updater exists at location blah.

This would surely not break any licenses, as they're separate projects.

Dan


On Wed, Mar 5, 2014 at 7:16 AM, Chris Angelico ros...@gmail.com wrote:

 I have a Pike GTK app that works on Windows and Linux (and
 theoretically other platforms but I haven't tested it). The Windows
 version of Pike distributes GTK DLLs for 2.12.11, which has some flaws
 compared to 2.24.10 which I use elsewhere. So it would be convenient
 for my users if I could have a simple command inside my app that goes
 and fetches eighteen files (including Pango, Cairo, etc) and deploys
 them to the correct location.

 And therein is a licensing problem. GTK is licensed LGPL, but my app
 is under the freer MIT license. So the question is: Am I making a
 derivative/combined work by making an installer that fetches GTK DLLs?

 I don't want to have to mess with the licensing of my project (putting
 some of it under the (L)GPL) for the sake of a convenience feature,
 but on the flip side, there's no point listing lengthy instructions
 saying go download this, extract this, put this this this and this in
 here, then restart the program if I can say enter this one-word
 command.

 What's the rule on distributing DLLs with non-GPL software? The GPL
 FAQ has a lot, but not really what I'm after.

 Thanks!

 ChrisA
 ___
 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


Broadway questions

2014-01-11 Thread Daniel Kasak
Greetings.

I've asked a similar question in the gtk-l...@gnome.org list, but didn't
get an answer, so thought I'd try here.

I have done a quick proof-of-concept port of some libraries and an app from
Gtk2 to Gtk3. I've built the latest Gtk3 with broadway support. My app runs
fine, but I don't see a way of resizing or maximising. Are these features
coming? Is there a status page / blog / whatever for broadway?

Thanks :)

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


Re: [Glade-users] Treeview doesnt refresh upon reopenning window

2007-04-24 Thread Daniel Kasak
Jason Brisbane wrote:
 Hello All,

 I am looking for a fix for a Treeview issue that I am having.

 I have created a Treeview that gets its data from a database and 
 populates the list with the results of the database.
 This works well as even if the database table was empty (rows=0) then it 
 still displays the headers (better than I thought).
   

Can't help you at all with the specific problem you're having, but if 
you're just after an easy way of viewing / editing data from a database, 
check out my 'Axis' project, at:

http://entropy.homelinux.org/axis/

There are 2 database modules ( Gtk2::Ex::DBI and 
Gtk2::Ex::Datasheet::DBI ), for forms and datasheets respectively. The 
datasheet module does exactly what you're trying to do - fetch data from 
a database, dump it into a treeview, manage database updates.

-- 
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list