Re: The Future?

2019-03-09 Thread Miroslav Rajcic
I think the question is a valid one and there is a plenty of evidence of 
people moving to Qt due to some issues of GTK.


Some notable examples:

- VLC 
(https://ubuntuforums.org/showthread.php?t=316155&s=54b259f2cb2d1a30ca8dc269d0561537)


- Wireshark (https://blog.wireshark.org/2013/10/switching-to-qt/)

- Subsurface by Linus 
(https://liveblue.wordpress.com/2013/11/28/subsurface-switches-to-qt/)


- LXDE desktop 
(https://www.zdnet.com/article/lxde-waves-goodbye-to-gtk-in-merge-with-razor-qt/)


- GCompris educational software 
(https://mail.kde.org/pipermail/kde-edu/2014-February/007950.html)


All these people have valid complaints, so someone should think about it.

Same as Paul, if I would start cross platform now (I started in 2003), 
Qt would be a no-brainer choice.


My personal issues with GTK in comparison to Qt:

1. GTK is not so cross-platform anymore: on Windows and macOS, you are 
supposed to build your own library binaries (gvsbuild for Windows and 
jhbuild for macOS exist, but are not foolproof).


  "Golden age" in this regards was when Tor Lillqvist was still doing 
the Windows builds regularly on each GTK release.GTK was easy to be used 
on Windows at that time.


2. QT has more complete stack, for example integrating audio/video 
playing module (Phonon). gstreamer as an alternative for such module in 
GTK suffers from "build your own binaries" (i.e. issue #1) and a more 
complex interface.


3. for me, this one is huge: QT has much better rich text editor widget 
(QTextEdit), supporting tables, all types of bulleted lists etc.. GTK's 
default widget GtkTextView (nor GtkSourceView) is not nearly close to 
this (no tables, no bullets, no htmL export). For advanced editor you 
are supposed to embed WebKitGTK, but you must first suffer through issue 
#1 and use complex JScript solutions to implement your rich text editor 
features (formatting actions, text change notifications).


4. API stability: jumps from GTK2 to GTK3 were painful, many APIs were 
changed, what it looks like from here, without the strong need, but just 
to make everything better organized or similar, without thinking of 
library users. I have an app that must support GTK2 (even using hildon 
interfaces on old platforms like Maemo) and GTK3 in the same code base, 
so it is now littered with many #ifdef layers


5. Many other parts are unsolved or hard to implement in GTK (drag and 
drop integration using types other than the basic ones, for example)


6. Useful features deprecated, an example is native print preview, that 
worked in 2.16 if i remember correctly and was broken forever in next 
releases (at that time I did not want to port preview  to a new 
mechanism, so i had to remove that feature in my program)


IMO, it seems that GTK does not have a coherent strategy when it comes 
to toolkit features and a cross-platform usage (i.e. lowering the effort 
needed to develop for all major OSes). Nowadays it is mostly focused on 
adding shiny things as support for shaders, animated transitions, GL 
rendering.


Hard-to-implement things like an advanced text editor do not seem to be 
an a table.


This was meant as an constructive critics, it seems strange that this 
topic got just one answer so far.


Regards,

  Miroslav

On 9.3.2019. 17:43, Paul Davis wrote:



On Sat, Mar 9, 2019 at 5:19 AM J.Arun Mani via gtk-list 
mailto:gtk-list@gnome.org>> wrote:



2. How does Gtk address the issue of its users moving to Qt?


What evidence is there of this? Who are the "users" of GTK that you're 
referring to? Moving an existing GUI app between toolkits is typically 
almost equivalent to a complete rewrite, so applications (which are 
the real "users" of a toolkit) generally do not move. Developers may 
start new projects using Qt having previously used GTK, but who counts 
this? How would we judge if it is significant?


3. What makes them move to Qt? Why can't Gtk have that respective
feature?


Qt has as many issues as GTK once you start using it for complex, deep 
applications. Different issues, to be sure, but no GUI toolkit gives 
you a free ride.


Qt is also developed using a different licensing/income generation 
model than GTK, which changes quite a lot.


Qt mostly has distinct advantages over GTK, and to be honest if I was 
starting cross-platform development now (22 years after I actually 
did), I'd probably pick Qt for all the obvious reasons. But it's 
fairly pointless to ask "how can GTK be more like Qt?" when there's 
more or less no chance or pathway for that to happen. As it is, I 
don't do mobile so GTK's issues there don't affect me. I also have 75k 
lines of code that would have to be almost completely rewritten to use 
Qt, with no noticeable benefit for our users and only marginal 
benefits for our developers.


Speaking of "why can't?", why can't I write a C application using Qt  
? :))



___
gtk-list mailing list
gtk-list@gnome.org
https://mail.

Re: Fwd: How do I get the number

2018-10-09 Thread Miroslav Rajcic

Hi Igor,

you actually need to fetch existing columns from the tree view one by 
one, until you find a match, something like the code below.


Regards,

  Miroslav

int current = 0;

GtkTreeViewColumn  
  *cur_column = 
gtk_tree_view_get_column (/|tree_view|/,|/current/|/||/);

while (cur_column != NULL) {

   if (clicked_column == cur_column) {

   break; //found it

   }

   current ++;

 cur_column = gtk_tree_view_get_column (/|tree_view|/,|/current/|/||/);

}

if (cur_column != NULL) {

   // found the matching column, index stored in "current"

}

On 10/9/2018 3:00 AM, Igor Korot via gtk-list wrote:


Hi, list,

Does anybody know how do I get the information?

Thank you.


-- Forwarded message -
From: Chris Moller 
Date: Mon, Oct 8, 2018 at 8:02 PM
Subject: Re: How do I get the number
To: Igor Korot 


To be honest, I'm not sure how GTK would do it.  Maybe the thing to do
is write a bit of code and see what happens--I've never needed to to
know the column number.

On 08/10/2018 08:38, Igor Korot wrote:

Hi, Chris,
On Mon, Oct 8, 2018 at 7:28 PM Chris Moller  wrote:

/
|
|-> disk1
 |
 |
 |---X---> folder1
 |> folder2
|-> disk2
 |
 |> folder3
 |> folder4
 |> subdir
   |
   |> folder5
   |> folder6




 From that, folder1 would have an indices value of [0, 0], folder2
would be inidices[0, 1], folder3 [1,0], folder4 [1,1]

So folder1 will have row 0, column 0?

But that's wrong, because folder1 is at row 2 column 2.

By extension, folder5 would be indices[1,2,0] and folder6 [1, 2, 1]

And folder5 should be at row 8 column 3.

And what is the coordinate be for disk1?
It should be row 1, column 1, right?

So as you can see I'm trying to get a value of the column number.
On top of that I will need to get a column 1 if I click where the "X" is
on the diagram...

Thank you.

On 08/10/2018 18:25, Igor Korot wrote:

Ok.
Now let's get back.

Do you know how I can get the column from the screenshot I sent?

On Mon, Oct 8, 2018, 5:04 PM Chris Moller  wrote:

Sorry, I misunderstood you.

Actually, my daughter speaks pretty good Russian--she was a
competitive figure skater for a lot of years and both her principal
coaches were Russian.   The preferred Russian over English so my
daughter learned Russian.  Anyway, she translated the songs years ago
just to practise.

On 08/10/2018 17:15, Igor Korot wrote:

On Mon, Oct 8, 2018 at 4:09 PM Chris Moller  wrote:

The ones by the Soviet Army?  No.  They're from a recording made in
London in about 1959.  Once upon a time, back in the 60s, I had an LP
version that had some translations printed on the liner, but that LP
vanished decades ago.  Other than Tipperary, Annie Laurie, and Oh no,
John!, they're in Russian.

I understand.
And that's why I offer to translate them to English if you are interested.

Thank you.

On 08/10/2018 16:13, Igor Korot wrote:

Chris,

On Mon, Oct 8, 2018 at 3:08 PM Chris Moller  wrote:

Here's a more complex tree, some of  of the files in my music
collection.  (It's not exactly how GTK would show it, but close
enough.)

Do you want a translation for some those songs?

── misc
│   ├── PiSymphony
│   │   ├── Pi-and-e.ogg
│   │   └── The-Circle.ogg
│   └── SovietArmy
│   ├── 01 - Song of Youth.mp3
│   ├── 02 - A birch tree in a field did stand.mp3
│   ├── 03 - Far Away.mp3
│   ├── 04 - Song of the Volga Boatmen.mp3
│   ├── 05 - You are always beautiful.mp3
│   ├── 06 - Along Peter's Street.mp3
│   ├── 07 - Tipperary (sung in English).mp3
│   ├── 08 - Ah! Lovely Night.mp3
│   ├── 09 - Kamarinskaya [instrumental].mp3
│   ├── 10 - Annie Laurie (sung in English).mp3
│   ├── 11 - Song of the Plains (Meadowland).mp3
│   ├── 12 - Kalinka.mp3
│   ├── 13 - Bandura (sung in Ukrainian).mp3
│   ├── 14 - Oh no, John! (sung in English).mp3
│   ├── 15 - Snowflakes.mp3
│   ├── 16 - Ukrainian Poem.mp3
│   └── 17 - Soldiers' Chorus (from The Decembrists).mp3
└── synthesiser
 ├── Carlos
 │   ├── Aurora_Borealis.ogg
 │   ├── Midnight_Sun.ogg
 │   └── SonicSeasonings.ogg
 ├── Hyman
 │   ├── Evening_Thoughts.ogg
 │   ├── Four_Duets_in_Odd_Meter.ogg
 │   ├── Give_It_Up_or_Turn_It_Loose.ogg
 │   ├── Improvisation_in_Fourths.ogg
 │   ├── Kolumbo.ogg
 │   ├── Tap_Dance_in_the_Memory_Banks.ogg
 │   ├── The_Legend_of_Johnny_Pot.ogg
 │   ├── The_Minotaur.ogg
 │   ├── The_Moog_and_Me.ogg
 │   ├── Time_Is_Tight.ogg
 │   ├── Topless_Dancers_of_Corfu.ogg
 │   └── Total_Bells_and_Tony.ogg
 ├── Kitaro
 │   ├── Silk_Road_II.ogg
 │   └── Silk_Road_I.ogg
 ├── Tomita
 │   ├── Compilation


On 08/10/2018

Re: Turn off GTK+ warnings

2017-04-01 Thread Miroslav Rajcic
Why don't you redirect those warnings to /dev/null if they bother you so 
much?


Just start the program with:

gvim 2>/dev/null

and your issue is gone.
You can also append " &" at the end if you want to put the process in 
the background (so it doesn't block your terminal).


Best regards,
  Miroslav

On 1.4.2017. 14:26, Stuart Longland wrote:

On 01/04/17 21:45, Emmanuele Bassi wrote:

On 1 April 2017 at 12:00, Stuart Longland  wrote:

On 01/04/17 20:24, Emmanuele Bassi wrote:

On 1 April 2017 at 11:05, Stuart Longland  wrote:

On 01/04/17 17:41, Stefan Salewski wrote:

On Sat, 2017-04-01 at 16:53 +1000, Stuart Longland wrote:

How, as a user, do I go about silencing these warnings?

- Doctor, doctor! My arm hurts when I move it this way!
- Then don't move it this way

You're blaming the nervous system notifying you that you're doing
something wrong and/or painful, and you're asking to ignore the pain,
instead of figuring out the cause and fixing that.

The pain you feel is the message; you fix the cause, not the pain.

If my arm were sore, I'd see a doctor, I would not bother seeing a
police officer about it, at best they'll simply refer me to a doctor, at
worst they may choose to press charges on wasting police time.

You stretched the metaphor until it broke.


GTK+ is complaining to me about its "sore arm" … it should really go see
the "doctor" (the application developer).

GTK+, by itself, cannot do anything. You're endowing it with
supernatural powers.

At most, GTK+ can warn the application developer during the
development phase, and the QA phase. If the application developers
decide to release their code with warnings in it, or if they don't
test with newer versions of their dependencies and don't bundle them,
then it's still their responsibility to fix the warnings.

Maybe so, but it is the *developer's* responsibility, not the *user's*
responsibility.

If I tell it "I'm a developer", sure, go to town and tell me everything.
  If "I'm a user", don't bother.  Yes, the application might crash … then
it'll look like the application is at fault (which it is), not GTK+.


Well, in my case it isn't `gvim` that's emitting the warnings, its GTK+..
  `gvim`'s (ab)use of the GTK+ library might be the underlying cause, but
GTK+ is what's polluting stderr.

GTK+ is not "polluting" stderr: it's emitting a warning that the
application is doing something wrong at run time. The application is
causing the warning.

GTK+'s warning is polluting stderr.  stderr is meant for the application
to report things via the console, not GTK+.  GTK+ has permission to talk
to the X server, but not to stderr.

In the case of `gvim`, they don't think it's their problem:
https://github.com/vim/vim/issues/1149

They are wrong.

The "mapped child but invisible parent" warning is a violation of the
documented invariants for GTK+ widgets; a child widget being mapped
requires that all its ancestors, up to the top level, are visible.

If you're getting that warning it means that the application developer
is doing something *very* wrong; considering how gvim abuses GTK+ as
if it were an X11 toolkit from the '90s, that does not surprise me one
bit.

And as a user, what am I supposed to do about it other than file a bug
report with them (which has been done)?  If they want to hear no more
about it, nor do I.


I have a hunch it is theme-related.

It's not, unless you're using GTK+ 2.x, where themes were free to
inject random code inside the toolkit internals, and could manipulate
the widget hierarchy. That is not possible any more in GTK+ 3.x.

The number of warnings did go down in gvim's case when I recompiled
against GTK+2.0, linking against GTK+3.0 makes things very unstable.


  I tried several before finally
settling on the vertex theme, which seemed to generate less errors than
others, including the default GTK+ theme.
That puts the ball firmly in GTK+'s court in my book.

It really doesn't.

Well, a buggy theme is hardly the application's fault is it?  You are
right in that it isn't GTK+'s either, but unless the user wrote the
theme themselves, we can conclude the user didn't cause this.


You should file a bug against the application that is creating those
warnings.

I have, right here.  Those warnings are being emitted by GTK+.  This is
the GTK+ mailing list.

You seem to operate under the misunderstanding that GTK+ emits those
warnings for internal reasons. It does not. GTK+, by itself, doesn't
do anything. You have to build an application to use it, and by doing
so, you have to respect the API contract that GTK+ provides. If you
break the contract, you typically get a crash — but, if you're lucky,
you get a warning first.

I am not disagreeing with you on the latter point.  But GTK+ chooses to
use `stderr` as its means of reporting errors, and that's what I take
issue to.

More to the point, I, as a user, did not break that contract, the
application did.  So what good is it moaning to the user?

None whatsoever.  All it does i

gtk_print_context_get_hard_margins documentation

2015-12-31 Thread Miroslav Rajcic
I am trying to use gtk_print_context_get_hard_margins API to ensure that 
my margin settings do not go below printer's hard settings.

The API is documented as:
"Obtains the hardware printer margins of the GtkPrintContext, in units."

My question is: what units are we talking about here?

Most other printing APIs within the GtkPageSetup (like 
gtk_page_setup_set_top_margin for example) accept GtkUnit as parameter 
and return data in desired unit (be it pixels, points, inches or mm).


Regards,
  Miroslav
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: How to customize GtkCellRendererCombo ?

2015-12-06 Thread Miroslav Rajcic

Hi Stefan,

I was not aware of this sample, and it turns out that this sample works 
fine.
I rewrote the following function from my sample, and the combo works 
fine now:


void on_tree_cell_combo_editing_start(GtkCellRenderer *renderer, 
GtkCellEditable *editable, gchar *path, gpointer user_data)

{
if (GTK_IS_COMBO_BOX(editable))  {
GtkComboBox *combo = GTK_COMBO_BOX(editable);
GtkCellView *view = (GtkCellView 
*)gtk_bin_get_child(GTK_BIN(editable));

GList *list = gtk_cell_view_get_cell_renderers(view);
while (list){
GtkCellRenderer *renderer1 = (GtkCellRenderer *)list->data;
list = list->next;
gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo), renderer1, 
TaskStatusComboCellData, NULL, NULL);

}
}
}

It seems that the renderer parameter being passed to this function is 
not to be touched.


Thank you very much for your help.

Regards,
  Miroslav

On 6.12.2015. 18:19, Stefan Salewski wrote:

On Sun, 2015-12-06 at 15:26 +0100, Miroslav Rajcic wrote:

Hi Stefan,

thank you for the nice idea.

I was not really happy with that fix myself.

You may have seen

http://www.kksou.com/php-gtk2/sample-codes/set-up-combobox-in-treeview-with-colors-Part-1.php

Seems to be a related task, but in php, so I can not really understand it well.

Maybe Emmanuele Bassi can help us tomorrow.



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


Re: How to customize GtkCellRendererCombo ?

2015-12-06 Thread Miroslav Rajcic

Hi Stefan,

thank you for the nice idea.

I've tried the code, but it seems to produce two combo box columns 
instead of a single one, because renderer is pushed twice (original one 
is black, 2nd one is colored).


If I add this line before yours, that problem is fixed:
gtk_cell_layout_clear(GTK_CELL_LAYOUT(combo));

Unfortunately, this has other issue as well:
when you open combo box and select an item in it, selected item gets a 
handle to open its own sub-combo box.
This sub-combo can get opened and selected item in it gets sub-sub-combo 
box.

Basically this process goes recursively.

I've tried to ensure that the initialization within 
on_tree_cell_combo_editing_start is called only once, but this doesn't 
seem to help ... :(


Regards,
  Miroslav

On 6.12.2015. 1:12, Stefan Salewski wrote:

On Sat, 2015-12-05 at 16:47 +0100, Miroslav Rajcic wrote:

I am trying to customize GtkCellRendererCombo so that the items in the
combo box have different colors.

Yes, that is not really easy.

Looking at

https://developer.gnome.org/gtk3/stable/GtkCellLayout.html#gtk-cell-layo
ut-set-cell-data-func

I saw

"This function is used instead of the standard attributes mapping for
setting the column value, and should set the value of cell_layout ’s
cell renderer(s) as appropriate."

So my guess was to replace your

//TOFIX

comment with this call:
gtk_cell_layout_pack_start(GTK_CELL_LAYO
UT(combo), renderer, TRUE);

Seems to work.




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


How to customize GtkCellRendererCombo ?

2015-12-05 Thread Miroslav Rajcic
I am trying to customize GtkCellRendererCombo so that the items in the 
combo box have different colors.
Documentation indicates that this is supposed to be done through 
"editing-started" signal handler, but I failed to do it.


My sample is given below.
When gtk_cell_layout_set_cell_data_func or gtk_cell_layout_add_attribute 
call is being made, GTK issues error:
"gtk_combo_box_cell_layout_set_cell_data_func: assertion `info != NULL' 
failed".

And the coloring doesn't work.

Any tips?

Regards,
  Miroslav

PS. Code:

#include 

GtkWidget *window1;
GtkListStore *store;

void TaskStatusComboCellData(GtkCellLayout *cell_layout, GtkCellRenderer 
*cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)

{
//get item index
GtkTreePath *path = gtk_tree_model_get_path(tree_model, iter);
gint* arrIndices = gtk_tree_path_get_indices(path);
int nIdx = arrIndices[0];
gtk_tree_path_free(path);

//now set correct color for each item
switch (nIdx){
case 0:
g_object_set(G_OBJECT(cell), "foreground", "red", NULL);
break;
case 1:
g_object_set(G_OBJECT(cell), "foreground", "blue", NULL);
break;
}
}

void on_tree_cell_combo_editing_start(GtkCellRenderer *renderer, 
GtkCellEditable *editable, gchar *path, gpointer user_data)

{
//set colors for combo box entries
if (GTK_IS_COMBO_BOX(editable))
{
//refresh latest colors
GtkComboBox *combo = GTK_COMBO_BOX(editable);
//TOFIX
gtk_cell_layout_set_cell_data_func(GTK_CELL_LAYOUT(combo), 
renderer, TaskStatusComboCellData, NULL, NULL);
//gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo), 
renderer, "foreground", 2);

}
}

GtkWidget* create_main_win ()
{
GtkWidget *vbox1;
GtkWidget *scrolledwindow1;
GtkWidget *treeview4;

window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window1), "Test");
gtk_window_set_default_size (GTK_WINDOW (window1), 500, 350);

vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (window1), vbox1);

scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_container_add (GTK_CONTAINER (vbox1), scrolledwindow1);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW 
(scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);


//create tree view
store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
  treeview4 = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
g_object_unref (G_OBJECT (store));  //tree now holds reference
gtk_widget_set_size_request(treeview4, -1, 150);

//create list view columns
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview4), TRUE);
gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW(treeview4), TRUE);
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(treeview4),FALSE);
gtk_widget_show (treeview4);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), treeview4);

