Re: Gtk::FileChooserButton

2011-04-29 Thread Jaroslav Šmíd
I know this won't help much, but when writing new app, I wouldn't bother 
to use gtk2 anymore and I would use gtk3 instead.


Anyway, you could always just destroy the whole dialog and create it 
anew so that the file won't be selected.


On 04/29/2011 07:54 PM, John Emmas wrote:

I've been experimenting with this for a few hours now.  AFAICT there's a very 
significant difference in the way a Gtk::FileChooser dialog works in Windows, 
compared to its operation in Linux.  Here's what I found:-

1)  Launch a Gtk::FileChooser from a  Gtk::FileChooserButton.  Select a file and click 
Open.  The chosen file becomes the currently selected filename.  In other 
words, Gtk::FileChooser::get_filename() returns the path to the chosen file.

2)  The above path name is persistent.  If I re-launch the same FileChooser 
dialog, the previously selected file is preselected when the dialog re-opens.

3)  After re-opening the dialog, select an empty folder and press 'Cancel'.  In the Linux 
version this has the effect of removing the previous selection.  In other words the 
original Gtk::FileChooserButton goes back to displaying (None) and 
Gtk::FileChooser::get_filename() returns an empty string.  However, this doesn't seem to 
be the same in gtk-win32.  After selecting an empty folder and pressing 'Cancel' the 
original Gtk::FileChooserButton still displays the previously chosen filename and 
Gtk::FileChooser::get_filename() continues to return its path.

I could delve into this a bit further during the next day or two but I'd be 
interested to know which is the intended behaviour.

In Windows I'm building with gtk version 2.20.0.  My Linux version is slightly 
older - around 2.18.  Is it possible that the behaviour got changed somewhere 
between them?

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

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


Re: GTK3 porting problem (clipboard)

2011-03-11 Thread Jaroslav Šmíd

GtkTargetEntry targets[] = {
  {text/html, 0, 0},
  {text/plain, 0, 0}
};

size_t num_targets = sizeof(targets) / sizeof(targets[]);

// This IS required no matter what, or your program WILL BE broken
if (sizeof(size_t)  sizeof(guint)  num_targets  (size_t)G_MAX_GUINT) {
  // fail here because of stupid decision to use guint instead of size_t
  // this might get optimised away by compiler (condition is know to be 
false/true during compile-time

}

gtk_clipboard_set_with_data(clipboard, targets, (guint)num_targets, 
get_func, clear_func, data);


NOTE: you will get warning about conversion from const char* to char*. 
This is that even though this was reported as BUG years ago, once it was 
fixed and that fix was removed because it broke existing apps. Still, 
the could've fixed this for GTK3, but they didn't. Right way to do this 
would be either allocate string using strdup and than free it, or use 
something like this:


char target1[] = text/html;
char target2[] = text/plain;

// char *target = blabla; // this is NOT right

GtkTargetEntry targets[] = {
  { target1, 0, 0},
  { target2, 0, 0},
};

On 03/11/2011 08:55 AM, Miroslav Rajcic wrote:

You're right, but this seems odd. In the GTK3 version of the
documentation the basic structures GtkTargetEntry and
GtkTargetPair are still exposed in the API, and although
GtkTargetList is said to be opaque (a) it's unclear why this
should be so (it seems to be a trivial composite) and (b) the
functionality that was previously available via the struct itself
is not replicated via accessor functions. For example, there's no

gtk_target_list_get_n_targets()

to replace the original poster's GTK2 idiom:

int nTargetCnt = g_list_length (list-list);


Perhaps someone knows any workaround for what I am trying to do in my
code or a way to implement this differently?

The code does the following:

//create a target list with text and HTML formats
GtkTargetList *list = gtk_target_list_new (NULL, 0);
gtk_target_list_add(list, atomTextHtml, 0, 0);
gtk_target_list_add_text_targets(list, 0);

//now I need to convert the target list to an array of the
GtkTargetEntry structures as needed by gtk_clipboard_set_with_data
int nTargetCnt = g_list_length (list-list);
GtkTargetEntry *targets = g_new0 (GtkTargetEntry, nTargetCnt);
int i=0;
for (GList *l=list-list; l; l=l-next, i++)
{
GtkTargetPair *pair = (GtkTargetPair *)l-data;
targets[i].target = gdk_atom_name (pair-target);
}

//set the clipboard with target formats
gboolean bOK = gtk_clipboard_set_with_data(clipboard, targets,
nTargetCnt, MyGtkClipboardGetFunc, NULL, 0);

Basically the big problem is that gtk_clipboard_set_with_data API does
not use GtktargetList directly.

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

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


Re: GTK3 porting problem (clipboard)

2011-03-11 Thread Jaroslav Šmíd

Maybe you should report the bug about missing accessors so it gets fixed.

On 03/11/2011 12:06 PM, Miroslav Rajcic wrote:

GtkTargetEntry targets[] = {
{text/html, 0, 0},
{text/plain, 0, 0}
};

size_t num_targets = sizeof(targets) / sizeof(targets[]);



This would work if I would know the count of the targets in advance.
I want to support all possible text formats, so I use
gtk_target_list_add_text_targets as shown in my previous mail.

The problem is that gtk_target_list_add_text_targets adds several text
related formats.
At compile time I don't know how many formats will it add, it can
probably vary from platform to platform or according to some other state.
This makes your static array of entries unusable to me :(

Regards,
Miroslav






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


Re: I Miss Using My Anjuta IDE

2011-03-11 Thread Jaroslav Šmíd

This might be caused by gkt2 - gtk3 transition.

On 03/11/2011 01:23 PM, Craig Bakalian wrote:

Hi,

I don't know if this is the right place to complain about this, but ever
since I update to 11.04 I have not been able to use Anjuta IDE. It
crashes during initialization or opening. There appear to be many
package conflicts in 11.04 and I am not experienced enough with these
matters to even know what is wrong, but does anyone know when or if
these issues will be resolved by the end of April?

There are also issues with Glade Interface Designer.  You can't add a
menu now, the menu object is grayed out. There are other conflicts with
Glade Interface Designer, like there is no gtksourceview object at
all.

I guess the general question is, why are there so many conflicts with in
the development layer of gnome and ubuntu 11.04.  Is it Unity?

Or is this a question for the ubuntu team, where and who ever they are?



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


Re: GTK3 porting problem (clipboard)

2011-03-11 Thread Jaroslav Šmíd

Seems I was blind not to see gtk_target_table_from_list.
And maybe I was not alone :-)