GtkTreeViewColumn *col = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(col, "Title");
gtk_tree_view_column_set_clickable(col, TRUE);//allow column 
header clicks

gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_resizable(col, TRUE);
gtk_tree_view_column_set_fixed_width(col, 100);

GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
gtk_tree_view_column_pack_start(col, (GtkCellRenderer *)renderer, 
TRUE);

gtk_tree_view_column_add_attribute(col, renderer, "text", 0);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview4), col);

col = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(col, "Type");
gtk_tree_view_column_set_clickable(col, TRUE);//allow column 
header clicks

gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_resizable(col, TRUE);
gtk_tree_view_column_set_fixed_width(col, 150);

renderer = gtk_cell_renderer_combo_new();
gtk_tree_view_column_pack_start(col, renderer, TRUE);
gtk_tree_view_column_add_attribute(col, renderer, "text", 1);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview4), col);

//add combo with values
GtkListStore *store1 = gtk_list_store_new(2, G_TYPE_STRING, 
G_TYPE_STRING);//text, color

GtkTreeIter iter;
gtk_list_store_append(store1, &iter);
gtk_list_store_set(store1, &iter, 0, "Type 1 (red)", -1);
gtk_list_store_append(store1, &iter);
gtk_list_store_set(store1, &iter, 0, "Type 2 (blue)", -1);
gtk_list_store_append(store1, &iter);
gtk_list_store_set(store1, &iter, 0, "Type 3 (green)", -1);

g_object_set(renderer, "model", store1, "text-column", 0, 
"has-entry", FALSE, "editable", TRUE, (char *)NULL);
g_signal_connect(renderer, "editing-started", 
G_CALLBACK(on_tree_cell_combo_editing_start), NULL);


gtk_widget_show_all(window1);

g_signal_conn

Re: Announcement of Visual Studio 2015 projects and solutions for Gtkmm and GTK+

2015-11-27 Thread Miroslav Rajcic

Hi Yann,

On 27.11.2015. 9:40, Yann Leboulanger wrote:



On Windows, IMO, the ideal project would have to provide binaries (not
just source), probably built with VS2015 and support both GTK2.x and
GTK3.x stack. Additional points would be to build gstreamer,
GtkSourceView and many other commonly used libraries.


It's available here:
http://sourceforge.net/projects/pygobjectwin32/



Doesn't seem that user friendly to me (at least if not interested in 
Python part):

- single installer forcing me to pre-install Python or else it will quit
- wiki seems to indicate that it is focused to GTK v3, what about GTK 
2.x? (links to some legacy versions exists but their installers are big 
500kB only, and there is no documentation on what they contain)

- uses gcc to build modules, not VS2015
- general lack of documentation of what is to be found within
- probably lacks 64-bit builds


Currently, I see many projects related to building GTK for Windows,
each doing work on their own without central/common project.