J.

On 03/10/2011 01:44 PM, Miroslav Rajcic wrote:

I resolved the majority of the the issues when porting my program from
GTK 2.x to GTK 3.x.
Unfortunately I still have one issue left:

when compiling the program on Feodra 15 alpha (gcc 4.6, GTK3 v3.0.2) I
get these errors:

./src/clipboard.cpp:442:38: error: invalid use of incomplete type
'GtkTargetList'
/usr/include/gtk-3.0/gtk/gtkselection.h:48:16: error: forward
declaration of 'GtkTargetList'
./src/clipboard.cpp:445:20: error: invalid use of incomplete type
'GtkTargetList'
/usr/include/gtk-3.0/gtk/gtkselection.h:48:16: error: forward
declaration of 'GtkTargetList'
./src/clipboard.cpp:447:3: error: 'GtkTargetPair' was not declared in
this scope
./src/clipboard.cpp:447:18: error: 'pair' was not declared in this scope

The relevant code is this:

#include gtk/gtk.h

GtkTargetList *list = gtk_target_list_new (NULL, 0);
.. add text and other targets in the list

// LINE 442: error: invalid use of incomplete type 'GtkTargetList'
int nTargetCnt = g_list_length (list-list);

//LINE 445: error: invalid use of incomplete type 'GtkTargetList'
for (GList *l=list-list; l; l=l-next, i++)

//LINE 447: error: 'GtkTargetPair' was not declared in this scope
GtkTargetPair *pair = (GtkTargetPair *)l-data;

This all works fine with GTK2.x.

What is the correct way to work with this on GTK 3.x ?

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

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


Re: GTK3 porting problem (clipboard)

2011-03-10 Thread Jaroslav Šmíd

I don't know the answer, but this is wrong:
int nTargetCnt = g_list_length (list-list);

g_list_length returns guint, not int. Although this is valid code 
(implicit typecast), it can cause bad things.


On 03/10/2011 01:44 PM, Miroslav Rajcic wrote:

I resolved the majority of the the issues when porting my program from
GTK 2.x to GTK 3.x.
Unfortunately I still have one issue left:

when compiling the program on Feodra 15 alpha (gcc 4.6, GTK3 v3.0.2) I
get these errors:

./src/clipboard.cpp:442:38: error: invalid use of incomplete type
'GtkTargetList'
/usr/include/gtk-3.0/gtk/gtkselection.h:48:16: error: forward
declaration of 'GtkTargetList'
./src/clipboard.cpp:445:20: error: invalid use of incomplete type
'GtkTargetList'
/usr/include/gtk-3.0/gtk/gtkselection.h:48:16: error: forward
declaration of 'GtkTargetList'
./src/clipboard.cpp:447:3: error: 'GtkTargetPair' was not declared in
this scope
./src/clipboard.cpp:447:18: error: 'pair' was not declared in this scope

The relevant code is this:

#include gtk/gtk.h

GtkTargetList *list = gtk_target_list_new (NULL, 0);
.. add text and other targets in the list

// LINE 442: error: invalid use of incomplete type 'GtkTargetList'
int nTargetCnt = g_list_length (list-list);

//LINE 445: error: invalid use of incomplete type 'GtkTargetList'
for (GList *l=list-list; l; l=l-next, i++)

//LINE 447: error: 'GtkTargetPair' was not declared in this scope
GtkTargetPair *pair = (GtkTargetPair *)l-data;

This all works fine with GTK2.x.

What is the correct way to work with this on GTK 3.x ?

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

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


Re: g_remove

2011-02-19 Thread Jaroslav Šmíd

On 02/19/2011 10:19 AM, David Nečas wrote:

On Sat, Feb 19, 2011 at 01:21:37AM +0100, Jaroslav Šmíd wrote:

C99 has no implicit int shits, so don't ignore compiler's warning and
fix it.

David Nečas: All according to the C standard. Right, you didn't tell
us which one, one could think you mean every C standard out there.


My English is not perfect but I think can distinguish between a
standard, the standard and all standards, thank you very much.


Maybe. Doesn't meen you didn't tell which one.



So, no the standard means a single C standard.  The only C standard
relevant to the problem.

The standard the Criag's C compiler adheres to

(or at least tries) while compiling the program.


Yes, C99 is the only relevant. I was compiling glib on FreeBSD recently 
and I noticed that at least 1 depency* of glib required -std=c99 and at 
least one required -std=gnu99 argument for compiling, that means glib 
and any app using glib is indirectly dependent on compiler with C99 
support. And without C99, glib's condition of requiring 64bit integer 
type could be hardly met e.g. on x86-32 linux with glibc without C99 
support - glibc has typedef long long to int64_t on such system and 
long long is only available in C99. So glib depends on C99 compiler, at 
least on x86-32 linux with glibc and on FreeBSD@amd64. Because of that, 
the standard substitutes to C99 standard in my head.


* direct, indirect, build time or runtime ... it is depency. Don't know 
names, but if you want, you can find out by yourself.




Yeti



Jardík
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: g_remove

2011-02-19 Thread Jaroslav Šmíd

Hmm, resending, got identified as spam ...

On 02/19/2011 02:37 PM, Jaroslav Šmíd wrote:

On 02/19/2011 10:19 AM, David Nečas wrote:

On Sat, Feb 19, 2011 at 01:21:37AM +0100, Jaroslav Šmíd wrote:

C99 has no implicit int ., so don't ignore compiler's warning and
fix it.

David Nečas: All according to the C standard. Right, you didn't tell
us which one, one could think you mean every C standard out there.


My English is not perfect but I think can distinguish between a
standard, the standard and all standards, thank you very much.


Maybe. Doesn't meen you didn't tell which one.



So, no the standard means a single C standard. The only C standard
relevant to the problem.

The standard the Criag's C compiler adheres to

(or at least tries) while compiling the program.


Yes, C99 is the only relevant. I was compiling glib on FreeBSD recently
and I noticed that at least 1 depency* of glib required -std=c99 and at
least one required -std=gnu99 argument for compiling, that means glib
and any app using glib is indirectly dependent on compiler with C99
support. And without C99, glib's condition of requiring 64bit integer
type could be hardly met e.g. on x86-32 linux with glibc without C99
support - glibc has typedef long long to int64_t on such system and
long long is only available in C99. So glib depends on C99 compiler, at
least on x86-32 linux with glibc and on FreeBSD@amd64. Because of that,
the standard substitutes to C99 standard in my head.

* direct, indirect, build time or runtime ... it is depency. Don't know
names, but if you want, you can find out by yourself.



Yeti



Jardík

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

Re: g_remove

2011-02-19 Thread Jaroslav Šmíd

#include glib.h

int main(int argc, char **argv)
{
  gint64 a;
  return 0;
}

- doesn't compile on x86-32 linux with glibc when I remove all typedefes 
and occurences of long long in header files (long long is not part of 
C89 standard and it would be unfair to leave it there even if it is some 
compiler extension of the C89 standard). Because there is no other 64bit 
integer type on such system, I cannot typedef gint64 to something else. 
I doubt this will get fixed, glib requires 64bit integer type (as stated 
in docs), C89 doesn't guarantee its existence and no C89 type is 64bit 
on x86-32 linux.


On 02/19/2011 02:50 PM, David Nečas wrote:

On Sat, Feb 19, 2011 at 02:37:51PM +0100, Jaroslav Šmíd wrote:


Maybe. Doesn't meen you didn't tell which one.


I did not have to because everyone except you understood the context.
Since you did not ask the question and evidently know better your
failure to understand is of little concern.


* direct, indirect, build time or runtime ... it is depency. Don't know
names, but if you want, you can find out by yourself.


It also has dependences that require C++, GMP and Perl – and they are
equally irrelvant.

Demonstrate that a C99 compiler is required to compile GLib-using
programs.  And I will go and fill this as a bug in Gnome bugzilla and it
will be fixed because the developers have repeatedly declared GLib is
C89-compatible.

Yeti


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

Re: g_remove

2011-02-19 Thread Jaroslav Šmíd
Glib itself wouldn't even compile if I removed that before compilation 
as it wouldn't find 64bit integer type. Glib just cannot require 64bit 
integer type and be C89 standard compliant at the same time when C89 
doesn't require existence of 64bit integer type.


Ok, I won't troll anymore.

On 02/19/2011 03:20 PM, Tor Lillqvist wrote:

- doesn't compile on x86-32 linux with glibc when I remove all typedefes and
occurences of long long in header files


Equally interesting, it doesn't compile if you replace all instances
of the letter 'a' in your header files with the letter 'b'. Or, if you
feel really adventurous, with the letter 'x'.

Each GLib build is configured to work with a specific compiler, C
library, and associated header files. If you break the header files on
purpose, you can't expect the same GLib developer package to work with
it any more.

--tml

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


Re: interested in gtk+ project development