It's exactly what GTK developpers want, the same as under linux: each 
distrib build it's own binaries


I don't agree with such view: Windows can be viewed as single distro, so 
it makes no sense to me why having so many projects?
I very much admire how Qt provides clean installer for Windows, 
installing also debug together with release versions of the libraries.


The idea is to enable developers to have as painless experience as possible.
I don't see the reason why would some GTK+ application developer be 
forced to build entire stack before starting to program its app.


Regards,
  Miroslav
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Announcement of Visual Studio 2015 projects and solutions for Gtkmm and GTK+

2015-11-27 Thread Miroslav Rajcic

Thanks.

On 27.11.2015. 9:10, codekiddy wrote:
I've just cloned the GtkSourceView from here 
<https://github.com/GNOME/gtksourceview>

I'll try to create solution for VS 2015 and send you a link for download.


On Fri, Nov 27, 2015 at 8:50 AM, Miroslav Rajcic 
mailto:supp...@notecasepro.com>> wrote:


I've checked the git repository:
https://git.gnome.org/browse/gtksourceview/tree

but I fail to see any VS2015 related files.

Regards,
  Miroslav

On 27.11.2015. 8:29, Ignacio Casal Quinteiro wrote:

See also this:
https://github.com/fanc999/gtk-msvc-projects

And to point out that most of the gtk projects and deps
already provide the visual studio projects. i.e you can see them
here:
https://git.gnome.org/browse/gtk+/tree/build/win32

Cheers.

On Fri, Nov 27, 2015 at 8:27 AM, Ignacio Casal Quinteiro
mailto:nacho.r...@gmail.com>> wrote:

Hey,

have you seen this?
https://github.com/nice-software/gtk-win32/
https://github.com/hexchat/gtk-win32

Also I started to work in a way to automatize the builds:
https://github.com/nacho/icbuild

Still far from ready but any help would be appreciated.

Cheers.

On Fri, Nov 27, 2015 at 8:18 AM, Miroslav Rajcic
mailto:supp...@notecasepro.com>> wrote:

Looks nice, it's appreciated very much!
Any chance to add GtkSourceView library in the mix ?

Regards,
  Miroslav


On 27.11.2015. 7:59, codekiddy wrote:

Hello there!

I'm glad to be able to announce new release of Visual
Studio 2015 projects and solutions to compile GTK+,
Gtkmm, all it's dependencies
solely by using Visual Studio, as well as few other
popular "hard to build" libraries.

To best illustrate which packages you can build with
these projects and solutions see this image

<https://raw.githubusercontent.com/codekiddy2/Visual-Studio-gtkmm/msvc-140/readme/images/dependency%20graph.png>

Entry repository is available on GitHub Visual Studio
gtkmm <https://github.com/codekiddy2/Visual-Studio-gtkmm>

There is also an updated Visual Studio gtkmm wiki
<https://github.com/codekiddy2/Visual-Studio-gtkmm/wiki>
to help beginners building gtkmm from scratch.

Any possible updates will be pushed to msvc-140 branch,
up to next release of Visual Studio.

Thank you!


~codekiddy


___
gtk-list mailing list
gtk-list@gnome.org  <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list



___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list




-- 
Ignacio Casal Quinteiro





-- 
Ignacio Casal Quinteiro



___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list




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


Re: Announcement of Visual Studio 2015 projects and solutions for Gtkmm and GTK+

2015-11-27 Thread Miroslav Rajcic

Thanks.

Regards,
  Miroslav

On 27.11.2015. 8:50, codekiddy wrote:

Hi Miroslav!

I have added your suggestion to my TODO list 
<https://github.com/codekiddy2/Visual-Studio-gtkmm/blob/msvc-140/readme/TODO.md>, 
which is at present already too long, I truly hope to clear this list 
one day.
But for now, I don't know, it's too early and there is still a lot of 
stuff to do with current status as you can see.


Thank you for feedback!

On Fri, Nov 27, 2015 at 8:18 AM, Miroslav Rajcic 
mailto:supp...@notecasepro.com>> wrote:


Looks nice, it's appreciated very much!
Any chance to add GtkSourceView library in the mix ?

Regards,
  Miroslav

On 27.11.2015. 7:59, codekiddy wrote:

Hello there!

I'm glad to be able to announce new release of Visual Studio 2015
projects and solutions to compile GTK+, Gtkmm, all it's dependencies
solely by using Visual Studio, as well as few other popular "hard
to build" libraries.

To best illustrate which packages you can build with these
projects and solutions see this image

<https://raw.githubusercontent.com/codekiddy2/Visual-Studio-gtkmm/msvc-140/readme/images/dependency%20graph.png>

Entry repository is available on GitHub Visual Studio gtkmm
<https://github.com/codekiddy2/Visual-Studio-gtkmm>

There is also an updated Visual Studio gtkmm wiki
<https://github.com/codekiddy2/Visual-Studio-gtkmm/wiki> to help
beginners building gtkmm from scratch.

Any possible updates will be pushed to msvc-140 branch, up to
next release of Visual Studio.

Thank you!


~codekiddy


___
gtk-list mailing list
gtk-list@gnome.org  <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list



___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list




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


Re: Announcement of Visual Studio 2015 projects and solutions for Gtkmm and GTK+

2015-11-27 Thread Miroslav Rajcic

I've seen most of the links before in the past.
Hexchat seemed promising at the time, but their unwillingness to fix or 
change anything to the project that is not related to them (including 
building GtkSourceView) was a big disappointment.
Some other projects are for GTK+ 3.x only, and that makes them unusable 
to me.


Msys2 project is currently the easiest way to build the GTK stack on 
Windows, but the issue here is the use of mingw compiler. My 
measurements show that my own program compiled with msys2 stack (using 
-O2 optimization level) is up to 50% slower in some tasks compared to 
binary produced by VS2013/VS2015.


In the end, I must say, that as the time passes, I appreciate more and 
more the work that Tor Lillqvist used to put to provide GTK+ binaries 
for Windows. I don't think any other project has matured to step in and 
to the work that he has provided.


On Windows, IMO, the ideal project would have to provide binaries (not 
just source), probably built with VS2015 and support both GTK2.x and 
GTK3.x stack. Additional points would be to build gstreamer, 
GtkSourceView and many other commonly used libraries.


Currently, I see many projects related to building GTK for Windows, each 
doing work on their own without central/common project.


Regards,
  Miroslav

On 27.11.2015. 8:27, Ignacio Casal Quinteiro wrote:

Hey,

have you seen this?
https://github.com/nice-software/gtk-win32/
https://github.com/hexchat/gtk-win32

Also I started to work in a way to automatize the builds:
https://github.com/nacho/icbuild

Still far from ready but any help would be appreciated.

Cheers.

On Fri, Nov 27, 2015 at 8:18 AM, Miroslav Rajcic 
mailto:supp...@notecasepro.com>> wrote:


Looks nice, it's appreciated very much!
Any chance to add GtkSourceView library in the mix ?

Regards,
  Miroslav


On 27.11.2015. 7:59, codekiddy wrote:

Hello there!

I'm glad to be able to announce new release of Visual Studio 2015
projects and solutions to compile GTK+, Gtkmm, all it's dependencies
solely by using Visual Studio, as well as few other popular "hard
to build" libraries.

To best illustrate which packages you can build with these
projects and solutions see this image

<https://raw.githubusercontent.com/codekiddy2/Visual-Studio-gtkmm/msvc-140/readme/images/dependency%20graph.png>

Entry repository is available on GitHub Visual Studio gtkmm
<https://github.com/codekiddy2/Visual-Studio-gtkmm>

There is also an updated Visual Studio gtkmm wiki
<https://github.com/codekiddy2/Visual-Studio-gtkmm/wiki> to help
beginners building gtkmm from scratch.

Any possible updates will be pushed to msvc-140 branch, up to
next release of Visual Studio.

Thank you!


~codekiddy


___
gtk-list mailing list
gtk-list@gnome.org  <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list



___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list




--
Ignacio Casal Quinteiro


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


Re: Announcement of Visual Studio 2015 projects and solutions for Gtkmm and GTK+

2015-11-26 Thread Miroslav Rajcic

I've checked the git repository:
https://git.gnome.org/browse/gtksourceview/tree

but I fail to see any VS2015 related files.

Regards,
  Miroslav

On 27.11.2015. 8:29, Ignacio Casal Quinteiro wrote:

See also this:
https://github.com/fanc999/gtk-msvc-projects

And to point out that most of the gtk projects and deps
already provide the visual studio projects. i.e you can see them here:
https://git.gnome.org/browse/gtk+/tree/build/win32

Cheers.

On Fri, Nov 27, 2015 at 8:27 AM, Ignacio Casal Quinteiro 
mailto:nacho.r...@gmail.com>> wrote:


Hey,

have you seen this?
https://github.com/nice-software/gtk-win32/
https://github.com/hexchat/gtk-win32

Also I started to work in a way to automatize the builds:
https://github.com/nacho/icbuild

Still far from ready but any help would be appreciated.

Cheers.

On Fri, Nov 27, 2015 at 8:18 AM, Miroslav Rajcic
mailto:supp...@notecasepro.com>> wrote:

Looks nice, it's appreciated very much!
Any chance to add GtkSourceView library in the mix ?

Regards,
  Miroslav


On 27.11.2015. 7:59, codekiddy wrote:

Hello there!

I'm glad to be able to announce new release of Visual Studio
2015 projects and solutions to compile GTK+, Gtkmm, all it's
dependencies
solely by using Visual Studio, as well as few other popular
"hard to build" libraries.

To best illustrate which packages you can build with these
projects and solutions see this image

<https://raw.githubusercontent.com/codekiddy2/Visual-Studio-gtkmm/msvc-140/readme/images/dependency%20graph.png>

Entry repository is available on GitHub Visual Studio gtkmm
<https://github.com/codekiddy2/Visual-Studio-gtkmm>

There is also an updated Visual Studio gtkmm wiki
<https://github.com/codekiddy2/Visual-Studio-gtkmm/wiki> to
help beginners building gtkmm from scratch.

Any possible updates will be pushed to msvc-140 branch, up to
next release of Visual Studio.

Thank you!


~codekiddy


___
gtk-list mailing list
gtk-list@gnome.org  <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list



___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list




-- 
Ignacio Casal Quinteiro





--
Ignacio Casal Quinteiro


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


Re: Announcement of Visual Studio 2015 projects and solutions for Gtkmm and GTK+

2015-11-26 Thread Miroslav Rajcic

Looks nice, it's appreciated very much!
Any chance to add GtkSourceView library in the mix ?

Regards,
  Miroslav

On 27.11.2015. 7:59, codekiddy wrote:

Hello there!

I'm glad to be able to announce new release of Visual Studio 2015 
projects and solutions to compile GTK+, Gtkmm, all it's dependencies
solely by using Visual Studio, as well as few other popular "hard to 
build" libraries.


To best illustrate which packages you can build with these projects 
and solutions see this image 



Entry repository is available on GitHub Visual Studio gtkmm 



There is also an updated Visual Studio gtkmm wiki 
 to help 
beginners building gtkmm from scratch.


Any possible updates will be pushed to msvc-140 branch, up to next 
release of Visual Studio.


Thank you!


~codekiddy


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


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


Re: Background color of Treeviews with just few rows

2015-10-01 Thread Miroslav Rajcic

I'm glad you've solved it.

Regards,
  Miroslav

On 1.10.2015. 8:33, Juan L. Freniche wrote:

It is solved now!

Your code works perfectly but it changes the color of ALL ROWS and the 
part below the last row also.


I already had in the application rc file the following:
style "TreeStyle"
{
 GtkTreeView::allow-rules  = 1 # draw alternating color rows
 GtkTreeView::odd-row-color= "#EDE7D3"  # light grey
 GtkTreeView::even-row-color   = "#FF"  # white
}
class "GtkTreeView" style "TreeStyle"
and in the code there was the set_rules_hint (true), so odd rows are 
colored as light grey and even rows are colored white.


It seems that the treeview uses the even-row-color for the part below 
the last row, so I changed the rc file to

style "TreeStyle"
{
 GtkTreeView::allow-rules  = 1 # draw alternating color rows
 GtkTreeView::odd-row-color= "#FF" # white
GtkTreeView::even-row-color   = "#EDE7D3" # light grey
}
class "GtkTreeView" style "TreeStyle"
and then this part (below the last row in a treeview with just a few 
rows) is colored now as light grey, which is more or less what I wanted.


Thanks a lot!!!
Best Regards
JLF



El 01/10/2015 a las 6:07, Miroslav Rajcic escribió:

Hi Juan,

have you tried the proposed code to verify that if works or not, or 
just guessing?