2011-02-18 Thread Jaroslav Šmíd
If you are currently learning C, please, learn the difference between 
size_t, int and long - some of glib/GTK devs didn't and because of that 
they use int in places where size_t is more appropriate. For example 
g_application_open() - quite new API and they had to mess it up by using 
(g)int instead of size_t. Or they can do magic and even on system with 
sizeof(size_t)  sizeof(int) they actually can manipulate with objects 
impossible to allocate (although I don't know of such system, but C 
standard doesn't forbid it). On the other hand, on systems with 
sizeof(size_t)  sizeof(int), they limit you. Moreover, they force you 
to do ugly things, such as having to typecast result of sizeof operator 
to int and check boundaries to make sure you got it right and it didn't 
overflow 20 times.


(Sorry, I just had to, it's really annoying when such API appears and 
cannot be fixed because of ABI incompatible change).


On 02/16/2011 05:47 AM, Patrick Noble wrote:

Hey All,
My names Patrick Noble, and was hoping for a few pointers... I am interested
in learning about and helping out in a development project such as Glade or
GTK+, and was wondering if my experience level makes this pointless. I am
currently learning through C, and am fairly confident in its main structure
and common built in functions. I also have experience working with the gooey
GUI builder of glade, although I have almost no knowledge of GTK+
programming. Any advice as far as skills I should look into or places I
could help out?

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

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


Re: g_remove

2011-02-18 Thread Jaroslav Šmíd
C99 has no implicit int shits, so don't ignore compiler's warning and 
fix it.


David Nečas: All according to the C standard. Right, you didn't tell 
us which one, one could think you mean every C standard out there. C99 
is old enough to be supported by decent compilers, older standards 
aren't worth mentioning or using.


On 02/17/2011 06:56 PM, David Nečas wrote:

On Thu, Feb 17, 2011 at 12:45:36PM -0500, Craig Bakalian wrote:

I have gtk and glib as includes?  Am I missing something?


Yes, on Unix the g_-wrappers are often just macros resolving to the
underlying system function.  So you need to

#includestdio.h

to get the real declarations (dunno why it's not done automatically in
this case).


If there
wasn't the right include, the build would fail, further, the function
wouldn't remove the file.


On the contrary, unless you pass -Werror=implicit-function-declaration
or an equivalent of that to the compiler the missing declaration just
causes a warning.  The compiler then implicitly constructs the prototype
as `takes whatever argument you happen to pass to it and returns int'
which is sufficiently right here and the program works fine.  All
according to the C standard.

Regards,

Yeti

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

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

Re: GTK+ 2.99.3 released

2011-02-03 Thread Jaroslav Šmíd

On 02/02/2011 09:32 PM, David Nečas wrote:

On Wed, Feb 02, 2011 at 08:47:48PM +0100, Jaroslav Šmíd wrote:

I am running ubuntu 10.10 and Gnome 2.32.0.  I am a bit afraid to update
via a install from a tar download because of all the dependence issues
on ubuntu.  Is there a way to update via command line or synaptic?


Install gtk2-dev (or something like that). It will install most of
required depencies to build new glib and gtk3.

After that, download glib, and install like this:

./configure --prefix=/opt/gtk3-stuff
...

Nothing to be afraid of as long as you install to /opt/gtk3-stuff and
not to /usr.


This is a good advice *but* /opt should be replaced with $HOME/opt or
something similar.  Unless you actually need to test packaging and
system integration don't do anything as root.  (And even if you perform
such testing you generally want to do it in chroot or a virtual
machine that can be safely destroyed.)

Yeti

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


Who said something about root? Having gtk3-stuff directory in /opt 
doesn't imply using root account to install gtk3. I find it better then 
making mess in my home directory.


---
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Strange GObject warning, crashes GUI

2011-02-02 Thread Jaroslav Šmíd
If window managers hang because app is behaving badly, it is serious 
bug of the window manager or even X itself - this just shall not happen 
and if it does it is yet another + for wayland.


On 01/15/2011 04:57 PM, John Coppens wrote:

On Sat, 15 Jan 2011 12:38:03 +0200
Mohammed Sameermsam...@foolab.org  wrote:


GLib-GObject-WARNING **: gsignal.c:3081: signal name `depressed' is
invalid for instance `0x8a0900'

messages.


I've seen this error only once when I was writing a C++ wrapper for a GObject 
and
the GObject instance was being unref'ed thus destroyed without the C++ wrapper
being informed. The C++ wrapper later on tried to call an action signal on
the invalid instance it had and Glib printed that error.

So it was the C++ wrapper trying to use some garbage memory as the GObject.


Hello Mohamed...

Thanks for the reply. I'm programming in C, and the code for the
ComboBox is very uncomplicated. Also, there is no way for anything to
have been unref'd, as far as I can detect.

Interesting would be to be able to identify what is at instance
`0x8a0900'


I think this also explains the hang because of the invalid memory reference.


The hang, according to a suggestion from Johannes on the Anjuta list:

quote
That hang happens when you have a breakpoint in a signal handler
that processes some kind of synchronous X event. Possible solution is to
start anjuta from a different terminal like this:

DISPLAY=:0 gdb anjuta

and switch back to that terminal when X hangs and look at the debug
output.
/quote

This explains why most of the window manager hangs. I have yet to try
this out.

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

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


Re: GTK+ 2.99.3 released

2011-02-02 Thread Jaroslav Šmíd

I am running ubuntu 10.10 and Gnome 2.32.0.  I am a bit afraid to update
via a install from a tar download because of all the dependence issues
on ubuntu.  Is there a way to update via command line or synaptic?


Install gtk2-dev (or something like that). It will install most of 
required depencies to build new glib and gtk3.


After that, download glib, and install like this:

./configure --prefix=/opt/gtk3-stuff
make
make install

Then create script /opt/gtk3-stuff/bin/gtk3-set-env.sh with content:

#!/bin/sh
export PATH=/opt/gtk3-stuff/bin:${PATH}
export LD_LIBRARY_PATH=/opt/gtk3-stuff/lib:${LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=/opt/gtk3-stuff/lib/pkgconfig

Make it executable and source it
chmod +x /opt/gtk3-stuff/bin/gtk3-set-env.sh
source /opt/gtk3-stuff/bin/gtk3-set-env.sh

You will need to source the file everytime you would like to build 
gtk3 app or app using newest glib (which seems to be required by gtk3).


Now build gtk3:

./configure --prefix=/opt/gtk3-stuff
make
make install

Nothing to be afraid of as long as you install to /opt/gtk3-stuff and 
not to /usr.


Feel free to ask if you get configure/compilation error - maybe few 
build depencies will be required, which won't get installed as depencies 
for gtk2-dev.

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


Re: Couldn't link my app with GTK+ 3

2011-02-01 Thread Jaroslav Šmíd

export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
./configure

pkg-config used in confugure script will use glib-2.0.pc from that 
location. PKG_CONFIG_PATH should point to your new glib's 
${libdir}/pkgconfig/


Your old glib doesn't seem to have functions/symbols used in gtk-3 and 
you will need to use the new one.


Note that by installing with prefix=/usr, you overwrote old headers with 
new ones, but you installed libraries next to old ones. Looks like you 
should've used something like

./configure --prefix=/usr --libdir=/usr/lib64
as you seem to have multilib system. This will make old apps to use new 
glib, but that should be OK as only new api is added.


On 01/31/2011 12:02 PM, Mike wrote:

于 2011年01月31日 16:56, David Nečas 写道:

On Mon, Jan 31, 2011 at 04:03:04PM +0800, Mike wrote:

OS: Fedora 14 x86_64
GCC: 4.5.1 20100924

I have a app project, use GTK+2.
I want to move it to GTK+3.
So I git clone latest glib.
Compiled them.
(I use GTK3 in mirror, not compile by myself)

Does pkg-config know about the new GLib? I.e. did you set
PKG_CONFIG_PATH? If it does not you cannot expect it to do anything
else than give you the flags for the system GLib.

Yeti



there are results..
--
$ pkg-config --cflags --libs glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -lglib-2.0
$ echo $PKG_CONFIG_PATH

$
--

Latest glib will be install to /usr/lib...


There is /usr/lib/pkgconfig/glib-2.0.pc (compile by myself)
--
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: GLib
Description: C Utility Library
Version: 2.27.94
Libs: -L${libdir} -lglib-2.0
Libs.private:
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include
--

And there is /usr/lib64/pkgconfig/glib-2.0.pc
--
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

glib_genmarshal=glib-genmarshal
gobject_query=gobject-query
glib_mkenums=glib-mkenums

Name: GLib
Description: C Utility Library
Version: 2.26.0
Libs: -L${libdir} -lglib-2.0
Libs.private:
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include
--

Well... How to modify PKG_CONFIG_PATH?
I try to:
--
$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
$ ./configure
.
$ make -j2
..
CCLD gkiu
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_add_action'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_set_action_enabled'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_get_type'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_quit_with_data'
/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libgtk-x11-3.0.so:
undefined reference to `g_application_run'
..
--


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

Re: Application path

2011-01-17 Thread Jaroslav Šmíd
The only way to get this on linux is to read symlink /proc/self/exe 
(readlink()) On Windows, you can use GetModuleName(NULL, xx, yy). Don't 
know if glib has anything for this.


On 01/12/2011 02:13 PM, John Emmas wrote:

Browsing through glib/gutils.c this morning, I noticed a function called g_get_application_name() which will return the 
application's name (e.g. my_app on Linux, or my_app.exe on Windows).  Is there any similar 
function that would tell me the full path to the application - e.g. /usr/bin/my_app/my_app under Linux, or 
C:\Program Files\my_app\my_app.exe under Windows?

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

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


Re: Transparent Floating GtkEntry

2011-01-17 Thread Jaroslav Šmíd

Transparent entry - see gtk-demo, offscreen widgets.
Entry on top - well, you could implement custom GtkContainer, but don't 
know if events will work right ...


On 01/07/2011 10:46 PM, Cinolt wrote:

Hello, I want develop a game that can take multilingual input, including CJK
characters. Is it possible to have a GtkDrawingArea fill the entire window
and have a GtkEntry floating on top of it? Also is it possible to make the
background and border of the GtkEntry transparent? Thanks for any help.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: Bring a widget to the foreground

2011-01-04 Thread Jaroslav Šmíd
Don't do that. Fixed size buffers are evil for string formatting. You 
better use g_strdup_printf even though this would lead to reallocations. 
But much better then end up with cropped text.


On 01/02/2011 10:00 PM, jcup...@gmail.com wrote:

On 2 January 2011 15:39, John Emmasjohn...@tiscali.co.uk  wrote:

To be honest, all I'm trying to do is create a button whose label font can be 
changed on demand.  I've managed to achieve it by using an empty button with a 
label on top, except that the label doesn't always stay on top!


Ah, OK, yes, there's a much simpler technique.

Try something like this:

   txt = some text to display;
   font = sans 12;

   snprintf (button_text, 256,
  span font_desc=\%s\ size=\medium\%s/span,
  font, txt);
   gtk_label_set_markup (
 GTK_LABEL (gtk_bin_get_child (GTK_BIN (button))),
 button_text);

Assuming 'button' is a regular gtk button containing a label.

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

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


Re: Signal inside widget subclass

2010-12-02 Thread Jaroslav Šmíd

Lets say your buffer's class is like

typedef struct _MyTextBufferClass
{
  GtkTextBufferClass parent_class;
  // more stuff here
} MyTextBufferClass;


Basicaly in my_text_buffer_class_init override changed function

void my_text_buffer_class_init(MyTextBufferClass *klass)
{
  GtkTextBufferClass* tbc = (GtkTextBufferClass*)klass;

  tbc-changed = your_function_name_here;
}

And then in your function call previous function

void your_function_name_here(GtkTextBuffer *buffer)
{
  // your stuff here

  GTK_TEXT_BUFFER_CLASS(my_text_buffer_parent_class)-changed(buffer)
}


On 12/02/2010 04:42 AM, Erick Pérez Castellanos wrote:

Hi:
I have this design issue: I’m kinda newbie with gtk development, so
sorry is this is the first line on some mystery tutorial out there .

I’m subclassing a Gtk.TextBuffer and I want to know inside the widget
code when the “changed” signal is emitted. I know I always can connect a
callback to the signal, that why they exist anyway, but that sound like
something I wouldn't do inside the widget.

Is it correct ? At least from the Gtk development/design point view. It
works, really well, my point is purely about design, maybe there a
better and prettier way of doing this.

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

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

Cancel construction of GObject

2010-11-27 Thread Jaroslav Šmíd

Is it possible to cancel construction in gobject-derived class?

Lets say I have GMyObject derived from GObject. In its init function I 
need to spawn a thread. When that fails, I would like to cancel 
construction of the object (so that gobjectclass' finalize function 
would be called on the object and g_object_new would return null-pointer).


I know I can create extra function, which would call g_type_new and 
spawn the thread then and destroy the object if it fails, but I would 
like my object to be instantiable by g_object_new and not force user to 
call extra initialization function and destroy the object if it fails.

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


Re: Cancel construction of GObject

2010-11-27 Thread Jaroslav Šmíd

On 11/27/2010 05:32 PM, Jannis Pohlmann wrote:

On Sat, 27 Nov 2010 12:14:39 +0100
Jaroslav Šmídjardas...@gmail.com  wrote:


Is it possible to cancel construction in gobject-derived class?

Lets say I have GMyObject derived from GObject. In its init function
I need to spawn a thread. When that fails, I would like to cancel
construction of the object (so that gobjectclass' finalize function
would be called on the object and g_object_new would return
null-pointer).


Have a look at the GInitable and GAsyncInitable interfaces.

   - Jannis



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


Cool, thanks.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: GTK Error handling..

2010-11-24 Thread Jaroslav Šmíd
GTK is not smart toolkit and is unable to work without X display and is 
not even able to reconnect to different display (or to the same later) 
when the connection get lost. This is with all X based toolkits I know 
of - it just seems easier for developers to just call exit() then to 
install like timer to event loop which would try to reconnect. This way 
it works on Windows - GUI applications are able to work without GUI 
subsystem being active (e.g. when it crashes because of driver failure). 
When the GUI subsystem is restarted (either with the same driver or 
geeric vesa driver), GUI applications still works, because WindowsAPI 
takes care of this. GTK on X-based systems does not, even if that is not 
too much work (just catch X server error, discard all X id's for every 
top level windows, pixmaps, ..., and then when it gets reconnected, 
create them again and in the meanwhile use stubs).


On 11/24/2010 03:41 AM, Champ Clark III [Softwink] wrote:


Hello all!

I have a multi-threaded application written in C that I'm a
bit stumped on.  It's not the 'multithreaded' portion of the code I'm
having issues with.  That seems to be functional.  It's the GTK error
and warning handling.

The application is constantly processing data (syslog).  When a
rule is 'satisfied',  a thread is spawned which builds a simple GTK
window (popup) with the information about the 'event.'   So far,  so
good.  However,  I'm not sure how to handle certain error events.  For
example,   let's say I'm sending 'popups' to a workstation across a
network.   The remote workstation goes off line (the user leaves,
powers it down, whatever).  My application,  of course,  won't be able
to send the GTK 'popup'.  I'll likely get the error:

Gtk-WARNING **: cannot open display: 10.10.10.10:0.0

Here's my problem.   This error/warning causes termination of
the over all application.  Even though the 'error/warning' gets generated
from within my 'GTK thread',  it terminates the whole application.  That's
not good.   Is there any way I could intercept or use a callback with
the warnings/errors?  That is,  I'd like to log the warnings/errors,  but
I don't want termination of my software due to a GTK/X11 problem.
Basically,  some method to let me deal with the GTK/X11 errors the way I
see fit.

I hope this makes sense.  Let me know if you have any questions.




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

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


Re: GTK Error handling..

2010-11-24 Thread Jaroslav Šmíd
New process, use g_spawn_with_pipes (or how is it called) and just pass 
it through pipe.


On 11/24/2010 02:35 PM, Champ Clark III [Softwink] wrote:

On Wed, Nov 24, 2010 at 03:22:56PM +0200, Dov Grobgeld wrote:

If all you want is a popup, then you might as well create a new process
instead of a new thread. There is no advantage of using a thread as it does
not seem like you want to pass any info between the window and the
monitoring loop. Further, the way you described it, if more than one event
occurs, then you will be spawning two threads that does calls into GUI. This
is a big no-no as gtk is not multi-threaded, and only a single thread may do
graphics related calls.


First off,  thanks for all the responses.

The only information that needs to be passed is from the
monitor loop (the alert information) to the thread that creates the
popup window.   That part is complete,  but considering the error
handling,   I'm reconsidering how I'm doing this.It looks like
I'll probably create a new process to deal with the popup.




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

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


Re: Problem with GSource and polling

2010-11-20 Thread Jaroslav Šmíd
Perhaps he wrote himself some kind of kernel module which provides
pollable file descriptor ...

On Sat, Nov 20, 2010 at 9:57 AM, Ardhan Madras aj...@knac.com wrote:
 Hi Jannis,

        I'm sorry but what `kernel module' you are talkin' about?, is it the 
 application's module?

        Ardhan,


 --- jan...@xfce.org wrote:

 From: Jannis Pohlmann jan...@xfce.org
 To: gtk-app-devel-list@gnome.org
 Subject: Re: Problem with GSource and polling
 Date: Thu, 18 Nov 2010 03:53:20 +0100

 Hi again,

 On Thu, 18 Nov 2010 02:26:20 +0100
 Jannis Pohlmann jan...@xfce.org wrote:

 Hi folks,

 I have a question about using GSource in combinaton with GPollFD.

 Nevermind, I forgot to add poll_wait() in the poll() handler of the
 kernel module that created the file descriptor. Now with that added,
 the GLib main loop wakes up on a poll event even if I am not moving the
 mouse cursor around like crazy in my application window. ;)

  - Jannis


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



 _
 Listen to KNAC, Hit the Home page and Tune In Live! --- http://www.knac.com
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Problem with 64 bit gtk binaries in Win 7 (32 bit works fine)

2010-11-08 Thread Jaroslav Šmíd




-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Problem with 64 bit gtk binaries in Win 7 (32 bit works fine)

2010-11-07 Thread Jaroslav Šmíd
Can you provide example code (the one which uses GTK+)? I'm not quite
sure if I understand what you mean. By called in GTK+ functions you
mean in callbacks? Does that work if you use glib only?

On Sat, Nov 6, 2010 at 7:25 PM, Mario M maqueo.ma...@gmail.com wrote:
 Sorry for the typo, Jaroslav.

 2010/11/6 Mario M maqueo.ma...@gmail.com

 Hello,
  thanks for the info about the underscores : ), now I learned something
 interesting.

 I ended up downloading the source and MSYS and compiling GTK+ in my 64 bit
 system. It was a long and tedious process :P getting all the dependencies,
 setting up environment variables... also I had to install PERL because some
 part of the compilation needed it, but...

 In the end compiling it worked and my linker now recognized it and I didn't
 have underscores problems anymore :)

 However, I found that it didn't solve the vertex problem. I was so
 frustrated that I ended up compiling WxWindows and trying to learn how to
 use it (which has been a bit complicated because I don't have too much time
 left for this project), but when I built the app using WxWindows, I had the
 same problem!

 Here is a more detailed description of this problem:
 I have a class that stores values read from files in float arrays. I have
 another class that uses the previous one, and this latter class is used in
 the main file,  in the GTK+ functions.

  In my laptop with a 32 bit system, everything is cool. It works as
 expected.
 In my 64 bit machine (and another 64 bit machine), the array values are
 messed up. If I initialize the arrays to some arbitrary number, that will be
 the final value of the arrays when I call them. However, if I directly
 called the first class from the main.cpp file without using the second
 class, it works!

 I built a test program that uses those classes the same way, without using
 GTK+ (using GLUT for window creation), it works without a problem!

 After discovering that WxWindows didn't solve the problem, I set up various
 tests, and in the end found out the source of the problem. In the class that
 reads from files, I was using cstdio functions (fscanf mainly). I found out
 than when called from GTK+ with the intermediary class, the fscanf calls
 would read the strings but not the floats, the values stored in the passed
 variables would stay the same as before the call. (these values are vertex
 positions)

 I solved this issue changing all the csdtio calls to c++ calls ( from the
 ifstream library e.g. ifstream fin(file); finfloatVar; ). With the c++
 calls the values were adecuately read and stored. There is a side problem,
 now the reading process is significantly slower and I have to wait several
 seconds for the program to read the files.

 I am utterly perplexed by this, any insight is welcome : )

 Thanks again for your time, and thanks Jaroslay for answering my first
 e-mail.

 Mario Maqueo

 2010/11/2 Jaroslav Šmíd jardas...@gmail.com

 Mingw64 defaults to no leading underscores (this is quite new
 feature), make sure GTK+ libraries are compiled by mingw64 version
 built after this was done. If you use newer mingw64 and older GTK+ or
 vice versa - trouble ahead :-)


 On Tue, Nov 2, 2010 at 9:03 AM, Mario M maqueo.ma...@gmail.com wrote:
  Hello, I have Windows 7 64 bits and I am working on a GTK+ project that
 uses
  OpenGL in C++. I am using GLADE and the normal version of GTK+ (not
 gtkmm).
 
  I was working on a laptop with Windows 7 32 bits and the program worked
  fine, but the video card in that laptop was really bad (Intel,
 integrated)
  so I switched to a desktop with 64 bit windows and a better video card
  (Nvidia GT 240).
 
  The code compiles fine in both versions of windows, using the 32 bit
 version
  of gtk. However, some horrible things have been happening:
 
  - The OpenGL window would not update correctly, taking a long time to do
 so,
  seemingly at random times.  I was using gtkglext for the OpenGL binding
 but
  I found out this problem was caused by gtkglext not being updated (since
  2006) and the problem is with Aero in Windows, If desktop compositing
 was
  disabled, it would work fine. I decided to ditch gtkglext and use OpenGL
  directly, after a while I managed to and this problem was fixed.
 
  - Some colors were messed up with lighting enabled, at first I thought
 this
  and the previous problem had to do with the video card, but this was
 weird
  because the same program without gtk would work fine. However I managed
 to
  correct it adding a few simple OpenGL instructions. I'm not sure why it
  worked fine without GTK+, but it seems to work fine now with my fix.
 
  - I have a library for loading 3d models, in my laptop it worked fine,
 but
  on the new computer (and another one where i tested it), the 3d models
  render as a single horizontal :S, all of them. They are drawn using
 openGL
  functions and storing the vertex positions in lists. I discovered this:
 When
  I load an object in the main.cpp file, and draw