I use that code (plus your code, but it doesn't work on its own) in 
my own program, and it works fine.

Note that the same color is set for odd and even color.

You can download my program NoteCase Pro (www.notecasepro.com) and 
use "General Settings" window (page "03 Display", select color for 
"Color" -> "Background" entry) to change the color of the tree view 
found on the left of the main window.


Regards,
  Miroslav

On 30.9.2015. 20:54, Juan L. Freniche wrote:
Thanks. However I think your recommendation will draw odd and even 
row with the selected color but this is not what I am looking for.


I would like to give some color to the area below last row, in a 
treeview with a small number of rows. This area is by default white.


El 30/09/2015 a las 12:45, Miroslav Rajcic escribió:

This code works for me for GTK 2.x:

static const char color_rc[] =
"style \"aaa\"\n"
"{\n"
"GtkTreeView::odd-row-color=\"#%04x%04x%04x\"\n"
"GtkTreeView::even-row-color =\"#%04x%04x%04x\"\n"
"}\n"
"widget \"*.aaa\" style \"aaa\"";  // removed 
"class \"GtkTreeView\"" because it would change all trees


gchar *rc_temp = g_strdup_printf(color_rc,
color.red,
color.green,
color.blue,
color.red,
color.green,
color.blue);
gtk_rc_parse_string(rc_temp);
gtk_widget_set_name(widget, "aaa");
gtk_widget_reset_rc_styles(widget);
g_free(rc_temp);

I hope it helps.

Regards,
  Miroslav
On 30.9.2015. 8:51, Juan L. Freniche wrote:

Hello, I would appreciate help in this topic:

I have a notebook with several pages. Every page has a 
scrolledwindow and then a treeview.


For treeviews with sufficient rows, no problema but if the 
treeview has a small number of rows, the remaining area below the 
last row is in white color.


I would like to change the color of this area. I tried

/style =get_style (widget)
set_background (style, state_normal, other color)
set_style (widget, style)/

where widget was sucessively the notebook, the scrolled window and 
the treeview. No success.


I am using Gtk 2.24 and in the process of moving to Gtk3.

Thanks in advance.


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




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




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




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




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


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


Re: Background color of Treeviews with just few rows

2015-09-30 Thread Miroslav Rajcic

Hi Juan,

have you tried the proposed code to verify that if works or not, or just 
guessing?


I use that code (plus your code, but it doesn't work on its own) in my 
own program, and it works fine.

Note that the same color is set for odd and even color.

You can download my program NoteCase Pro (www.notecasepro.com) and use 
"General Settings" window (page "03 Display", select color for "Color" 
-> "Background" entry) to change the color of the tree view found on the 
left of the main window.


Regards,
  Miroslav

On 30.9.2015. 20:54, Juan L. Freniche wrote:
Thanks. However I think your recommendation will draw odd and even row 
with the selected color but this is not what I am looking for.


I would like to give some color to the area below last row, in a 
treeview with a small number of rows. This area is by default white.


El 30/09/2015 a las 12:45, Miroslav Rajcic escribió:

This code works for me for GTK 2.x:

static const char color_rc[] =
"style \"aaa\"\n"
"{\n"
"GtkTreeView::odd-row-color=\"#%04x%04x%04x\"\n"
"GtkTreeView::even-row-color =\"#%04x%04x%04x\"\n"
"}\n"
"widget \"*.aaa\" style \"aaa\"";  // removed "class 
\"GtkTreeView\"" because it would change all trees


gchar *rc_temp = g_strdup_printf(color_rc,
color.red,
color.green,
color.blue,
color.red,
color.green,
color.blue);
gtk_rc_parse_string(rc_temp);
gtk_widget_set_name(widget, "aaa");
gtk_widget_reset_rc_styles(widget);
g_free(rc_temp);

I hope it helps.

Regards,
  Miroslav
On 30.9.2015. 8:51, Juan L. Freniche wrote:

Hello, I would appreciate help in this topic:

I have a notebook with several pages. Every page has a 
scrolledwindow and then a treeview.


For treeviews with sufficient rows, no problema but if the treeview 
has a small number of rows, the remaining area below the last row is 
in white color.


I would like to change the color of this area. I tried

/style =get_style (widget)
set_background (style, state_normal, other color)
set_style (widget, style)/

where widget was sucessively the notebook, the scrolled window and 
the treeview. No success.


I am using Gtk 2.24 and in the process of moving to Gtk3.

Thanks in advance.


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




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




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


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


Re: Background color of Treeviews with just few rows

2015-09-30 Thread Miroslav Rajcic

This code works for me for GTK 2.x:

static const char color_rc[] =
"style \"aaa\"\n"
"{\n"
"GtkTreeView::odd-row-color=\"#%04x%04x%04x\"\n"
"GtkTreeView::even-row-color =\"#%04x%04x%04x\"\n"
"}\n"
"widget \"*.aaa\" style \"aaa\"";  // removed "class 
\"GtkTreeView\"" because it would change all trees


gchar *rc_temp = g_strdup_printf(color_rc,
color.red,
color.green,
color.blue,
color.red,
color.green,
color.blue);
gtk_rc_parse_string(rc_temp);
gtk_widget_set_name(widget, "aaa");
gtk_widget_reset_rc_styles(widget);
g_free(rc_temp);

I hope it helps.

Regards,
  Miroslav
On 30.9.2015. 8:51, Juan L. Freniche wrote:

Hello, I would appreciate help in this topic:

I have a notebook with several pages. Every page has a scrolledwindow 
and then a treeview.


For treeviews with sufficient rows, no problema but if the treeview 
has a small number of rows, the remaining area below the last row is 
in white color.


I would like to change the color of this area. I tried

/style =get_style (widget)
set_background (style, state_normal, other color)
set_style (widget, style)/

where widget was sucessively the notebook, the scrolled window and the 
treeview. No success.


I am using Gtk 2.24 and in the process of moving to Gtk3.

Thanks in advance.


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


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


Re: Catching typed characters using the key press handler

2012-09-19 Thread Miroslav Rajcic

More info, the same code works fine on Linux Mint.

Regards,
  Miroslav

On 9/19/2012 11:24 AM, Miroslav Rajcic wrote:

I am having a problem similar to the one described in the following posts:
https://mail.gnome.org/archives/gtk-list/2009-September/msg00066.html
https://mail.gnome.org/archives/gtk-list/2009-September/msg00067.html

Basically key press event handler passes individual key presses which 
may not be suitable

to be interpreted as UTF-8 characters.

I've tried to implement solution described in the posts (using 
GtkIMContext), but it doesn't seem to work correctly.

Sample code is a combination of those two posts:

#include 
static GtkIMContext *im_context;

static void gtk_entry_commit_cb (GtkIMContext *context, const gchar  
*str, gpointer data) {

printf("TEXT = %s\n", str); fflush(stdout);
}

gboolean key_press_handler(GtkWidget *widget,  GdkEventKey *event, 
gpointer  data)  {

if(gtk_im_context_filter_keypress(im_context, event))
return TRUE;
return FALSE;
}

int main(int argc, char *argv[]) {
GtkWidget *the_window;
gtk_init (&argc, &argv);
the_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (the_window, "destroy", 
G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect (the_window, "key-press-event", G_CALLBACK 
(key_press_handler), NULL);
g_signal_connect (the_window, "key-release-event", G_CALLBACK 
(key_press_handler), NULL);

im_context = gtk_im_context_simple_new ();
g_signal_connect (im_context, "commit", G_CALLBACK 
(gtk_entry_commit_cb), NULL);

gtk_widget_show_all(the_window);
gtk_main();
return 0;
}


My problem is following: when I press single key "c(" on Croatian 
keyboard (AKA "LATIN SMALL /LETTER/ C WITH CARON"),
in the commit callback I get "Ä" letter instead (AKA "LATIN CAPITAL 
LETTER A WITH DIAERESIS").


Do I need to additionally post-process this string to get the correct 
UTF-8 string ?


Regards,
  Miroslav

PS. My test PC is using Windows 7 with GTK 2.24.10 (32-bit).

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


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


Catching typed characters using the key press handler

2012-09-19 Thread Miroslav Rajcic

I am having a problem similar to the one described in the following posts:
https://mail.gnome.org/archives/gtk-list/2009-September/msg00066.html
https://mail.gnome.org/archives/gtk-list/2009-September/msg00067.html

Basically key press event handler passes individual key presses which 
may not be suitable

to be interpreted as UTF-8 characters.

I've tried to implement solution described in the posts (using 
GtkIMContext), but it doesn't seem to work correctly.

Sample code is a combination of those two posts:

#include 
static GtkIMContext *im_context;

static void gtk_entry_commit_cb (GtkIMContext *context, const gchar 
*str, gpointer data) {

printf("TEXT = %s\n", str); fflush(stdout);
}

gboolean key_press_handler(GtkWidget *widget,  GdkEventKey *event, 
gpointer  data)  {

if(gtk_im_context_filter_keypress(im_context, event))
return TRUE;
return FALSE;
}

int main(int argc, char *argv[]) {
GtkWidget *the_window;
gtk_init (&argc, &argv);
the_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (the_window, "destroy", G_CALLBACK(gtk_main_quit), 
NULL);
g_signal_connect (the_window, "key-press-event", G_CALLBACK 
(key_press_handler), NULL);
g_signal_connect (the_window, "key-release-event", G_CALLBACK 
(key_press_handler), NULL);

im_context = gtk_im_context_simple_new ();
g_signal_connect (im_context, "commit", G_CALLBACK 
(gtk_entry_commit_cb), NULL);

gtk_widget_show_all(the_window);
gtk_main();
return 0;
}


My problem is following: when I press single key "c(" on Croatian 
keyboard (AKA "LATIN SMALL /LETTER/ C WITH CARON"),
in the commit callback I get "Ä" letter instead (AKA "LATIN CAPITAL 
LETTER A WITH DIAERESIS").


Do I need to additionally post-process this string to get the correct 
UTF-8 string ?


Regards,
  Miroslav

PS. My test PC is using Windows 7 with GTK 2.24.10 (32-bit).
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Problems with GtkPaned

2005-03-24 Thread Miroslav Rajcic
> On Thu, 24 Mar 2005 11:40:35 +0100, Miroslav Rajcic <[EMAIL PROTECTED]>
wrote:
> > 1.)  I'am trying to catch event when user drags the handle of the
splitter
> > widget (GtkPaned)
>
> You can listen for changes to the "position" property on GtkPaned:
>
>
http://developer.gnome.org/doc/API/2.0/gtk/GtkPaned.html#GtkPaned--position

Thanks for the tip, unfortunately "position" is a property, not the event.
As you can see in my original post,
I've conencted to the events that should be triggered (at least sounding by
their name, there is no documentation), but they don't work.

> > 3.) This one is for Win32 only, probably gtk bug:
> >   When dragging the GtkPaned handle to resize panes, screen where handle
> > passed is not redrawn (ends garbled).
> >The same code works fine on Linux (FC3).
>
> This works for me. Are you using the windows-alike theme engine? I've
> had some drawing problems with that in the past. Try using the default
> theme and see if the problem goes.

I've tried switching theme to all other types, but the garbage on the screen
still appears (Win32 only).


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Problems with GtkPaned

2005-03-24 Thread Miroslav Rajcic
I have few problems with GtkPaned:

1.)  I'am trying to catch event when user drags the handle of the splitter
widget (GtkPaned)
I've tried installing following
 g_signal_connect ( hpaned1, "move-handle", G_CALLBACK (on_splitter_moved),
NULL);
 g_signal_connect ( hpaned1, "accept-position", G_CALLBACK
(on_splitter_accept), NULL);

But it seems that this doesn't work at all. No such events are generated
ever!.
I am using gtk 2.6.4 on Win2k (VC++ 6.0) and gtk 2.4.x on FC3 (gcc).

2.) Another big problem is events/signals online documentation:
 Most of these events are not described at all. All I can do is to try
guessing their meaning by the signal name (sometimes this is not enough).
Additionally it would be nice to have gtk version when each signal was
introduced.

3.) This one is for Win32 only, probably gtk bug:
  When dragging the GtkPaned handle to resize panes, screen where handle
passed is not redrawn (ends garbled).
   The same code works fine on Linux (FC3).

I hope for some helpful comments

Best regards,
  Miroslav Rajcic


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Win32, GTK+ and string Internationalisation

2005-03-23 Thread Miroslav Rajcic
> I've heard you gotta create .po files, is that right?  But I'm not 100%
> sure on what I have to do to get this working.
>
> Anyway, if you know anything, please help.
>
> thanks
>
> chris

Yes, you should use .po files (message catalogs) to translate your
application.

Windows code has some platform problems, and needs calling some additional
API in order to work.
You can see existing implementation in my open source NoteCase project
(http://notecase.sourceforge.net)
Just download source code and find GuiLanguage C++ class. It's all in there!

I hope this helps.

Best regards,
  Miroslav Rajcic


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


How to get GtkAccelLable from menu item

2004-11-03 Thread Miroslav Rajcic



I've been trying to set custom text for a menu 
item accelerator text.
Code is something like this (based on 
some "googled" posts).
 
 menu_item = 
gtk_menu_item_new_with_label(_("Insert 
Node")); g_signal_connect(menu_item, "activate", G_CALLBACK 
(on_menu_insert_node), NULL); gtk_menu_append(menu, 
menu_item); gtk_widget_show (menu_item);
 //set accelerator string GtkAccelLabel *accel_label = GTK_ACCEL_LABEL( 
gtk_bin_get_child( GTK_BIN( menu_item ) ) ); 
 gtk_label_set_text( GTK_LABEL(accel_label), 
"Ins" ); But, my problem is that this doesn't work. It seems that 
gtk_bin_get_child returns main item label, but 
not  GtkAccelLabel.
Does anyone know how can it be achieved 
?
 
Regards,
  Miroslav Rajcic
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


How to set custom Accelerator text for menu item?

2004-11-02 Thread Miroslav Rajcic



Is there a way to set custom text for menu item 
accelerator text 
(perhaps using GtkAccelLabel) ?
If so, can someone provide a sample 
code.
 
TIA,
   Miroslav 
Rajcic
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


How to change widget font from GtkFontButton ?

2004-10-13 Thread Miroslav Rajcic
I am using GtkFontButton to allow user to define font for my tree and text
view widgets.

My problem is:
a) what is a best way to set widget font (reading settings from
GtkFontButton) ?
b) how to write font settings into an ini file ?

TIA,
  Miroslav Rajcic



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK Modal dialog

2004-10-08 Thread Miroslav Rajcic
John, I've tried compiling your program on both Win32 and Linux.
It seems to work OK, thanks.
One thing that keeps bothering me is that I can still go to the parent 
window and minimize it even if the child dialog is open in a modal way. 
Can you reproduce same thing ?

If this is the case, it seems to me that it must be incorrect behaviour, 
since the system widgets (minimize button) in the parent title bar do 
not obey modal state.

Thanks for the help,
 Miroslav Rajcic
John Cupitt wrote:
This test program woks for me on windows and linux with gtk+-2.4.9.
But maybe I misunderstand your problem?
- the dialog does not appear on the taskbar
- when the dialog is open the main window button does not work (so you
can never have more than one dialog)
- the dialog is always above the main window
 

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK Modal dialog

2004-10-08 Thread Miroslav Rajcic
My dialog is GtkDialog, not the window :-(
Unfortunately, Linux version (gcc 3.3.3, Fedora Core 2 with gtk 2.4.7) 
works kind of OK,
but Win32 version does not work OK (Visual C++ 6.0 with SP6, gtk 2.4.9).

On Linux my dialog does not fall through to the bottow of the window 
z-order when I click on its parent window.
On Windows, this is exactly what happens (mybe it is a bug in 
gtk_window_set_keep_above API ?).

But even on Linux, I don't have a proper modal feeling, my dialog stays 
on top, but I can achieve loosing main window (fall through on the 
bottom) while dialog stays on top and focused. Really strange, smells 
like bug to me.

To clear any misunderstanding my code looks like this:
   dialog1 = gtk_dialog_new ();
   gtk_window_set_modal (GTK_WINDOW (dialog1), TRUE);
   gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog1), TRUE);
   gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog1), TRUE);
   gtk_window_set_type_hint (GTK_WINDOW (dialog1), 
GDK_WINDOW_TYPE_HINT_DIALOG);
   gtk_window_set_transient_for(GTK_WINDOW (dialog1), 
GTK_WINDOW(window1));   //set parent
   gtk_window_set_keep_above(GTK_WINDOW (dialog1), TRUE);
   gtk_window_set_position(GTK_WINDOW (dialog1), 
GTK_WIN_POS_CENTER_ON_PARENT);

   g_signal_connect (dialog1, "destroy", GTK_SIGNAL_FUNC 
(gtk_main_quit), NULL);

   //show dialog
   gtk_widget_show(dialog1);
   gtk_grab_add(dialog1);//disable everything except this dialog
   //block in modal state
   //gtk_main();
   GMainLoop *loop = g_main_new (FALSE);
   GDK_THREADS_LEAVE ();
   g_main_run (loop);  // Loop will block here
   GDK_THREADS_ENTER ();
  
   //cleanup
   gtk_grab_remove(dialog1);
   gtk_widget_destroy(dialog1);

Anyway, I am stuck with this, any help is welcome.
I've read that gnome_dialog_run() does exactly what I need, but I must 
use GTK only.
It seems really strange that GTK does not have this already implemented.

Best regards,
 Miroslav Rajcic
Carlo wrote:
Miroslav Rajcic ha scritto lo scorso 07/10/2004 19.42:
Andrei Yurkevich wrote:
Miroslav Rajcic wrote:

I've already tried this, bur it just doesn't work on Windows version. 
On GTK my code seems to be
working OK.

I too have got (almost) crazy trying to give to a standard GtkWindow a 
"modal" behaviour, but the only way to achieve this is to use a 
GtkDialog.

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK Modal dialog

2004-10-07 Thread Miroslav Rajcic
Andrei Yurkevich wrote:
Miroslav Rajcic wrote:
I am trying to show the dialog in a modal way.
I've read in some old posts that the way to do it is like this:
..
My problem is that dielog doesn't seem modal at all. When I click on its
parent window, dialog falls back underneath all other windows on the
desktop.
Even setting this doesn't help:
gtk_window_set_modal (GTK_WINDOW (dialog1), TRUE);
gtk_window_set_keep_above(GTK_WINDOW (dialog1), TRUE);