Re: Strange display problem with gtk-win32 and VC++

2010-11-07 Thread Jaroslav Šmíd
So try to set your desired font - edit or create
(GTKDIR)\etc\gtk-2.0\gtkrc and add line like
gtk-font-name = Segoe UI

On Sun, Nov 7, 2010 at 2:19 PM, John Emmas john...@tiscali.co.uk wrote:

 On 7 Nov 2010, at 11:39, John Emmas wrote:


  My guess at the moment is that there's no font being loaded
  for the label widget.  Does that seem like a possible explanation?


 Oops, how silly of me!  Just noticed some text in the console window saying 
 Pango-WARNING **: failed to choose a font, expect ugly output. 
 engine-type='PangoRenderWin32', script='latin'

 I guess that narrows it down a bit..!
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Problem with 64 bit gtk binaries in Win 7 (32 bit works fine)

2010-11-02 Thread Jaroslav Šmíd
Mingw64 defaults to no leading underscores (this is quite new
feature), make sure GTK+ libraries are compiled by mingw64 version
built after this was done. If you use newer mingw64 and older GTK+ or
vice versa - trouble ahead :-)


On Tue, Nov 2, 2010 at 9:03 AM, Mario M maqueo.ma...@gmail.com wrote:
 Hello, I have Windows 7 64 bits and I am working on a GTK+ project that uses
 OpenGL in C++. I am using GLADE and the normal version of GTK+ (not gtkmm).

 I was working on a laptop with Windows 7 32 bits and the program worked
 fine, but the video card in that laptop was really bad (Intel, integrated)
 so I switched to a desktop with 64 bit windows and a better video card
 (Nvidia GT 240).

 The code compiles fine in both versions of windows, using the 32 bit version
 of gtk. However, some horrible things have been happening:

 - The OpenGL window would not update correctly, taking a long time to do so,
 seemingly at random times.  I was using gtkglext for the OpenGL binding but
 I found out this problem was caused by gtkglext not being updated (since
 2006) and the problem is with Aero in Windows, If desktop compositing was
 disabled, it would work fine. I decided to ditch gtkglext and use OpenGL
 directly, after a while I managed to and this problem was fixed.

 - Some colors were messed up with lighting enabled, at first I thought this
 and the previous problem had to do with the video card, but this was weird
 because the same program without gtk would work fine. However I managed to
 correct it adding a few simple OpenGL instructions. I'm not sure why it
 worked fine without GTK+, but it seems to work fine now with my fix.

 - I have a library for loading 3d models, in my laptop it worked fine, but
 on the new computer (and another one where i tested it), the 3d models
 render as a single horizontal :S, all of them. They are drawn using openGL
 functions and storing the vertex positions in lists. I discovered this: When
 I load an object in the main.cpp file, and draw it, it works fine, however,
 when I load it in an external file, and draw it, it doesn't work ( I get
 just a horizontal line, and again, without gtk+ it works fine). This has me
 really perplexed, I think it might have something to do with the linker but
 I have no idea how. I added some debugging and I think the problem is in the
 vertex positions, I printed their x,y,z values and they seemed to have x
 position in -1,0,1 and the y and z positions were values like 3.43e-039, I
 think the pointers might be messed up but I don't know how to fix them :S. I
 manually drew a triangle in the file that draws the 3d models, and the
 triangle rendered fine. I

 I thought this might somehow have something to do with using a 32 bit
 version of gtk+, do you think that is the case?
 I downloaded the 64 bit binaries, and tried to compile my code, but the
 linker didn't find any function! As soon as I changed the library location
 to point to the 64 bit version, I got a load of undefined references for
 everything concerning gtk+, even if I manually added the libraries in the
 project configuration of my IDE it would say the same.

 I am using Code::Blocks as an IDE and MingW as the compiler.

 Do I need to change additional configuration to use the 64 bit version of
 gtk+? Please help me, I haven't slept in two days trying to solve this and I
 am still confused. I downloaded the latest 64 bit version and then an older
 one to see if it was broken, but the results were the same.

 Or is the problem not related to the 64 bit thing? Any ideas/thoughts are
 welcome.

 Thanks in advance for your time.

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




-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Change view of GtkCheckMenuItem without trigger the action

2010-08-26 Thread Jaroslav Šmíd
g_signal_handlers_block_by_func() if you just want to block your signal 
handler. After toggling GtkCheckMenuItem use 
g_signal_handlers_unblock_by_func()


http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-block-by-func

On 10.8.2010 8:01, KC wrote:

Hi,

Is it possible to change view (check/uncheck) of GtkCheckMenuItem without
trigger the connected ('toggled') callback function ?

I have a GUI application which also allow control from client (from network).
When user click on GtkCheckMenuItem, the application will do:

  User click on GtkCheckMenuItem ---  callback, update internal data

When user issue command from client:

  update internal data ---  change view of GtkCheckMenuItem without 
callback.


Is this possible ?  Or any better approach ?

I believe this is related to MVC model for GtkWidget ...
TextView/TreeView offer MVC model, but how about other GtkWidget ?


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

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


Re: How to change color of GtkCellRendererProgress ?

2010-08-05 Thread Jaroslav Šmíd
I don't think the question was how to create custom cell renderer and
make it look totaly different. Question was how to change its color
(and thus preserving its lookfeel, only its color changed). This
simply can't be done especially with themes using pixmap engine.

2010/8/2 Shawn Bakhtiar shashan...@hotmail.com:


 Sorry this is a bad answer.

 Of course you can do this!! and that is no reason not to use GTK. You can use 
 the themes, or if you need individual progress bars to be different colors, 
 you can easily derive a GtkCellRenderProgressFooBar class from the 
 GtkCellRendererProgress, which does this, and if it is useful enough, maybe 
 the rest of us will use it in our app, and submit it for inclusion.

 I'm surprised it is not in the default functionality, but there are a lot of 
 ways you can do this.



 From: kcc1...@gmail.com
 Date: Mon, 2 Aug 2010 10:21:31 +0800
 Subject: Re: How to change color of GtkCellRendererProgress ?
 To: jardas...@gmail.com
 CC: gtk-app-devel-list@gnome.org

 On Mon, Aug 2, 2010 at 2:46 AM, Jaroslav Šmíd jardas...@gmail.com wrote:
  You can't. The only way to change this is to modify theme you use.

 That's bad news to me.
 I were planned to use it for a simple histogram application but color is
 required feature ...  Thanks anyway.

 Regards
 KC

  On Sat, Jul 31, 2010 at 6:33 AM, Kuang-Chun Cheng
  kcch...@linuxdaq-labs.com wrote:
  Hi,
 
  As subject said, how to change color of GtkCellRendererProgress ?
  Either color of text or bar is OK.   This looks like a simple question, 
  but
  I can't find anything from Google yet.
 
  Thanks a lot.
 
  Regards,
  KC
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 
 
 
  --
  Jaroslav Šmíd
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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