try this:
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
cheers,
Andrei

I've already tried this, bur it just doesn't work on Windows version. On 
GTK my code seems to be
working OK.

Thanks,
  Miroslav
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


GTK Modal dialog

2004-10-07 Thread Miroslav Rajcic
I am trying to show the dialog in a modal way.
I've read in some old posts that the way to do it is like this:

 //show dialog
 gtk_widget_show(dialog1);
 gtk_grab_add(dialog1); //disable everything except this dialog
 gtk_main();  //block in modal state until dialog terminates

 //cleanup
 gtk_grab_remove(dialog1);
 gtk_widget_destroy(dialog1);

My problem is that dielog doesn't seem modal at all. When I click on its
parent window, dialog falls back underneath all other windows on the
desktop.
Even setting this doesn't help:
gtk_window_set_modal (GTK_WINDOW (dialog1), TRUE);
gtk_window_set_keep_above(GTK_WINDOW (dialog1), TRUE);

My platform is Win32, gtk-2.4.9

Does anyone know what could be wrong here ?

TIA,
   Miroslav Rajcic


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Submenu inside popup menu problems

2004-09-13 Thread Miroslav Rajcic
Thanks,
that solved the problem, buttons was initialised to the one that started 
the popup (right one) instead of left one.

Regards,
 Miroslav Rajcic
Tommi Komulainen wrote:
On Thu, 2004-09-09 at 11:14, ext Miroslav Rajcic wrote:
 

I've created popup menu with its submenu using code like below. Submenu is
displayed ok, but the problem is no
handler functions are called when submenu item gets clicked (all other popup
menu items work ok).
Can anyone spot the error ?
   

 

int button, event_time;
   

[...]
 

gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button,
event_time);
   

You're not initializing 'button' and 'event_time' ...?
http://developer.gnome.org/doc/API/2.0/gtk/GtkMenu.html#gtk-menu-popup :
   "The button parameter should be the mouse button pressed to
   initiate the menu popup. If the menu popup was initiated by
   something other than a mouse button press, such as a mouse
   button release or a keypress, button should be 0."
What it doesn't say is that you get strange behavior if you don't follow
the advice.  Been there, done almost the same ;)
 

___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Submenu inside popup menu problems

2004-09-09 Thread Miroslav Rajcic
I've created popup menu with its submenu using code like below. Submenu is
displayed ok, but the problem is no
handler functions are called when submenu item gets clicked (all other popup
menu items work ok).

Can anyone spot the error ?

Thanks,
  Miroslav Rajcic


GtkWidget *menu, *submenu;
 GtkWidget *menu_item, *move_item;
 int button, event_time;

 menu = gtk_menu_new ();

 //add menu items
 menu_item = gtk_menu_item_new_with_label("Insert Node\tIns");
 g_signal_connect(GTK_OBJECT (menu_item), "activate", G_CALLBACK
(on_menu_insert_node), NULL);
 gtk_menu_append(menu, menu_item);
 gtk_widget_show (menu_item);  // Show the widget

 move_item = gtk_menu_item_new_with_label("Move Node");
 gtk_menu_append(menu, move_item);
 gtk_widget_show (move_item);  // Show the widget

 submenu = gtk_menu_new ();

 menu_item = gtk_menu_item_new_with_label("Up\tShift+Up");
 gtk_menu_append(submenu, menu_item);
 g_signal_connect(GTK_OBJECT (menu_item), "activate", G_CALLBACK
(on_menu_move_up), NULL);
 gtk_widget_show (menu_item);  // Show the widget

 gtk_menu_item_set_submenu (GTK_MENU_ITEM (move_item), submenu);

 gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button,
event_time);


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


GtkFileChooser bug on Win32 ?

2004-09-09 Thread Miroslav Rajcic
I am having following problems with GtkChooserDialog on Windows (Win2k,
Visual C++ 6.0, latest GTK 2.4.9 from http://gladewin32.sourceforge.net/,but
also on earlier GTK versions including Tor's builds).

Whe I open the dialog, console window pops with following warnings:

Gtk-CRITICAL **: file gtkiconfactory.c: line 1778
(gtk_icon_set_render_icon): assertion `icon_set != NULL' failed
Gtk-CRITICAL **: file gtkiconfactory.c: line 1778
(gtk_icon_set_render_icon): assertion `icon_set != NULL' failed
Gtk-CRITICAL **: file gtkiconfactory.c: line 1778
(gtk_icon_set_render_icon): assertion `icon_set != NULL' failed

Everything keeps working ok, but the debug console poping is embarasing,
particulary in release mode.
Problem might be that one of the virtual drives on my PC (ramdisk) does not
have icon associated with the drive (being listed in chooser dialog without
an icon).

I believe this is bug. I hope someone can verify and fix this issue.

Thanks,
   Miroslav Rajcic


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Problems with "changed" signal on GtkTextBuffer(Win32)

2004-08-24 Thread Miroslav Rajcic
Thanks.

- Original Message - 
From: "Jan-Marek Glogowski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 24, 2004 11:48 AM
Subject: Re: Problems with "changed" signal on GtkTextBuffer(Win32)


> There is a Win32 port of devhelp in cygnome2 - maybe worth looking at
> 
> http://cygnome2.sourceforge.net/


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Problems with "changed" signal on GtkTextBuffer(Win32)

2004-08-24 Thread Miroslav Rajcic
Thanks for your help, new code works now.

Regarding the documentation, I must say that it is sometimes extremly
difficult to browse, with no search ability on http://developer.gnome.org
web site.

Thanks again,
   Miroslav Rajcic

- Original Message - 
From: "David Necas (Yeti)" <[EMAIL PROTECTED]>
To: "Miroslav Rajcic" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 24, 2004 9:52 AM
Subject: Re: Problems with "changed" signal on GtkTextBuffer(Win32)


> > On execution console is opened with warnings below, and callback is
never
> > called back on buffer changes:
> >
> > GLib-GObject-WARNING **: invalid cast from 'GtkTextBuffer' to
'GtkObject'
> > Gtk-CRITICAL **: file gtksignal.c: line 144 (gtk_signal_connect_full):
> > assertion 'GTK_IS_OBJECT (object)' failed
> >
> > Anyone has a clue what might be wrong here ?
>
> You are using *long* deprecated gtk_signal_connect(),
> use g_signal_connect() instead (have you read the doc?)
>
> GtkTextBuffer is not a GtkObject, it's a only GObject
> (have you read the doc?)
>
> Then, it will be unnecessary to cast g_signal_connect()
> argument to anything as it takes a gpointer.
>
> Yeti


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Problems with "changed" signal on GtkTextBuffer(Win32)

2004-08-24 Thread Miroslav Rajcic
Hi!

I am using latest Win32 version of the GTK (gtk+-2.4.7, glib-2.4.5)
downloaded from http://www.gimp.org/~tml/gimp/win32/
and I am having following problem.

Code below does not seem to work:

--
void on_textview_edited( GtkTextBuffer *, gpointer data );

 GtkTextBuffer *buffer = gtk_text_buffer_new (NULL);
GtkWidget *textview1 = gtk_text_view_new_with_buffer (buffer);
 gtk_signal_connect (GTK_OBJECT (buffer), "changed",
G_CALLBACK(on_textview_edited),  NULL);

--

On execution console is opened with warnings below, and callback is never
called back on buffer changes:

GLib-GObject-WARNING **: invalid cast from 'GtkTextBuffer' to 'GtkObject'
Gtk-CRITICAL **: file gtksignal.c: line 144 (gtk_signal_connect_full):
assertion 'GTK_IS_OBJECT (object)' failed

Anyone has a clue what might be wrong here ?

Thanks,
   Miroslav Rajcic


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list