-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change color of GtkCellRendererProgress ?

2010-08-01 Thread Jaroslav Šmíd
You can't. The only way to change this is to modify theme you use.

On Sat, Jul 31, 2010 at 6:33 AM, Kuang-Chun Cheng
kcch...@linuxdaq-labs.com wrote:
 Hi,

 As subject said, how to change color of GtkCellRendererProgress ?
 Either color of text or bar is OK.   This looks like a simple question, but
 I can't find anything from Google yet.

 Thanks a lot.

 Regards,
 KC
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Making an element look like a resize grip

2010-07-11 Thread Jaroslav Šmíd
In expose event handler, use function gtk_paint_resize_grip(). Note that 
due to GTK's system of skinning/theming the resize grip might look 
different then the one on statusbar depending on the theme.


On 07/11/2010 09:33 AM, Noam Yorav-Raphael wrote:

Hello,

I have made a widget that acts as a resize grip (I had to write one by
myself because the resize grip of the statusbar doesn't work on popup
windows for some reason). I used an EventBox for that, and manually
handled button down, up, motion events.

My question is: can I make it look like a resize grip? Is there some
way to take the graphic of it (diagonal lines, or dots) and paint it
on my widget?

Thanks!
Noam
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


GObject and threads

2010-07-08 Thread Jaroslav Šmíd
I need to connect to multiple GObject's signals in my secondary
thread. Object is created in the primary (main) thread. Both threads
have glib loop running. Problem is that the signal connected in
secondary thread is actually executed from primary thread (that
created gobject). How can I achieve the signal being executed in the
secondary thread?
I know I might do something like creating gsource and add it to
secondary thread's context, but because each callback requires
different arguments, it would be pain in the a?s to do this for every
type of callback.

-- 
Jaroslav Šmíd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list