Re: glib gitlab tag

2018-09-04 Thread Patrick Welche
On Mon, Sep 03, 2018 at 12:15:20PM +0100, Philip Withnall wrote:
> On Mon, 2018-09-03 at 10:09 +0100, Patrick Welche wrote:
> > but I don't see the 2.58.0 tag!
> 
> I pushed the wrong tag, sorry. Trying to fix it now, but it will need
> sysadmin involvement because the git server (rightfully) doesn???t allow
> tags to be deleted or changed.
> 
> The release commit you should build is
> c138b98e363df8b95c2ee3eac214649b2908ad68; or just build from the glib-
> 2-58 branch.

I see it's all fixed now! Thanks,

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


glib gitlab tag

2018-09-03 Thread Patrick Welche
I just pointed my local glib repository from git.gnome.org to
gitlab.gnome.org.  I did the usual pull --rebase. I see

Author: Philip Withnall 
Date:   Thu Aug 30 14:40:04 2018 +0100

2.58.0

Signed-off-by: Philip Withnall 


but I don't see the 2.58.0 tag!

...
2.55.0
2.55.1
2.56.0
2.56.1
2.56.2
2.57.1
2.57.2
2.57.3
EAZEL-NAUTILUS-MS-AUG07
FOR_GNOME_0_99_1
GLIB_1_1_0
GLIB_1_1_1
GLIB_1_1_10
GLIB_1_1_11
...

It is listed at https://gitlab.gnome.org/GNOME/glib/tags

What am I missing?

Cheers,

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


Re: Linking to libstdc++ in HarfBuzz

2018-08-02 Thread Patrick Welche
On Thu, Aug 02, 2018 at 02:38:00AM -0700, Behdad Esfahbod wrote:
> Just asking, does anybody still object about using C++ standard library
> (ie. linking to it) in HarfBuzz?

If you mean add "-lstdc++", then yes...

> I know I've been one of the bigger opponents myself.  But I can change too.


Cheers,

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


Re: Typos in glib's code

2014-02-15 Thread Patrick Welche
On Sat, Feb 15, 2014 at 10:06:49PM +0100, Olivier Delhomme wrote:
 Hello everyone,
 
 I just saw that there is a typo in glib's code. That typo
 is fairly common as it appears in 132 files. The word
 licence (French) is used instead of the word license.

Peut-etre parce que ca s'ecrit licence en anglais aussi.
(Sorry couldn't resist - licence is also the British English spelling)

Cheers,

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


Re: symbolic icon fallback failure

2013-11-25 Thread Patrick Welche
On Sun, Nov 24, 2013 at 08:31:21PM -0500, Morten Welinder wrote:
  rsvg-base.c:2194:5: error: implicit declaration of function 
  'canonicalize_file_name'
 
 This patch (used for Win32, but there isn't anything win32 specific in there)
 with minimal editing should get you going.
 
 
 https://git.gnome.org/browse/gnumeric/tree/tools/win32/patches/librsvg-portability.patch

Actually - what's wrong with posix realpath() ?

Cheers,

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


Re: symbolic icon fallback failure

2013-11-25 Thread Patrick Welche
On Sat, Nov 23, 2013 at 03:14:47PM -0500, Matthias Clasen wrote:
 On Sat, Nov 23, 2013 at 12:12 PM, Patrick Welche pr...@cam.ac.uk wrote:
 
  On Sat, Nov 23, 2013 at 04:04:08PM +0100, Milan Bouchet-Valat wrote:
   Just a random guess, but are you sure Gdk was built with SVG support
   enabled? You need librsvg, and sometimes it happens to be missing (or
   not found)
 
  That was what I was worried about in:
 
  https://mail.gnome.org/archives/gtk-list/2013-November/msg00015.html
 
  I have libpixbufloader-svg.so and an svg entry in loaders.cache.
 
  Given that there were no replies, I assume that that is the complete
  checklist.
 
 
 Your librsvg may be too old to render symbolic icons. See

BTW - if my librsvg is too old, any thoughts on why the non-symbolic
png icon is not found?

Cheers,

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


Re: symbolic icon fallback failure

2013-11-25 Thread Patrick Welche
On Sat, Nov 23, 2013 at 03:14:47PM -0500, Matthias Clasen wrote:
 On Sat, Nov 23, 2013 at 12:12 PM, Patrick Welche pr...@cam.ac.uk wrote:
 
  On Sat, Nov 23, 2013 at 04:04:08PM +0100, Milan Bouchet-Valat wrote:
   Just a random guess, but are you sure Gdk was built with SVG support
   enabled? You need librsvg, and sometimes it happens to be missing (or
   not found)
 
  That was what I was worried about in:
 
  https://mail.gnome.org/archives/gtk-list/2013-November/msg00015.html
 
  I have libpixbufloader-svg.so and an svg entry in loaders.cache.
 
  Given that there were no replies, I assume that that is the complete
  checklist.
 
 
 Your librsvg may be too old to render symbolic icons. See
 
 
 https://git.gnome.org/browse/librsvg/commit/?id=b864307868d3977dfa5e127ff95d7efded854850
 
 and the bug referenced there.

I have now tried with librsvg 2.40.1, and evince still doesn't find its icons.
I managed to build librsvg with the attached patch.

Cheers,

Patrick
--- rsvg-base.c.orig2013-05-11 09:19:07.0 +
+++ rsvg-base.c
@@ -2190,8 +2190,7 @@ _rsvg_handle_allow_load (RsvgHandle *han
 dir = g_file_get_path (base);
 g_object_unref (base);
 
-/* FIXME portability */
-cdir = canonicalize_file_name (dir);
+cdir = realpath (dir, NULL);
 g_free (dir);
 if (cdir == NULL)
 goto deny;
@@ -2200,8 +2199,7 @@ _rsvg_handle_allow_load (RsvgHandle *han
 if (path == NULL)
 goto deny;
 
-/* FIXME portability */
-cpath = canonicalize_file_name (path);
+cpath = realpath (path, NULL);
 g_free (path);
 
 if (cpath == NULL)
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: symbolic icon fallback failure

2013-11-24 Thread Patrick Welche
On Sat, Nov 23, 2013 at 03:14:47PM -0500, Matthias Clasen wrote:
 On Sat, Nov 23, 2013 at 12:12 PM, Patrick Welche pr...@cam.ac.uk wrote:
 
  On Sat, Nov 23, 2013 at 04:04:08PM +0100, Milan Bouchet-Valat wrote:
   Just a random guess, but are you sure Gdk was built with SVG support
   enabled? You need librsvg, and sometimes it happens to be missing (or
   not found)
 
  That was what I was worried about in:
 
  https://mail.gnome.org/archives/gtk-list/2013-November/msg00015.html
 
  I have libpixbufloader-svg.so and an svg entry in loaders.cache.
 
  Given that there were no replies, I assume that that is the complete
  checklist.
 
 
 Your librsvg may be too old to render symbolic icons. See
 
 
 https://git.gnome.org/browse/librsvg/commit/?id=b864307868d3977dfa5e127ff95d7efded854850
 
 and the bug referenced there.

Indeed: I am using librsvg 2.36.4 as per the referenced email. I just had
a go at building 2.40.1, but:

rsvg-base.c:2194:5: error: implicit declaration of function 
'canonicalize_file_name'

?

Cheers,

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


Re: symbolic icon fallback failure

2013-11-23 Thread Patrick Welche
On Sat, Nov 23, 2013 at 04:04:08PM +0100, Milan Bouchet-Valat wrote:
 Just a random guess, but are you sure Gdk was built with SVG support
 enabled? You need librsvg, and sometimes it happens to be missing (or
 not found).

That was what I was worried about in:

https://mail.gnome.org/archives/gtk-list/2013-November/msg00015.html

I have libpixbufloader-svg.so and an svg entry in loaders.cache.

Given that there were no replies, I assume that that is the complete
checklist.

Cheers,

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


Re: symbolic icon fallback failure

2013-11-22 Thread Patrick Welche
On Thu, Nov 21, 2013 at 10:40:42AM -0500, Jasper St. Pierre wrote:
 On Thu, Nov 21, 2013 at 10:35 AM, Patrick Welche pr...@cam.ac.uk wrote:
 
  On Thu, Nov 21, 2013 at 10:07:55AM -0500, Jasper St. Pierre wrote:
   On Thu, Nov 21, 2013 at 9:38 AM, Patrick Welche pr...@cam.ac.uk wrote:

(gtk-update-icon-cache --validate returns 0 for those two directories
 so validates OK.
 Is there an easy way of dumping the contents of the cache?)

Is there a way of validating

   gnome/icon-theme.cachegnome/index.theme

further?

 I'd put a print statement inside the for loop near that if statement that
 prints the theme name, e.g.
 
 g_print (searching theme %s\n, theme-name);
 
 It sounds to me like the gnome icon theme isn't being properly added. Maybe
 also put lots of print statements in insert_theme. Is that being called
 with gnome as a theme name? Is it bailing out at some point before it's
 supposed to?

At least g_key_file_load_from_file() is not giving an error with
icons/gnome/index.theme

Probably why icons/gnome cache was found in earlier post? If there
were a problem, found cache for ...icons/gnome wouldn't have been
printed?

gtk_icon_theme_lookup_icon dialog-password
theme_lookup_icon: searching theme hicolor for dialog-password
...
theme_lookup_icon found dialog-password in dir (null)

I don't see searching theme gnome for dialog-password yet it is found.

gtk_icon_theme_lookup_icon go-up-symbolic
theme_lookup_icon: searching theme hicolor for go-up-symbolic
...
theme_lookup_icon: searching theme gnome for go-up-symbolic
...
theme_lookup_icon look for go-up-symbolic in dir .../hicolor/48x48/actions
theme_lookup_icon look for go-up-symbolic in dir .../gnome/48x48/actions
...

BUT not in icons/gnome/scalable/actions


Cheers,

Patrick
--- gtk/gtkicontheme.c.orig 2013-11-11 13:53:39.0 +
+++ gtk/gtkicontheme.c
@@ -1098,6 +1098,8 @@ insert_theme (GtkIconTheme *icon_theme, 
   
   priv = icon_theme-priv;
 
+  GTK_NOTE (ICONTHEME, g_print (insert_theme %s\n, theme_name));
+
   for (l = priv-themes; l != NULL; l = l-next)
 {
   theme = l-data;
@@ -1136,11 +1138,15 @@ insert_theme (GtkIconTheme *icon_theme, 
  g_key_file_load_from_file (theme_file, path, 0, error);
  if (error)
{
+  GTK_NOTE (ICONTHEME, 
+g_print (Error loading %s: %s\n, path, error-message));
  g_key_file_free (theme_file);
  theme_file = NULL;
  g_error_free (error);
  error = NULL;
}
+  else
+GTK_NOTE (ICONTHEME, g_print (Loaded %s successfully\n, path));
}
   g_free (path);
 }
@@ -1634,6 +1640,10 @@ choose_icon (GtkIconTheme   *icon_th
   icon_info = g_object_ref (icon_info);
   remove_from_lru_cache (icon_theme, icon_info);
 
+  GTK_NOTE (ICONTHEME, 
+   g_print (choose_icon: found %s in cache\n, 
+ g_strjoinv (,, icon_info-key.icon_names)));
+
   return icon_info;
 }
 
@@ -2813,6 +2823,10 @@ theme_lookup_icon (IconTheme  *t
   min_difference = G_MAXINT;
   min_dir = NULL;
 
+  GTK_NOTE (ICONTHEME, 
+g_print (theme_lookup_icon: searching theme %s for %s\n,
+ theme-name, icon_name));
+
   /* Builtin icons are logically part of the default theme and
* are searched before other subdirectories of the default theme.
*/
@@ -2822,8 +2836,13 @@ theme_lookup_icon (IconTheme  *t
   size, scale,
   min_difference);
 
+
   if (min_difference == 0)
-   return icon_info_new_builtin (closest_builtin);
+{
+  GTK_NOTE (ICONTHEME,
+g_print (theme_lookup_icon found %s in builtins\n, 
icon_name));
+  return icon_info_new_builtin (closest_builtin);
+}
 
   dirs = builtin_dirs;
 }
@@ -2836,7 +2855,7 @@ theme_lookup_icon (IconTheme  *t
   dir = l-data;
 
   GTK_NOTE (ICONTHEME,
-   g_print (theme_lookup_icon dir %s\n, dir-dir));
+   g_print (theme_lookup_icon look for %s in dir %s\n, 
icon_name, dir-dir));
   suffix = theme_dir_get_icon_suffix (dir, icon_name, NULL);
   if (best_suffix (suffix, allow_svg) != ICON_SUFFIX_NONE)
{
@@ -2926,11 +2945,18 @@ theme_lookup_icon (IconTheme  *t
  
min_dir-subdir_index);
}
 
+  GTK_NOTE (ICONTHEME,
+   g_print (theme_lookup_icon found %s in dir %s\n, icon_name, 
min_dir-dir));
+
   return icon_info;
 }
 
   if (closest_builtin)
-return icon_info_new_builtin (closest_builtin);
+{
+  GTK_NOTE (ICONTHEME,
+g_print (theme_lookup_icon found (close to) %s in 
builtins\n, icon_name));
+  return icon_info_new_builtin (closest_builtin);
+}
   
   return NULL

Re: symbolic icon fallback failure

2013-11-21 Thread Patrick Welche
On Thu, Nov 21, 2013 at 10:07:55AM -0500, Jasper St. Pierre wrote:
 On Thu, Nov 21, 2013 at 9:38 AM, Patrick Welche pr...@cam.ac.uk wrote:
 
  Originally I thought that the lack of icons on my system in the post
  stock-icons age was because symbolic icons are SVGs:
 
https://mail.gnome.org/archives/gtk-list/2013-November/msg00015.html
 
  (The request for documentation still stands.)
 
  It seems that the problem is somewhat different:
 
  1) scalable gnome icons (e.g. symbolic svg icons) are not searched for.
  2) the claim If a -symbolic icon is missing, the app will fall back to the
 regular name. seems to be false.
 
  In reverse order, 2) looked as though it should be fixed by commit d25ee710
https://bugzilla.gnome.org/show_bug.cgi?id=708163
  which was did appear in 3.10.2 despite the last comment in that bug.
  It seems that fallback is still broken.
 
  1) seems odd: when running e.g. evince --gtk-debug=icontheme (3.10.3), a
  gtk 3.10.3 system with gnome-icon-theme-symbolic 3.8.3, and gsetting:
 org.gnome.desktop.interface icon-theme 'gnome'
  shows caches found in icons/hicolor and icons/gnome
 
  (gtk-update-icon-cache --validate returns 0 for those two directories
   so validates OK.
   Is there an easy way of dumping the contents of the cache?)
 
  Evince then looks for dialog-password in
 
   -? builtins?
  icons/hicolor/..x..  (why hicolor when gsettings says
  icon-theme=gnome?)
  evince/icons/..x..
  icons/hicolor/scalable
  evince/icon/scalable
  theme_lookup_icon found dialog-password in dir (null)
  ? builtin - it apparently didn't look in icons/gnome/..x.. which is where
  the
  PNGs live.
 
  Next is go-up-symbolic, which won't be found, and which lives in
  icons/gnome/scalable/actions
 
  It is looked for in
  
  icons/hicolor/..x..
  evince/icons/..x..
  icons/hicolor/scalable
  evince/icon/scalable
  (as before, and in addition)
  icons/hicolor/..x..  (again, interleaved with icons/gnome)
  icons/gnome/..x..(because of commit 90dee25e in 3.10.3?)
  
  icons/hicolor/..x..  (again, with evince/icons/hicolor)
  gtk_icon_theme_lookup_icon image-missing
 
  so icons/gnome/scalable is not searched, and fallback non-symbolic
  go-up is also not searched for.
 
 
 hicolor is specified as a fallback icon theme in the icon theme
 specification, so that apps can place their app icons there.


I don't understand your comment. evince isn't providing go-up-symbolic.
It is trying to use it.

icons/gnome/16x16/actions/go-up.png
icons/gnome/22x22/actions/go-up.png
icons/gnome/24x24/actions/go-up.png
icons/gnome/32x32/actions/go-up.png
icons/gnome/48x48/actions/go-up.png
icons/gnome/scalable/actions/go-up-symbolic.svg

live on the system. go-up-symbolic.svg isn't found as for some reason
icons/gnome/scalable isn't searched. non-symbolic fallback go-up.png
isn't searched for. Is that clearer?

  BTW gtkicontheme.c:1658 choose_icon() seems odd: the first block
  checks for a -symbolic suffix, but appears to do the same as the
  second block. Was that intentional?
 
 
 Look closer. In the case of symbolic, it searches all themes for
 icon_names[0] (which is foo-bar-baz-symbolic). In the latter, it tries all
 the icon names (foo-bar-baz-symbolic, foo-bar-baz, foo-bar, foo) for every
 theme in order.

Hmmm - so why isn't at least go-up found?

Cheers,

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


Re: symbolic icon fallback failure

2013-11-21 Thread Patrick Welche
On Thu, Nov 21, 2013 at 10:40:42AM -0500, Jasper St. Pierre wrote:
 On Thu, Nov 21, 2013 at 10:35 AM, Patrick Welche pr...@cam.ac.uk wrote:
 
  On Thu, Nov 21, 2013 at 10:07:55AM -0500, Jasper St. Pierre wrote:
   On Thu, Nov 21, 2013 at 9:38 AM, Patrick Welche pr...@cam.ac.uk wrote:


(gtk-update-icon-cache --validate returns 0 for those two directories
 so validates OK.
 Is there an easy way of dumping the contents of the cache?)

Is there any more I can do to check that

icons/gnome/index.theme
icons/gnome/icon-theme.cache

are OK? (Given Gtk 3's --enable-gtk2-dependency, it shouldn't matter if
gtk 2.24.20 created the cache?)

 I'd put a print statement inside the for loop near that if statement that
 prints the theme name, e.g.
 
 g_print (searching theme %s\n, theme-name);
 
 It sounds to me like the gnome icon theme isn't being properly added. Maybe
 also put lots of print statements in insert_theme. Is that being called
 with gnome as a theme name? Is it bailing out at some point before it's
 supposed to?

Thanks for the pointer - more soon...

Cheers,

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


Re: symbolic icon fallback failure

2013-11-21 Thread Patrick Welche
On Thu, Nov 21, 2013 at 04:14:13PM +0100, Olivier Brunel wrote:
 On 11/21/13 15:38, Patrick Welche wrote:
  Originally I thought that the lack of icons on my system in the post
  stock-icons age was because symbolic icons are SVGs:
  
https://mail.gnome.org/archives/gtk-list/2013-November/msg00015.html
  
  (The request for documentation still stands.)
  
  It seems that the problem is somewhat different:
  
  1) scalable gnome icons (e.g. symbolic svg icons) are not searched for.
  2) the claim If a -symbolic icon is missing, the app will fall back to the
 regular name. seems to be false.
  
  In reverse order, 2) looked as though it should be fixed by commit d25ee710
https://bugzilla.gnome.org/show_bug.cgi?id=708163
  which was did appear in 3.10.2 despite the last comment in that bug.
  It seems that fallback is still broken.
 
 Just in case: are you running the latest GLib (2.38.2) as well? I don't
 know how icons are loaded in your case, but they could come from glib
 and the fallback to non-symbolic icons was only added there in 2.38.2

Thanks for the note - I was running 2.38.1, but just tried 2.38.2 and there
is no change: evince is asking gtk to look for the icons...

Cheers,

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


Re: Test - can be deleted

2013-10-12 Thread Patrick

On 10/12/2013 02:45 AM, John Emmas wrote:
TEST: a couple of my posts to this list have failed to turn up (after 
48 hours!!) so I'm just trying from a different email client.  Sorry 
for the noise.


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


Hi John

I also had trouble. I unsubscribed and resubscibed and everything seems 
fine now.

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


Re: Is this a cast?

2013-10-12 Thread Patrick

Thanks again Allin

Sorry everyone about the garbage post. Just in case someone finds this 
later I want to mention a better way to self study along with Krause's 
book, I just got this set up last night.


You can download the examples to the book here:
http://gtkbook.sourceforge.net/download.html

Download the source code for glib and gtk and put them in the same 
extracted folder.


Install ctags

Run:
ctags `find -name *.[ch] `
 to create a tag file

then load all the c files into vim with:
gvim  `find -name *.[ch] `

From within vim run:
set tags=/path/to/your/tag/file/tags

Go to an example file.

Hover over an unknown identifier and with left mouse + CTLR you will go 
to the  to site of declaration


right mouse click + CNTRL will take you back to where you were.

-Patrick



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


Re: Is this a cast?

2013-10-12 Thread Patrick

On 10/12/2013 09:24 AM, Patrick wrote:

Thanks again Allin

Sorry everyone about the garbage post. Just in case someone finds this 
later I want to mention a better way to self study along with Krause's 
book, I just got this set up last night.


You can download the examples to the book here:
http://gtkbook.sourceforge.net/download.html

Download the source code for glib and gtk and put them in the same 
extracted folder.


Install ctags

Run:
ctags `find -name *.[ch] `
 to create a tag file

then load all the c files into vim with:
gvim  `find -name *.[ch] `

From within vim run:
set tags=/path/to/your/tag/file/tags

Go to an example file.

Hover over an unknown identifier and with left mouse + CTLR you will 
go to the  to site of declaration


right mouse click + CNTRL will take you back to where you were.

-Patrick



Sorry once again, I am spamming now.

The link I posted for Krause's book is incorrect. It is still useful 
though, it just does not match the book.



I don't know where his book examples have gone, the gtkbook.com site has 
a dead link.



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


Is this a cast?

2013-10-11 Thread Patrick

Apologies if this is a duplicate post. I am having some email trouble.



Hi Everyone

I have been reading GTK+ Development by Krause for some time.

Almost everything makes sense but I don't really understand this:

g_signal_connect_swapped( G_OBJECT ( button1 ) ... continues.. on..

button1 is type GtkWidget, is it being cast to type G_OBJECT ?

I am used to seeing casts like:

number1 = (int) another_num but  I suppose the parenthesis can actually 
go around the type or the variable, correct?


If I am indeed reading this write, it seems like most widgets start off 
as GtkWidget types but then are recast to more specific objects during 
function calls, does this sound right?


-Patrick

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


Re: Tutorials on writing bindings?

2013-10-10 Thread Patrick

Hi Everyone

Sorry to answer my own post. I didn't get a response so I am guessing 
either there isn't a comprehensive tutorial on writing bindings or my 
post was poorly worded.


If I could just get some guidance on where to focus my studying that 
would be so great.


I didn't want to mention this because it could lead to a severe 
beating(or email version of it) but I really love Cobol.


There have been some attempts to create bindings but they are not very 
far along.


Open Cobol compiles to intermediate C and there are many data types that 
correspond to C. However we cannot define new data types so it is not 
easy to specify that a value is type gboolean, GtkWindowPosition etc.


Should I try to learn about how GObject Introspection works? It sounds 
like this is for dynamically typed languages?


Should I try to learn how other statically typed bindings work instead? 
Do they still use introspection or do they just try to recreate the data 
types within their own type systems?


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


Tutorials on writing bindings?

2013-10-09 Thread Patrick

Hi Everyone

I am trying to write a GTK binding.

There are lots of resources on the web but I am finding that they cover 
some parts but leave other parts out.


I am a bit of a jack of all trades with languages and unfortunately 
master of none. Any start-to-finish, sort of tutorial would really help 
in just about any language.


I have made some progress, the only part I am having trouble with is the 
type system. I know that gobject is supposed to help in binding to other 
languages and I understand  that  gobject introspection is being used to 
generate the glue code between languages now but I would like to learn 
more about how that happens exactly and I would still like to write 
bindings to the 2.0 series as well, possibly using the older methods as 
well.


Any links would be appreciated.

Thanks for reading-Patrick


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


Re: Stock Items Deprecation

2013-08-22 Thread Patrick Welche
On Tue, Aug 20, 2013 at 03:01:25PM +0100, Patrick Welche wrote:
 On Tue, Jul 02, 2013 at 10:44:13AM -0400, Matthias Clasen wrote:
  On Tue, Jul 2, 2013 at 10:29 AM, Tristan Van Berkom t...@gnome.org wrote:
  
  
   Besides what Bastian already points out, I have another concern if we
   are to consider moving
   away from stock items completely.
  
   The document above points to this list of icon names:
  
   http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html#names
  
   What guarantees do we have that referring to an icon name in the icon
   naming spec will
   actually produce an icon ?
  
  GTK+ ships with a built-in icon theme that covers the named icons used
  by the stock system (not all listed in the naming spec).
 
 Since gcalctool moved away from stock icons (f962134f66), I can't
 tell the difference between undo and clear - both appear as
 the icon not found icon, which causes a problem with usability.
 If there is an automatic fallback mechanism, I don't see how it is
 working, and 1. Provided a guaranteed, consistent, and high quality
 set of icons for use in applications. seems to have evaporated.


From

http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

  Implementations are required to look in the hicolor theme if
   an icon was not found in the current theme.

Which suggests that there should be a fallback mechanism, but given the
gcalctool example, it doesn't seem to be implemented?

Cheers,

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


Re: Stock Items Deprecation

2013-08-20 Thread Patrick Welche
On Tue, Jul 02, 2013 at 10:44:13AM -0400, Matthias Clasen wrote:
 On Tue, Jul 2, 2013 at 10:29 AM, Tristan Van Berkom t...@gnome.org wrote:
 
 
  Besides what Bastian already points out, I have another concern if we
  are to consider moving
  away from stock items completely.
 
  The document above points to this list of icon names:
 
  http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html#names
 
  What guarantees do we have that referring to an icon name in the icon
  naming spec will
  actually produce an icon ?
 
 GTK+ ships with a built-in icon theme that covers the named icons used
 by the stock system (not all listed in the naming spec).

Since gcalctool moved away from stock icons (f962134f66), I can't
tell the difference between undo and clear - both appear as
the icon not found icon, which causes a problem with usability.
If there is an automatic fallback mechanism, I don't see how it is
working, and 1. Provided a guaranteed, consistent, and high quality
set of icons for use in applications. seems to have evaporated.

Cheers,

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


Re: Something I don't understand

2013-05-31 Thread Patrick Welche
On Fri, May 31, 2013 at 09:15:39AM +0100, John Emmas wrote:
 I just wondered if someone could help me with something that's puzzling me 
 about a recent Glib commit...
 
 On 27th May, Dan Winship made a commit whose description is Add 
 Makefile.glib and GLIB_CONFIG configure macro.  According to my Git package 
 (TortoiseGit) it looks as if the following two files got deleted as part of 
 that commit:-

FWIW I don't see it - do you have the commit ID?

Cheers,

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


Gtk.DrawingArea: Port to python3/gtk3

2012-09-12 Thread Patrick Shirkey
Hi,

How should I convert this gtk3?

self.area = Gtk.DrawingArea()

#Paints the piano roll (Where the notes are)
def paint_widget(self):
if self.area.window == None:
return

colormap = self.area.get_colormap()

if self.gc_background == None:
color_background = colormap.alloc_color('#FF', 
True, True)
self.gc_background = self.area.window.new_gc()
self.gc_background.set_foreground(color_background)



--
Patrick Shirkey
Boost Hardware Ltd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk apps on iOS/Android?

2012-09-10 Thread Patrick Shirkey

On Mon, September 10, 2012 3:40 pm, Tristan Van Berkom wrote:
 On Mon, Sep 10, 2012 at 3:15 AM, Michael Torrie torr...@gmail.com wrote:
 On 09/07/2012 07:40 AM, Allin Cottrell wrote:
 I'm contemplating trying to produce a version of my gtk app
 for tablet use. Can anyone point me to relevant resources or
 examples? At this point I'm totally clueless about porting to
 tablets (though I'm able to build my app for OS X OK), and I
 haven't found googling to be very useful.

 Basically you'll want to get a book on developing android apps, download
 the sdk, and go to town.  All in Java of course.  And using the Android
 UI toolkit.  GTK+ is not available on Android or iOS, nor will it likely
 ever be.  Use the native toolkits.

 interesting, wouldnt the quartz backend for osx build for iOS ?

 not exactly sure but I think the NSView and highlevel cocoa stuff
 is built upon the same low level windowing apis that are available
 on osx...



You can compile other languages on android and ios. I'm not sure that
anyone has tried to port gtk to android or ios yet.

probably inevitable though so if it's your thing than I'm sure you will be
able to make something happen.



--
Patrick Shirkey
Boost Hardware Ltd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk3 + python : lookup_widget

2012-08-20 Thread Patrick Shirkey

On Mon, August 20, 2012 9:16 am, Tristan Van Berkom wrote:
 On Mon, Aug 20, 2012 at 2:32 PM, Patrick Shirkey
 pshir...@boosthardware.com wrote:

 On Mon, August 20, 2012 6:59 am, Tristan Van Berkom wrote:
The lookup_widget() paradigm comes from a very old time when we
 had very poor
 tools and actually it originates from people using generated code from
 the original Glade
 tool (Glade versions 1 and 2).

 Ideally, as specially as you are using python, your application should
 be modular.

 Perhaps you have an Application object which owns the main widgetry
 created
 by GtkBuilder after having parsed a Glade file initially, this is
 different from a global
 variable.

 Ideally you can use you object constructor as an entry point to load
 your GtkBuilder
 and assign the pointers you need later on to the members you define on
 your
 Application object.


 In this case I am programatically creating the widget.

 After that you simply have to pass your Application object to all the
 callbacks
 which originate from the user interface, giving you access to
 everything
 you
 need when you need it.


 This is the part I am having trouble with.

 This concept can be further extended to be more modular, for instance
 if
 you have a preferences dialog/window... it can be defined by a separate
 python class/GtkBuilder file and reused at will throughout your
 program.


 Thanks for your advice. I am planning to make this app as modular as
 possible but I am finding it hard to find a simple example that deals
 with
 my use case.

 Look at GTK+ sources: gtkdialog.c for example, or gtkmessagedialog.c even.

 Many composite widgets exist in GTK+, all of them follow the same
 construct:

o Create child widgets at initialization time and assign them to your
   private data structure members which you have declared for them
   (in other words, of course you hold a private instance member for
   any composite children you need, like dialog-entry or dialog-label
   or dialog-button etc).

   o Connect signals to, for example the button, when doing so..
  supply the dialog (self) instance as user data for the callback

 When the callback runs, it receives the dialog as user data, so
 all of the internal composite children are always available in
 those callbacks.

 In theory, in this 'dialog' example, normally all composite children
 are private to the dialog and the dialog has some kind of output
 or modifies your program state in some way, so no user of the
 dialog should ever have to access those internal widget members
 and the dialog can change internally without breaking any API.

 So in the context where the dialog handles a callback for any
 signal originating from one of it's instance members, it always
 has the dialog in context so it can always access any member
 of the dialog.


Do you know of a python example of this concept? I have the signals part
under control and I am ok with python classes but I'm a bit murky on how
to pass the commands back to the object.

I have seen an examples where the class exposed a function that pulled in
the dynamic variable which is updated when the signal is sent/received.

i.e

from gi.repository import Gtk, Gdk
import cairo

class MyWidget(Gtk.DrawingArea):

def __init__(self, parent):

self.par = parent
super(MyWidget, self).__init__()

self.connect(draw, self.expose)

def expose(self, widget, event):
self.variable = self.par.get_cur_value()

label.text = variable



class PyApp(Gtk.Window):

def __init__(self):
super(PyApp, self).__init__()

mywidget = MyWidget
self.cur_value = 0




def on_changed(self, widget):
self.cur_value = widget.get_value()
self.mywidget.queue_draw()

def get_cur_value(self):
return self.cur_value


PyApp()
Gtk.main()



 How that translates to python script, I'm not exactly sure, but
 I'm sure that it does indeed translate to python script ;-)

 In any case it's the coding practice which is relevant, not
 the language binding which you use to achieve it


Thanks Tristan,  I appreciate your detailed explanation.

It seems to me that gtk3 and python3.2 hasn't yet received much love in
terms of documentation efforts.

I am happy to release the stripped down version of this code as an example
project if anyone feels like helping me with the thinking part.

FYI, I am currently building an almost complete rewrite of an application
which is being migrated away from another platform so I have quite a lot
to get through and getting my head around this part will be a major
milestone :-)






 Cheers,
-Tristan


 Basically I want to be able to modify the text in a label widget from a
 Entry or EventBox signal.

 I haven't found an example of that but if anyone knows of one that would
 be very helpful.


 --
 Patrick Shirkey
 Boost Hardware Ltd



 Cheers,
  -Tristan

 On Mon, Aug 20, 2012 at 1:10 PM, Patrick

Re: gtk3 + python : lookup_widget

2012-08-20 Thread Patrick Shirkey

On Mon, August 20, 2012 9:16 am, Tristan Van Berkom wrote:
 On Mon, Aug 20, 2012 at 2:32 PM, Patrick Shirkey
 pshir...@boosthardware.com wrote:

 On Mon, August 20, 2012 6:59 am, Tristan Van Berkom wrote:
The lookup_widget() paradigm comes from a very old time when we
 had very poor
 tools and actually it originates from people using generated code from
 the original Glade
 tool (Glade versions 1 and 2).

 Ideally, as specially as you are using python, your application should
 be modular.

 Perhaps you have an Application object which owns the main widgetry
 created
 by GtkBuilder after having parsed a Glade file initially, this is
 different from a global
 variable.

 Ideally you can use you object constructor as an entry point to load
 your GtkBuilder
 and assign the pointers you need later on to the members you define on
 your
 Application object.


 In this case I am programatically creating the widget.

 After that you simply have to pass your Application object to all the
 callbacks
 which originate from the user interface, giving you access to
 everything
 you
 need when you need it.


 This is the part I am having trouble with.

 This concept can be further extended to be more modular, for instance
 if
 you have a preferences dialog/window... it can be defined by a separate
 python class/GtkBuilder file and reused at will throughout your
 program.


 Thanks for your advice. I am planning to make this app as modular as
 possible but I am finding it hard to find a simple example that deals
 with
 my use case.

 Look at GTK+ sources: gtkdialog.c for example, or gtkmessagedialog.c even.

 Many composite widgets exist in GTK+, all of them follow the same
 construct:

o Create child widgets at initialization time and assign them to your
   private data structure members which you have declared for them
   (in other words, of course you hold a private instance member for
   any composite children you need, like dialog-entry or dialog-label
   or dialog-button etc).

   o Connect signals to, for example the button, when doing so..
  supply the dialog (self) instance as user data for the callback

 When the callback runs, it receives the dialog as user data, so
 all of the internal composite children are always available in
 those callbacks.

 In theory, in this 'dialog' example, normally all composite children
 are private to the dialog and the dialog has some kind of output
 or modifies your program state in some way, so no user of the
 dialog should ever have to access those internal widget members
 and the dialog can change internally without breaking any API.

 So in the context where the dialog handles a callback for any
 signal originating from one of it's instance members, it always
 has the dialog in context so it can always access any member
 of the dialog.


Do you know of a python example of this concept? I have the signals part
under control and I am ok with python classes but I'm a bit murky on how
to pass the commands back to the object.

I have seen an examples where a class exposed a function that pulled in
the dynamic variable which is updated when the signal is sent/received.
But I can't figure out how to adjust widgets that are defined outside of
the class. For example in the code below how would the label be accessed
by the MyWidget class if it is defined in the PyApp class?


i.e

from gi.repository import Gtk, Gdk
import cairo

class MyWidget(Gtk.DrawingArea):

def __init__(self, parent):

self.par = parent
super(MyWidget, self).__init__()

self.connect(draw, self.expose)

def expose(self, widget, event):
self.variable = self.par.get_cur_value()

label.text = variable


class PyApp(Gtk.Window):

def __init__(self):
super(PyApp, self).__init__()

self.cur_value = 0
mywidget = MyWidget
label = Gtk.Label()


def on_changed(self, widget):
self.cur_value = widget.get_value()
self.mywidget.queue_draw()

def get_cur_value(self):
return self.cur_value


PyApp()
Gtk.main()



 How that translates to python script, I'm not exactly sure, but
 I'm sure that it does indeed translate to python script ;-)

 In any case it's the coding practice which is relevant, not
 the language binding which you use to achieve it


Thanks Tristan,  I appreciate your detailed explanation.

It seems to me that gtk3 and python3.2 hasn't received much love in terms
of documentation efforts. Google is suprisingly sparse and I am running up
against quite a lot of gaps in terms of general tips and knowledge
compared to what I am used to.

Is it safe to say that there are not many people/projects who have adopted
gtk3 and python3.2 at the moment?


Patrick



 Cheers,
-Tristan


 Basically I want to be able to modify the text in a label widget from a
 Entry or EventBox signal.

 I haven't found an example of that but if anyone knows of one that would
 be very helpful

gtk3 + python : lookup_widget

2012-08-19 Thread Patrick Shirkey
Hi,

I'm having a little trouble finding examples online of using the
equivalent of lookup_widget() with gtk3 + python.

For example in the following code what is the best way to modify the
message label after the commandline callback is sent?

Should I be using globals or a glade file or is there a way to dynamically
lookup the message widget ?



def create_gtkEntry():

commandline = Gtk.Entry()
commandline.connect(activate, command_entered, 1)

messages = Gtk.Label('TEST')



def command_entered(self, *args):

cmi_command = self.get_text()
messages.set_text(cmi_command)
print command entered: , args[0]



--
Patrick Shirkey
Boost Hardware Ltd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk3 + python : lookup_widget

2012-08-19 Thread Patrick Shirkey

On Mon, August 20, 2012 6:59 am, Tristan Van Berkom wrote:
The lookup_widget() paradigm comes from a very old time when we
 had very poor
 tools and actually it originates from people using generated code from
 the original Glade
 tool (Glade versions 1 and 2).

 Ideally, as specially as you are using python, your application should
 be modular.

 Perhaps you have an Application object which owns the main widgetry
 created
 by GtkBuilder after having parsed a Glade file initially, this is
 different from a global
 variable.

 Ideally you can use you object constructor as an entry point to load
 your GtkBuilder
 and assign the pointers you need later on to the members you define on
 your
 Application object.


In this case I am programatically creating the widget.

 After that you simply have to pass your Application object to all the
 callbacks
 which originate from the user interface, giving you access to everything
 you
 need when you need it.


This is the part I am having trouble with.

 This concept can be further extended to be more modular, for instance if
 you have a preferences dialog/window... it can be defined by a separate
 python class/GtkBuilder file and reused at will throughout your program.


Thanks for your advice. I am planning to make this app as modular as
possible but I am finding it hard to find a simple example that deals with
my use case.

Basically I want to be able to modify the text in a label widget from a
Entry or EventBox signal.

I haven't found an example of that but if anyone knows of one that would
be very helpful.


--
Patrick Shirkey
Boost Hardware Ltd



 Cheers,
  -Tristan

 On Mon, Aug 20, 2012 at 1:10 PM, Patrick Shirkey
 pshir...@boosthardware.com wrote:
 Hi,

 I'm having a little trouble finding examples online of using the
 equivalent of lookup_widget() with gtk3 + python.

 For example in the following code what is the best way to modify the
 message label after the commandline callback is sent?

 Should I be using globals or a glade file or is there a way to
 dynamically
 lookup the message widget ?



 def create_gtkEntry():

 commandline = Gtk.Entry()
 commandline.connect(activate, command_entered, 1)

 messages = Gtk.Label('TEST')



 def command_entered(self, *args):

 cmi_command = self.get_text()
 messages.set_text(cmi_command)
 print command entered: , args[0]



 --
 Patrick Shirkey
 Boost Hardware Ltd
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



--
Patrick Shirkey
Boost Hardware Ltd
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Bug 660761

2011-11-25 Thread Patrick Welche
On Fri, Nov 25, 2011 at 09:32:41AM +0100, Olav Vitters wrote:
 On Fri, Nov 25, 2011 at 10:28:55AM +0200, Kean Johnston wrote:
  Please can glib devs give https://bugzilla.gnome.org/show_bug.cgi?id=660761
  a little love? Its been a month and a half since I posted the last
  patch and there has been no traction on it.
 
 Suggestion: Best to always copy/paste the summary. No clue what it is
 about, too lazy to click as likely not for me (not a dev) :P

glib/gmodule: Give builder opportunity to change DLL extension

There are a few places where the extension of .dll is hard-coded. While it is
true that this is most often the right name, there are circumstances where it
is useful for the person compiling GLib to be able to use something else. For
example, when compiling both 32-bit and 64-bit versions to sit side by side it
is useful to have 32-bit extensions have one suffix (say, .x32) and 64-bit
versions to have another (say, .x64). The attached patch provides the person
compiling GLib with just that flexibility, and doesn't change any defaults.


Just providing the lookup service ;-)

Cheers,

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


Semi-Transparent Window-Background with Gtk(mm) and Cairo

2011-10-16 Thread Patrick Bichler
Hi!
I am trying to get a semi-transparent (not fully transparent and not fully
white/grey/etc) window background using this as a structure:

# Gtk::Window
  - Gtk::Fixed
- several buttons

what i am doing atm is setting the app_paintable (
window-set_app_paintable(true); ) flag and drawing to the
window/fixed-layout background before calling present() on it


   1. cairo_t *cr = gdk_cairo_create(fix-get_window()-gobj());
   2.
   3. cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.4); /* transparent */
   4. cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
   5. cairo_paint (cr);
   6. cairo_destroy(cr);


this code doesnt give me any visual change (also tried with changed the
layout variable (fix) to the window variable = also doesnt work)

any idea how i can fix that?

gtk version is gtkmm-3.0


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


interested in gtk+ project development

2011-02-15 Thread Patrick Noble
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


Application development books (OT?)

2009-09-11 Thread Patrick
Hi Everyone

I have received great advice from this list in the past.

My Son was diagnosed with Autism(he is getting much better now) and I
shelved a project I was working on for almost 2 years. I am still stuck
in the planning stage but I am ready to go forward again.

I want to avoid re-inventing the wheel and I would like to learn more
about the standard ways in which desktop Apps are put together. There
are many books on programming that give code oriented examples about
simple problems, for instance, how to connect to a DB or create a dialog
with a widget toolkit and there are design pattern books that discuss
paradigms in an abstract way but I am looking for something in the middle.

To be a little more specific, I assume that most applications would
follow the MVC pattern but surely for one application, a flat file would
be fine for the DB, while another App would require a proper relational
database such as sqlite or postgresql? Surely there are different
controller patterns within the MVC paradigm? Are there general folder
structures people use? How do people go about adding hooks to their
applications to allow for other languages to utilize them? etc. A book
that cited examples and strategies would really help.

Could anyone suggest something that would help me to plan an
application? I can manage with the specific pieces of code, It's the
general layout that I will probably fail with.

Thanks in advance-Patrick


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


Re: widget_class-event not working

2009-08-21 Thread Patrick M. Rutkowski
Actually, I just figured it out a few moments ago. Adding the
following to realize() beings to fix things:

GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);

I start to get keyboard events and such.

However, there's another problem now! Even with GTK_CAN_FOCUS, I still
don't get GDK_MOTION_NOTIFY events, or even mouse button press events.

Here's another test case to instated illustrate that problem. This
time, IT WORKS! only prints if the event is somehow mouse related:

http://www.rutski89.com/static/mouse_test.c

See if you can get that one to print, I can't
-Patrick


On Fri, Aug 21, 2009 at 3:34 AM, Brian J. Tarriconebj...@cornell.edu wrote:
 On 08/20/2009 10:27 PM, Patrick M. Rutkowski wrote:
 I've written a test case that anybody can compile and run:
 http://www.rutski89.com/static/event_test.c

 It contains the following line of code in the any_event() function:
 printf(IT WORKS!\n);

 That currently does not get printed.

 If you can get the test case to print that line of text, you will have
 solved my problem.

 I can, but probably not in the way you want.  I think one of two things
 is going on:

 1.  GtkWidget just doesn't handle events and subclassing it will take
 more work than just subclassing realize() to get it to receive events.

 2.  You're missing something in your realize() method, though I'm not
 sure what.

 If I make your Foo class into a subclass of GtkEventBox instead of
 GtkWidget, and then remove your realize() implementation (so it uses
 GtkEventBox's impl), then it prints IT WORKS! as you'd expect.
 Perhaps perusing gtkeventbox.c might help you figure out what else is
 needed if you really want to just subclass GtkWidget.

        -brian
 ___
 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: widget_class-event not working

2009-08-21 Thread Patrick M. Rutkowski
I figured it all out, and wrote it up in an article here:
http://www.rutski89.com/dynamic/journal.html?name=gtkwidget

Sleepiness was already hitting hard while banging away at the
keyboard, so please do let me know if you see any mistakes.

-Patrick


On Fri, Aug 21, 2009 at 3:58 AM, Patrick M. Rutkowskirutsk...@gmail.com wrote:
 Actually, I just figured it out a few moments ago. Adding the
 following to realize() beings to fix things:

 GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);

 I start to get keyboard events and such.

 However, there's another problem now! Even with GTK_CAN_FOCUS, I still
 don't get GDK_MOTION_NOTIFY events, or even mouse button press events.

 Here's another test case to instated illustrate that problem. This
 time, IT WORKS! only prints if the event is somehow mouse related:

 http://www.rutski89.com/static/mouse_test.c

 See if you can get that one to print, I can't
 -Patrick


 On Fri, Aug 21, 2009 at 3:34 AM, Brian J. Tarriconebj...@cornell.edu wrote:
 On 08/20/2009 10:27 PM, Patrick M. Rutkowski wrote:
 I've written a test case that anybody can compile and run:
 http://www.rutski89.com/static/event_test.c

 It contains the following line of code in the any_event() function:
 printf(IT WORKS!\n);

 That currently does not get printed.

 If you can get the test case to print that line of text, you will have
 solved my problem.

 I can, but probably not in the way you want.  I think one of two things
 is going on:

 1.  GtkWidget just doesn't handle events and subclassing it will take
 more work than just subclassing realize() to get it to receive events.

 2.  You're missing something in your realize() method, though I'm not
 sure what.

 If I make your Foo class into a subclass of GtkEventBox instead of
 GtkWidget, and then remove your realize() implementation (so it uses
 GtkEventBox's impl), then it prints IT WORKS! as you'd expect.
 Perhaps perusing gtkeventbox.c might help you figure out what else is
 needed if you really want to just subclass GtkWidget.

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


widget_class-event not working

2009-08-20 Thread Patrick M. Rutkowski
I've got the following code: http://www.rutski89.com/static/gtkevent.cpp

I do indeed do this:

widget_class-event = any_event_r

but then any_event_r() never subsequently get's called, and I'm
certain that the widget_class-event = any_event_r line really does
execute.

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


Re: widget_class-event not working

2009-08-20 Thread Patrick M. Rutkowski
Incorrect,

The ISO C standard defines the  operator on a function name to be
optional when taking asking for a function pointer, I just use it as a
habit of style.

Here's a demonstration of this effect:
http://www.rutski89.com/static/funcptr.txt

I still need help with the -event GTK problem.

-Patrick

On Thu, Aug 20, 2009 at 8:50 PM, Brian J. Tarriconebj...@cornell.edu wrote:
 On 08/20/2009 05:36 PM, Patrick M. Rutkowski wrote:
 I've got the following code: http://www.rutski89.com/static/gtkevent.cpp

 I do indeed do this:

 widget_class-event = any_event_r

 but then any_event_r() never subsequently get's called, and I'm
 certain that the widget_class-event = any_event_r line really does
 execute.

 Any suggestions?

 You're setting -event to a pointer to a pointer to a function when all
 it wants is a pointer to a function.

        -brian
 ___
 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: widget_class-event not working

2009-08-20 Thread Patrick M. Rutkowski
I'm currently trying to figure out how to query if any other handler
are connected. I didn't connect any, so I'm not sure what to do. I'm
looking at 
http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-disconnect-matched
for help, but if anybody has any tips that would be great, as I might
do it wrong and it might take me a while.

-Patrick

On Thu, Aug 20, 2009 at 9:48 PM, Yu Fengrainwood...@gmail.com wrote:
 The default signal handler is not invoked if any of the customized
 signal handler returns TRUE or something.
 Check if there are any handlers connected to this signal later on that
 returns TRUE.

 Yu

 -
 gboolean            user_function                      (GtkWidget *widget,
                                                        GdkEvent  *event,
                                                        gpointer   user_data)  
     : Run Last
 The GTK+ main loop will emit three signals for each GDK event delivered to a 
 widget: one generic
 ::event signal, another, more specific, signal that matches the type of event 
 delivered (e.g. key-press-event)
 and finally a generic event-after signal.

 widget :

 the object which received the signal.
 event :

 the GdkEvent which triggered this signal
 user_data :

 user data set when the signal handler was connected.
 Returns :

 TRUE to stop other handlers from being invoked for the event and to cancel the
 emission of the second specific ::event signal. FALSE to propagate the event 
 further
  and to allow the emission of the second signal.
 The ::event-after signal is emitted regardless of the return value.

 On Thu, 2009-08-20 at 21:04 -0400, Patrick M. Rutkowski wrote:
 Incorrect,

 The ISO C standard defines the  operator on a function name to be
 optional when taking asking for a function pointer, I just use it as a
 habit of style.

 Here's a demonstration of this effect:
 http://www.rutski89.com/static/funcptr.txt

 I still need help with the -event GTK problem.

 -Patrick

 On Thu, Aug 20, 2009 at 8:50 PM, Brian J. Tarriconebj...@cornell.edu wrote:
  On 08/20/2009 05:36 PM, Patrick M. Rutkowski wrote:
  I've got the following code: http://www.rutski89.com/static/gtkevent.cpp
 
  I do indeed do this:
 
  widget_class-event = any_event_r
 
  but then any_event_r() never subsequently get's called, and I'm
  certain that the widget_class-event = any_event_r line really does
  execute.
 
  Any suggestions?
 
  You're setting -event to a pointer to a pointer to a function when all
  it wants is a pointer to a function.
 
         -brian
  ___
  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


Re: widget_class-event not working

2009-08-20 Thread Patrick M. Rutkowski
OK, so I've determined that there are no handlers returning TRUE
blocking the default handler.

In fact, there seem to be no event handlers at all! I tested this by
figuring out how to query for handlers, and then checking against a
handler I knew was installed:

http://www.rutski89.com/static/squery.txt

So why isn't my default handler any_event_r() executing?

-Patrick


On Thu, Aug 20, 2009 at 9:48 PM, Yu Fengrainwood...@gmail.com wrote:
 The default signal handler is not invoked if any of the customized
 signal handler returns TRUE or something.
 Check if there are any handlers connected to this signal later on that
 returns TRUE.

 Yu

 -
 gboolean            user_function                      (GtkWidget *widget,
                                                        GdkEvent  *event,
                                                        gpointer   user_data)  
     : Run Last
 The GTK+ main loop will emit three signals for each GDK event delivered to a 
 widget: one generic
 ::event signal, another, more specific, signal that matches the type of event 
 delivered (e.g. key-press-event)
 and finally a generic event-after signal.

 widget :

 the object which received the signal.
 event :

 the GdkEvent which triggered this signal
 user_data :

 user data set when the signal handler was connected.
 Returns :

 TRUE to stop other handlers from being invoked for the event and to cancel the
 emission of the second specific ::event signal. FALSE to propagate the event 
 further
  and to allow the emission of the second signal.
 The ::event-after signal is emitted regardless of the return value.

 On Thu, 2009-08-20 at 21:04 -0400, Patrick M. Rutkowski wrote:
 Incorrect,

 The ISO C standard defines the  operator on a function name to be
 optional when taking asking for a function pointer, I just use it as a
 habit of style.

 Here's a demonstration of this effect:
 http://www.rutski89.com/static/funcptr.txt

 I still need help with the -event GTK problem.

 -Patrick

 On Thu, Aug 20, 2009 at 8:50 PM, Brian J. Tarriconebj...@cornell.edu wrote:
  On 08/20/2009 05:36 PM, Patrick M. Rutkowski wrote:
  I've got the following code: http://www.rutski89.com/static/gtkevent.cpp
 
  I do indeed do this:
 
  widget_class-event = any_event_r
 
  but then any_event_r() never subsequently get's called, and I'm
  certain that the widget_class-event = any_event_r line really does
  execute.
 
  Any suggestions?
 
  You're setting -event to a pointer to a pointer to a function when all
  it wants is a pointer to a function.
 
         -brian
  ___
  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


Re: widget_class-event not working

2009-08-20 Thread Patrick M. Rutkowski
I've written a test case that anybody can compile and run:
http://www.rutski89.com/static/event_test.c

It contains the following line of code in the any_event() function:
printf(IT WORKS!\n);

That currently does not get printed.

If you can get the test case to print that line of text, you will have
solved my problem.

No cheating,
-Patrick


P.S. Copy-pasteable compiler command for ease of use:
gcc -Wall -Wextra -Werror -pedantic-errors -std=c89 -ggdb -O0
`pkg-config --cflags --libs gtk+-2.0` event_test.c


On Fri, Aug 21, 2009 at 12:02 AM, Patrick M.
Rutkowskirutsk...@gmail.com wrote:
 OK, so I've determined that there are no handlers returning TRUE
 blocking the default handler.

 In fact, there seem to be no event handlers at all! I tested this by
 figuring out how to query for handlers, and then checking against a
 handler I knew was installed:

 http://www.rutski89.com/static/squery.txt

 So why isn't my default handler any_event_r() executing?

 -Patrick


 On Thu, Aug 20, 2009 at 9:48 PM, Yu Fengrainwood...@gmail.com wrote:
 The default signal handler is not invoked if any of the customized
 signal handler returns TRUE or something.
 Check if there are any handlers connected to this signal later on that
 returns TRUE.

 Yu

 -
 gboolean            user_function                      (GtkWidget *widget,
                                                        GdkEvent  *event,
                                                        gpointer   user_data) 
      : Run Last
 The GTK+ main loop will emit three signals for each GDK event delivered to a 
 widget: one generic
 ::event signal, another, more specific, signal that matches the type of 
 event delivered (e.g. key-press-event)
 and finally a generic event-after signal.

 widget :

 the object which received the signal.
 event :

 the GdkEvent which triggered this signal
 user_data :

 user data set when the signal handler was connected.
 Returns :

 TRUE to stop other handlers from being invoked for the event and to cancel 
 the
 emission of the second specific ::event signal. FALSE to propagate the event 
 further
  and to allow the emission of the second signal.
 The ::event-after signal is emitted regardless of the return value.

 On Thu, 2009-08-20 at 21:04 -0400, Patrick M. Rutkowski wrote:
 Incorrect,

 The ISO C standard defines the  operator on a function name to be
 optional when taking asking for a function pointer, I just use it as a
 habit of style.

 Here's a demonstration of this effect:
 http://www.rutski89.com/static/funcptr.txt

 I still need help with the -event GTK problem.

 -Patrick

 On Thu, Aug 20, 2009 at 8:50 PM, Brian J. Tarriconebj...@cornell.edu 
 wrote:
  On 08/20/2009 05:36 PM, Patrick M. Rutkowski wrote:
  I've got the following code: http://www.rutski89.com/static/gtkevent.cpp
 
  I do indeed do this:
 
  widget_class-event = any_event_r
 
  but then any_event_r() never subsequently get's called, and I'm
  certain that the widget_class-event = any_event_r line really does
  execute.
 
  Any suggestions?
 
  You're setting -event to a pointer to a pointer to a function when all
  it wants is a pointer to a function.
 
         -brian
  ___
  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


Separator not being a darned separator!

2009-05-05 Thread Patrick M. Rutkowski
Someone please help a GTK+ newbie out, I can't make any sense of this:
http://www.rutski89.com/static/taskbook-sep.jpg

Glade says it's of class GtkSeparatorMenuItem, but it doesn't show up
as such in the actual app.

You can find the source code here:
http://www.rutski89.com/static/taskbook-sep.tar.gz

If you have the requisite tools installed, the following one-liner
will download, build, and run the (broken) project. If you trust me
enough, you can give it a spin to see for yourself:

mkdir taskbook-tmp  cd taskbook-tmp  wget
http://www.rutski89.com/static/taskbook-sep.tar.gz  tar xvzf
taskbook-sep.tar.gz  cd taskbook  sh configure
--prefix=$PWD/../taskbook-install  make install 
$PWD/../taskbook-install/bin/taskbook
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How to use Quarks?

2009-01-03 Thread Patrick Braga
I've just begun learning GLib, and I came across Quarks. The documentation 
describes them as association between strings and integer identifiers. 
Given either the stringo or the GQuark identifier it is possible to 
retrieve the other.


This seems really useful and all, but I have no idea when this could be 
applied. I don't necessarily want code examples, just something like if 
you want to do this then you could use quarks to...


Thanks!

Patrick Braga
http://theunixgeek.blogspot.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: When to call g_thread_init(), again...

2008-08-15 Thread Patrick Hallinan
On Fri, 2008-08-15 at 10:58 +0300, Tor Lillqvist wrote:
 The documentation for g_thread_init() says (in the stable branch):
 
   You must call g_thread_init() before executing any other GLib
functions in a threaded GLib program.

Is there a good reason to not compile separate threaded and unthreaded
libraries and do away with g_thread_init() altogether?



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


I want to fix a bug!

2008-07-30 Thread Patrick Hallinan
Hi,

With help, I got http://svn.gnome.org/svn/gtk+/trunk/ building with
jhbuild.  Now I need a bug to work on.  I'm a decent C programmer and
I've done a little gtk+ programming but I don't necessarily understand
all the interactions/assumption of gtk+.  Any suggestions?

Pat.

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


Re: setting up a gtk dev environment

2008-07-28 Thread Patrick Hallinan
On Mon, 2008-07-28 at 10:06 -0400, Owen Taylor wrote:
 On Sun, 2008-07-27 at 14:40 -0400, Patrick Hallinan wrote:
  On Sun, 2008-07-27 at 14:24 -0400, Paul Davis wrote:
   On Sun, 2008-07-27 at 14:08 -0400, Patrick Hallinan wrote:
Hi,

I wish to help with the development of gtk+ but I'm not having any fun
trying to setup a build environment for gtk+.  I've looked for help at
www.gtk.org/development.html and developer.gnome.org. I have tried using
jhbuild from  http://svn.gnome.org/svn/jhbuild/trunk. No dice. 
   
   no dice doesn't really add up to a bug report on jhbuild. hundreds,
   perhaps thousands, of people use that as a way to build and maintain the
   GTK stack from svn. what was your problem with it?
   
  
  I guess you are saying that I should be using jhbuild to get a gtk+
  build environment?
  
  I'm using the subversion trunk for jhbuild which I didn't assume was
  stable.  I get the output below when I try jhbuild bootstrap  
 
 In general, I'd strongly recommend against jhbuild bootstrap. It:
 
  - May install older versions of components than your system versions,
causing weird problems
  - Increases the total amount of things you are building, giving
more possibilities for failure.
 
 It is definitely a bad idea for Fedora 9, which has nice shiny new
 versions of everything. So blow away your install directory and
 start over without the bootstrap, and you'll be happier.
 
  http://live.gnome.org/JhbuildDependencies/FedoraCore
 
 Has information about what packages you need to install for Fedora.
 

I had ignored the FedoraCore link on the jhbuild page because it
indicated FedoraCore and not Fedora.  I thought that it was old.

I installed the missing dependencies and jhbuild sanitycheck gives this:

[EMAIL PROTECTED] fontconfig-2.6.0]$ jhbuild sanitycheck
automake-1.8 not found
automake-1.9 not found

I ignored that and tried jhbuild gtk+' but the first package
(fontconfig-2.6.0) failed to build.  I think that this is the first
error:

In file included from ../fontconfig/fcfreetype.h:27,
 from fcftint.h:26,
 from fcfreetype.c:48:
/usr/include/ft2build.h:56:38: error: freetype/config/ftheader.h: 
No such file or directory

Fedora 9 has fontconfig-2.5.0-2.  I guess I will file a bug against
jhbuild if I can figure out how to.

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


setting up a gtk dev environment

2008-07-27 Thread Patrick Hallinan
Hi,

I wish to help with the development of gtk+ but I'm not having any fun
trying to setup a build environment for gtk+.  I've looked for help at
www.gtk.org/development.html and developer.gnome.org. I have tried using
jhbuild from  http://svn.gnome.org/svn/jhbuild/trunk. No dice.  Is there
help documentation somewhere?  I'd prefer to not have to checkout
individual dependencies, maintain each of them up-to-date and manually
configure environmental and such so that they find each other.

I am running Fedora 9.  I was thinking that I might need to install
rawhide and have a go with that something.  Any help would be very
appreciated.

Thanks,

Pat.

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


Re: setting up a gtk dev environment

2008-07-27 Thread Patrick Hallinan
On Sun, 2008-07-27 at 14:24 -0400, Paul Davis wrote:
 On Sun, 2008-07-27 at 14:08 -0400, Patrick Hallinan wrote:
  Hi,
  
  I wish to help with the development of gtk+ but I'm not having any fun
  trying to setup a build environment for gtk+.  I've looked for help at
  www.gtk.org/development.html and developer.gnome.org. I have tried using
  jhbuild from  http://svn.gnome.org/svn/jhbuild/trunk. No dice. 
 
 no dice doesn't really add up to a bug report on jhbuild. hundreds,
 perhaps thousands, of people use that as a way to build and maintain the
 GTK stack from svn. what was your problem with it?
 

I guess you are saying that I should be using jhbuild to get a gtk+
build environment?

I'm using the subversion trunk for jhbuild which I didn't assume was
stable.  I get the output below when I try jhbuild bootstrap  

Making all in libguile
make[2]: Entering directory
`/home/patrick/repo/gnome2/guile-1.8.3/libguile'
make  all-am
make[3]: Entering directory
`/home/patrick/repo/gnome2/guile-1.8.3/libguile'
if [ no = yes ]; then \
gcc -DHAVE_CONFIG_H -I.. -I.. -c -o c-tokenize.o
c-tokenize.c; \
else \
gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I..-g -O2 -Wall
-Wmissing-prototypes -Werror -c -o c-tokenize.o c-tokenize.c; \
fi
cc1: warnings being treated as errors
stdout:1536: error: ‘input’ defined but not used
make[3]: *** [c-tokenize.o] Error 1
make[3]: Leaving directory
`/home/patrick/repo/gnome2/guile-1.8.3/libguile'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/home/patrick/repo/gnome2/guile-1.8.3/libguile'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/patrick/repo/gnome2/guile-1.8.3'
make: *** [all] Error 2
*** error during stage build of guile: ## Error running make
*** [13/15]




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


Re: setting up a gtk dev environment

2008-07-27 Thread Patrick Hallinan
On Sun, Jul 27, 2008 at 2:44 PM, Simos Xenitellis 
[EMAIL PROTECTED] wrote:

 Apparently libguile has compilation issues.
 You can try to install the package from Fedora so that jhbuild would
 not have to compile it for you.


[EMAIL PROTECTED] patrick]# yum list|grep guile
guile.x86_64 5:1.8.4-1.fc9
installed
guile-cairo.x86_64   1.4.0-6.fc9
installed
guile-cairo-devel.x86_64 1.4.0-6.fc9
installed
guile-devel.x86_64   5:1.8.4-1.fc9
installed
guile-gnome-platform.x86_64  2.15.93-6.fc8
installed
guile-gnome-platform-devel.x86_642.15.93-6.fc8
installed
guile-lib.noarch 0.1.6-1.fc9
installed

I don't have i386 versions installed.

It seems like I'm missing a dependency that the guile package assumes that I
have.



 Simos

 On Sun, Jul 27, 2008 at 7:40 PM, Patrick Hallinan
 [EMAIL PROTECTED] wrote:
  On Sun, 2008-07-27 at 14:24 -0400, Paul Davis wrote:
  On Sun, 2008-07-27 at 14:08 -0400, Patrick Hallinan wrote:
   Hi,
  
   I wish to help with the development of gtk+ but I'm not having any fun
   trying to setup a build environment for gtk+.  I've looked for help at
   www.gtk.org/development.html and developer.gnome.org. I have tried
 using
   jhbuild from  http://svn.gnome.org/svn/jhbuild/trunk. No dice.
 
  no dice doesn't really add up to a bug report on jhbuild. hundreds,
  perhaps thousands, of people use that as a way to build and maintain the
  GTK stack from svn. what was your problem with it?
 
 
  I guess you are saying that I should be using jhbuild to get a gtk+
  build environment?
 
  I'm using the subversion trunk for jhbuild which I didn't assume was
  stable.  I get the output below when I try jhbuild bootstrap
 
  Making all in libguile
  make[2]: Entering directory
  `/home/patrick/repo/gnome2/guile-1.8.3/libguile'
  make  all-am
  make[3]: Entering directory
  `/home/patrick/repo/gnome2/guile-1.8.3/libguile'
  if [ no = yes ]; then \
 gcc -DHAVE_CONFIG_H -I.. -I.. -c -o c-tokenize.o
  c-tokenize.c; \
 else \
 gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I..-g -O2 -Wall
  -Wmissing-prototypes -Werror -c -o c-tokenize.o c-tokenize.c; \
 fi
  cc1: warnings being treated as errors
  stdout:1536: error: 'input' defined but not used
  make[3]: *** [c-tokenize.o] Error 1
  make[3]: Leaving directory
  `/home/patrick/repo/gnome2/guile-1.8.3/libguile'
  make[2]: *** [all] Error 2
  make[2]: Leaving directory
  `/home/patrick/repo/gnome2/guile-1.8.3/libguile'
  make[1]: *** [all-recursive] Error 1
  make[1]: Leaving directory `/home/patrick/repo/gnome2/guile-1.8.3'
  make: *** [all] Error 2
  *** error during stage build of guile: ## Error running make
  *** [13/15]
 
 
 
 
  ___
  gtk-devel-list mailing list
  gtk-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-devel-list
 

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


Re: setting up a gtk dev environment

2008-07-27 Thread Patrick Hallinan
On Sun, 2008-07-27 at 20:27 +0100, Simos Xenitellis wrote:
 On Sun, Jul 27, 2008 at 7:40 PM, Patrick Hallinan
 [EMAIL PROTECTED] wrote:
  On Sun, 2008-07-27 at 14:24 -0400, Paul Davis wrote:
  On Sun, 2008-07-27 at 14:08 -0400, Patrick Hallinan wrote:
   Hi,
  
   I wish to help with the development of gtk+ but I'm not having any fun
   trying to setup a build environment for gtk+.  I've looked for help at
   www.gtk.org/development.html and developer.gnome.org. I have tried using
   jhbuild from  http://svn.gnome.org/svn/jhbuild/trunk. No dice.
 
  no dice doesn't really add up to a bug report on jhbuild. hundreds,
  perhaps thousands, of people use that as a way to build and maintain the
  GTK stack from svn. what was your problem with it?
 
 
  I guess you are saying that I should be using jhbuild to get a gtk+
  build environment?
 
  I'm using the subversion trunk for jhbuild which I didn't assume was
  stable.  I get the output below when I try jhbuild bootstrap
 
  Making all in libguile
  make[2]: Entering directory
  `/home/patrick/repo/gnome2/guile-1.8.3/libguile'
  make  all-am
  make[3]: Entering directory
  `/home/patrick/repo/gnome2/guile-1.8.3/libguile'
  if [ no = yes ]; then \
 gcc -DHAVE_CONFIG_H -I.. -I.. -c -o c-tokenize.o
  c-tokenize.c; \
 else \
 gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I..-g -O2 -Wall
  -Wmissing-prototypes -Werror -c -o c-tokenize.o c-tokenize.c; \
 fi
  cc1: warnings being treated as errors
  stdout:1536: error: 'input' defined but not used
  make[3]: *** [c-tokenize.o] Error 1
 
 That's actually a warning, and because of the -Werror flag, it is
 treated as an error.

I saw that but I don't like compiling code with header files missing.
It causes the compiler to assume things that are not link-time or
run-time checked.

 I do not know why Werror would be enabled. If you cannot find the reason,
 then when the compilation fails and you get the jhbuild options as to
 what to do,
 pick Option 4 which gives you a shell. Enter the guile directory and
 fix up what you can.
 

I didn't really want to get involved in working on jhbuild if I didn't
have to but if that's what everyone is using then I will.  Is this the
preferred way to get a development setup for gtk+?  Are there other good
options?

 If you check at the JhAutobuild website, you can see recent jhbuild
 sessions from people
 that opted in to have the information made available online. From what
 I see, there are no
 failed builds due to guile (guile is not compiled).
 
 So, one thing you can do is try jhbuild again and enable to send the
 logs to JhAutobuild,
 http://live.gnome.org/JhAutobuild
 

I will look at that.  Thanks!

Pat.

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


Re: Learning Glade

2008-04-26 Thread Patrick Braga
Well, I can figure out how to use Glade, but after I have a .glade file,
how do I use it in my program?

On Sat, 2008-04-26 at 17:17 +0800, Alvis Koon wrote:
 Hi,
 
 glade by itself is quite self-explanatory.
 Try glade2, even easier.
 
 Just begin with vbox and hbox and put widgets there, then you will get
 the layout you want.
 
 Yours faithfully,
 
 Alvis Koon
 
 On 26/04/2008, Patrick Braga [EMAIL PROTECTED] wrote:
  Hi, I'm a relative newcomer to GTK+ programming, but I've been using
   GNU/Linux for about a year and a half, know it pretty well, and am
   enjoying writing applications for it.
 
   However, I feel it will be easier for me to write graphical applications
   with an interface designer. The GNOME Library
   (http://library.gnome.org/ ) wasn't very useful and I haven't been able
   to find any decent, up-to-date tutorials on Glade.
 
   Links and/or sample code will be appreciated :)
 
   ~The Unix Geek
   http://theunixgeek.blogspot.com/
 
 
   ___
   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: Learning Glade

2008-04-26 Thread Patrick Braga
Thanks - the code included in those docs seem helpful. I'll try them
out.

On Sat, 2008-04-26 at 09:51 -0300, Tristan Van Berkom wrote:
 On Sat, Apr 26, 2008 at 7:47 AM, Patrick Braga
 [EMAIL PROTECTED] wrote:
 [...]
On 26/04/2008, Patrick Braga [EMAIL PROTECTED] wrote:
 Hi, I'm a relative newcomer to GTK+ programming, but I've been using
  GNU/Linux for about a year and a half, know it pretty well, and am
  enjoying writing applications for it.

  However, I feel it will be easier for me to write graphical 
  applications
  with an interface designer. The GNOME Library
  (http://library.gnome.org/ ) wasn't very useful and I haven't been 
  able
  to find any decent, up-to-date tutorials on Glade.
 
 this came up as google's third hit for libglade:
http://library.gnome.org/devel/libglade/unstable/
 
 The first chapter libglade programming basics displays the 3 or so lines
 of code it takes you to load a libglade interface, plus you have the 
 refference
 manual that follows.
 
 The GtkBuilder manual, first hit on google for gtkbuilder:
 http://library.gnome.org/devel/gtk/2.12/GtkBuilder.html
 
 doesnt include a code example but its used in the same basic
 way as libglade was used.
 
 Cheers,
 -Tristan

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


Learning Glade

2008-04-25 Thread Patrick Braga
Hi, I'm a relative newcomer to GTK+ programming, but I've been using
GNU/Linux for about a year and a half, know it pretty well, and am
enjoying writing applications for it.

However, I feel it will be easier for me to write graphical applications
with an interface designer. The GNOME Library
(http://library.gnome.org/ ) wasn't very useful and I haven't been able
to find any decent, up-to-date tutorials on Glade.

Links and/or sample code will be appreciated :)

~The Unix Geek
http://theunixgeek.blogspot.com/


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


Re: App blueprint, advice please!

2007-12-20 Thread Patrick
Hi Michael

Thanks for the signals and slots tip, that's great.

As for NI:
rant
My experience is limited and quite dated(8-9 years) but it is my 
understanding that in order to distribute free (as in beer) Labview 
code the recipient must have Labview loaded. It is possible to generate 
an executable that will run without Labview loaded but a small license 
fee must be paid back to NI. In addition I believe this executable code 
generation option is at an additional premium to the base Labview.

Indeed some of the instruments I want to control have their own NI 
drivers already. This however has not displaced the native software that 
shipped with the instruments originally. I believe only an open source 
model will provide enough empowerment to tempt lab operators away.

I started with Linux back in 2004 but it is only in the past year that I 
have started posting to lists. I have been completely awestruck at the 
responses to my questions, both here and on other lists. With so many 
talented people like you answering my questions without expectation of 
compensation, how can a company like NI compete in terms of customer 
service, I am saving up for this project. I would rather spend 2K 
sponsoring my open source comrades then those punks at NI
/rant

Okay I am back now, Have a great day-Patrick



Michael L Torrie wrote:
 Patrick wrote:
   
 Lets say a customer had a detector and a pump to pump a sample through 
 it. We could write a Bash script that works something like this:

 -icon launches Bash script
 -sends variable  2 to pump command to pump 2 ml per minute
 -pump command sends signal to serial port or GPIB bus, etc
 -bash sends variable 230 to set the detector to wavelength 230 nm
 -bash autozeros detector
 -launches plot command
 -after that launches data process command
 -then launches database storage command
 - emails whoever, turns your coffee maker on or whateveretc..etc
 

 Seems to me that the lingua franca of this kind of scientific instrument
 control and data collection is LabView.  Most institutions already have
 site license for this software.

 LabView is ideal for several reasons:
 - Works with most GPIB cards, indeed most interface cards come with
 labview drivers
 - Easy graphical environment.  Lets you chain things together (in a
 similar manner to bash, actually), but it's all within the program,
 rather than kludging together non-integrated programs.  Plus it's all
 in-process.  No external spawning things needed, which is expensive.
 - Royalty free code.  You can sell you vi programs or give them away,
 or whatever.  They aren't compiled, but can be obfuscated, or not.  So
 you could sell labview code that people could modify.

 On the other hand, there's no reason why you couldn't use GTK and, say,
 Python to do similar things provided that you have drivers for the GPIB
 boards, and have a well-defined interface that you can use to easily
 build modules that you can string together.  Certainly I don't believe C
 is the appropriate language to do any gluing.  I would recommend python.
  Data collection modules that need to be close to the hardware can be
 done in C, but the rest could easily be done in python.  If you defined
 a protocol for modules to communicate with each other, then you can very
 easily string modules together, hooking data out buses on one module
 (object) with the data in on another module.  The GTK signals and slots
 mechanism would make this quite easy to do, all in-process.

 Michael


   
 It's a terrible over simplification but hopefully illustrates the idea.

 I only have a few hundred dollars to put towards this now but hopefully 
 by the later half of 2008 it will be a few thousand. Please feedback 
 with any thoughts you might have on this whole process. Thanks-Patrick

  


 ___
 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


posting rules regarding text format

2007-12-18 Thread Patrick
I have not been able to post a message today. I tried three times. The 
message concerned a website. The email was sent as text but contained a 
hyperlink I guess that's not good. I also tried after removing the 
_W_W_W but my message did not post.

I visited the gtk site to review the rules but did not see something 
applicable

Could someone tell me some other reasons why I would be blocked.

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


App blueprint, advice please!

2007-12-18 Thread Patrick
Thanks yet again to all for your help with this thread!

and special thanks to John, Nicola, Dan, Gian, Lance and Reed for 
yesterdays posts.

This is awesome!

I was inspired by Göran's advice to promote selling code not software.

I had an idea for the project name yesterday so I registered a couple of 
domain names.

code-read-dot-org (code-red,  as in I read the code, get it??)

In the next 4-6 weeks I hope to upload diagrams of the proposed 
infrastructure and I would like to create a login page were I can post 
information to those who are interested in this project. Information 
such as competitors screenshots. I thought the login might be wise as I 
am not sure of the legality of openly posting this material.

I will layout the technical challenges to this project, source code I 
have already collected and a proposal for a business outline.

Thanks so much, this project has taken a quantum leap forward in a few 
days-Patrick
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: App blueprint, advice please!

2007-12-17 Thread Patrick
Thanks to Dan and John for your last posts and thanks to all. I am 
really delighted with the response to my question!

So it looks like the I could use Bash to spawn other programs but it is 
likely problematic and no one actually recommends it as a first option.

So as Dan was saying, I can launch other programs written in other 
languages from system() function calls. So I could link lots of them 
together regardless of language they are written in and if I really 
needed to I could still access Bash commands like ssh, netcat right?

I think both Python and Ruby can be extended with C without using a 
system call.

Is there anything wrong with calling them from system calls instead?

Thanks again Göran! I read up on Ruby last night for a couple of hours. 
I am sure I can pick this up.

Python is the only language I can actually work at a reasonable pace in. 
I am just learning C.

Is there a reason you chose Ruby over Python? If I am already using 
Python, do you think I need to switch languages to achieve my goal?

And thanks for the tip, I want to sell code not software!

I am going to save this entire thread somewhere safe. I hope one day I 
can compensate or somehow return the favor to all involved.

THANKS!!!-Patrick










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


App blueprint, advice please!

2007-12-16 Thread Patrick
Thanks Murray!, Dank U Neils, Grazie Nicola! Thanks Michael!

Glom, Comedi, NTD and Michaels tips are all great pieces to the puzzle. 
I really appreciate your feedback. If someone is moderating this list 
please let me know if I have traveled to far away from GTK but I was 
just wondering about a few things:

There is an intense need for this in labs. My business is still a bit 
unstable but I have proven to myself that I can sell things and that I 
can recognize markets.

We could write an open source App and still provide for our families, 
there is money in this. We would be solving a huge set of problems 
afflicting scientists everywhere. I am confident that I would have no 
trouble finding sponsors or customers.

I am not sure which open source strategy would be best, having an open 
download link like Ubuntu or charging for each copy like Redhat.

I am able to break down the biggest barrier to entry for this project 
and that is the cost of the actual equipment and the native software to 
run it, which would set someone else back tens or even hundreds of 
thousands.

I would like to get others involved but I am not sure what would be the 
best way to offer compensation.

All of the OEM vendors control each others equipment so I don't see how 
they would be in a position to sue but there is some liability potential 
here and even a frivolous lawsuit could hurt.

I am not concerned about myself. I have done some research and I don't 
see how anyone could take legal action if I did not mention their 
company names. I plan on explaining the devices that can be controlled 
visually with drawings and even in event that something did happen I can 
structure the organization to reduce liability.

However perhaps it would be best to pay others on a bounty basis and 
keep them clear of all of this rather then include them in the credits 
of the project. Do you think this could work?
 
With so many aspects to this does anyone think that using Bash would be 
useful? For example if we designed all the  smaller programs to read and 
write from/to standard input and output, they could be interlinked with 
other Bash commands such as ftp, netcat, ssh, mailx and so on..

Lets say a customer had a detector and a pump to pump a sample through 
it. We could write a Bash script that works something like this:

-icon launches Bash script
-sends variable  2 to pump command to pump 2 ml per minute
-pump command sends signal to serial port or GPIB bus, etc
-bash sends variable 230 to set the detector to wavelength 230 nm
-bash autozeros detector
-launches plot command
-after that launches data process command
-then launches database storage command
- emails whoever, turns your coffee maker on or whateveretc..etc

It's a terrible over simplification but hopefully illustrates the idea.

I only have a few hundred dollars to put towards this now but hopefully 
by the later half of 2008 it will be a few thousand. Please feedback 
with any thoughts you might have on this whole process. Thanks-Patrick

 


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


Re: App blueprint, advice please!

2007-12-16 Thread Patrick
Thanks!

Sorry for being so dense but just to double check, do you spawn C and 
Python programs form the main App written in Ruby?

I have wanted to learn Ruby for a while now, I could definitely do that. 
Nicola was saying that my Bash idea might be a problem because of the 
spawn time involved with bash. Is Ruby pretty fast spawning these 
secondary programs?

Is the Ruby shell a true system shell? I am just wondering if I could 
still access ftp, netcat, ssh ect..

Thanks for your time.

And thank you Dan and Nicola too. I don't need much convincing that the 
whole Bash as a nervous system + (Python/C/Ruby etc) as the muscle is a 
dumb idea!-Patrick

G Hasse wrote:
 On Sun, Dec 16, 2007 at 08:57:01PM +0100, Dan H wrote:
   
 On Sun, 16 Dec 2007 12:47:44 -0500
 Patrick [EMAIL PROTECTED] wrote:

 
 With so many aspects to this does anyone think that using Bash
 would be useful? For example if we designed all the  smaller
 programs to read and write from/to standard input and output, they
 could be interlinked with other Bash commands such as ftp, netcat,
 ssh, mailx and so on..

 Lets say a customer had a detector and a pump to pump a sample
 through it. We could write a Bash script that works something like
 this:

 -icon launches Bash script
 -sends variable  2 to pump command to pump 2 ml per minute
 -pump command sends signal to serial port or GPIB bus, etc
 -bash sends variable 230 to set the detector to wavelength 230 nm
 -bash autozeros detector
 -launches plot command
 -after that launches data process command
 -then launches database storage command
 - emails whoever, turns your coffee maker on or whateveretc..etc

 It's a terrible over simplification but hopefully illustrates the
 idea.
   
 I got the idea but I don't think the Bourne shell (bash) would be a
 particular wise choice to implement it, owing to weird programming
 paradigms and an almost complete absence of arithmetics. I'm a big fan
 of C (and shell scripting as well), but it seems that Python has been
 gaining lots of popularity in the past years.
 

 Hello!

 Or you could do as us and implement control in Ruby. Ruby of Python
 is quite as good. Then you have a modern scripting language to do
 control with.

 And now for wom Gtk promotion. We have been developing a SCADA
 system in Gtk, C and Ruby with a SQL database as central storage.

 http://www.freescada.com

 A tip for you is to be in the buissines of selling source code.
 We have had quite a success with this. Most of our competitors have
 closed code and the customers are locked in. Since we provide our
 customers with souce code they can expand the application and
 for them selves check the quality.

 In this way we have developed an application for the swedish
 defence.  

 http://www.raditex.se/~gh/bilder/RadarBildPulser.png

   

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


App blueprint, advice please!

2007-12-15 Thread Patrick
Sorry for the long email but I really could use some help. I sell used 
lab instruments to people doing great work researching cures. The closed 
source programs to control and process data from these instruments often 
cost 20K. The people providing the software really abuse their legal 
positions. Writing an open source replacement has become an obsession 
for me.

I want to build an App to control dozens or even hundreds of instruments 
using different ports/buses (GPIB, Serial, Parallel etc) and I want to 
do some fairly complex data processing after. Then I want to be able to 
save the data in a database and/or in numerous formats.

The problem is, I am not qualified for all this, I am a part time, self 
taught programmer. I will need to pay others to bring this to fruition. 
I figure the best way to solve a complex problem is to break it down 
into  smaller parts. I was thinking about writing  small GTK/Python, 
GTK/C programs that can read from standard input and write to standard 
output. I was thinking that I could write customized BASH scripts for 
people to connect these small programs into a cohesive  App. When others 
get involved they could simply do the same and write more custom BASH 
commands, indeed in their language of choice.

I think using Bash as the App nervous system and Python/C as the 
muscle would make sense but I have never seen such an App, which makes 
me think it is probably a stupid idea.

I have been going around in circles for about a year now and still do 
not have a line of code to show for myself. This project may take many 
years. Any feedback on my blueprint would be really appreciated-Patrick
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: C vs C++ for GTK

2007-11-26 Thread Patrick
Hi Micheal

Indeed, good advice!

I am planning on using Python for everything I can. I just need a little 
extra speed for data collection and threading during collection.

I think I will learn C so that I can re-use code from other open source 
projects.

All of this advice has been great, thanks to you and to everyone that 
posted!

-Patrick

Michael L Torrie wrote:
 Patrick wrote:
   
 Hi Everyone.

 Sorry for the flame war bait, I know how passionate language debates 
 get  but I need some guidance. I am using PyGTK right now and I am happy 
 with it, but a day is coming soon were the speed limitations and 
 less-then-straight-forward threading will be an issue.
 

 I don't see any reason at all why a GUI done with PyGTK should be any
 slower than a GUI done with straight C.  Thus I don't see any compelling
 reason to abandon Python for C or C++.

 That said, however, Python sometimes isn't the right language to use for
 computationally-intensive tasks.

 Personally I think you are going about this the wrong way.  You could be
 wanting to do premature optimization.  Rather than trying to replace
 python, you should consider either extending python with C or C++, to
 replace the slowest and most-used computational paths, and stick with
 python for everything else. It's very easy to write python modules in C
 (10 hours to learn), or C++ (Boost makes it easy to wrap C++ classes and
 functions).  Alternatively you can code in C or C++ and embed Python to
 drive your GUI.

   
 I figure my next move should be to learn C or C++. I would like to stay 
 up-to-date with things and I would like to be able to reuse GTK code 
 from other Apps.
 

 When it comes to the basic API, translating a code-generated GUI between
 python and C++ (with GTKmm) should be very simple.  Even translating it
 to C won't be that hard either, except that you don't have an easy way
 to bind callbacks to a particular instance of data without some work,
 like setting data values and using the void *data argument on the callbacks.

   
 I thought that C++ must be the way to go as it can do everything that C 
 can plus plus but some heavy hitters don't seem enthused with it, 
 Linus Torvalds in particular has been quoted as calling it a horrible 
 language.
 

 From my experience it is those that don't understand C++ and how to
 wield it that describe it that way.  Torvalds is biased anyway, since
 he's focused on kernel programming.

   
 I can only spend 8-12 hours a week programming, I am not a professional 
 programmer, is C++ to complicated? Is C going out of date? Am I limited 
 with C?
 

 C++ is complicated, but not overly so.  I feel that coming from Python,
 C++ is probably going to be easier for you to move to than C.

 Again, though, I think

   
 Thanks-Patrick




 ___
 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


C vs C++ for GTK

2007-11-24 Thread Patrick
Hi Everyone.

Sorry for the flame war bait, I know how passionate language debates 
get  but I need some guidance. I am using PyGTK right now and I am happy 
with it, but a day is coming soon were the speed limitations and 
less-then-straight-forward threading will be an issue.

I figure my next move should be to learn C or C++. I would like to stay 
up-to-date with things and I would like to be able to reuse GTK code 
from other Apps.

I thought that C++ must be the way to go as it can do everything that C 
can plus plus but some heavy hitters don't seem enthused with it, 
Linus Torvalds in particular has been quoted as calling it a horrible 
language.

I can only spend 8-12 hours a week programming, I am not a professional 
programmer, is C++ to complicated? Is C going out of date? Am I limited 
with C?

Thanks-Patrick




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


Filtering GtkComboBoxEntry input

2007-08-11 Thread Patrick Hallinan
Hi,

Is there a way to filter the text input to a GtkComboBoxEntry?  I want to
use it to provide a drop down list for preconfigured values and also to
allow a user to set there own arbitrary value.

On a related note:  Is there an elegant way to directly set the text for the
entry to some arbitrary text?  Presently I'm doing this:

gtk_combo_box_insert_text (combo, 0, text);
gtk_combo_box_set_active  (combo, 0);
gtk_combo_box_remove_text (combo, 0);

Thanks,

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


Setting a widget's width to the text width

2007-08-10 Thread Patrick Hallinan
Hi,

I want to create a GtkComboEntry where the width is exactly set to display
the largest string in the drop down list.  I do not want to hard code the
width.  Is this something easy to do?

Thanks for any help!

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


Pango: slight performance tweak.

2007-05-10 Thread Patrick Hallinan

I've made a change to pango-layout.c.  When fitting text in a line, the
current algorithm does a linear search to find the break.   I thought that
performance would be further increased by storing character width
cumulatively (rather than differentially) so that a binary search could be
performed.  I made the change and I think I see a 35% reduction in search
time for the ONE use case I tried.  I ran this:

./pango-view --wrap=word --width=800 test-long-paragraph.txt

and counted the number of loops to find the width breakpoint, then counted
the number of loops to find the line break.

The way this works is once the character width is stored cummulatively you
can get the width for however many characters like this:

 width = state-width[state-log_widths_offset + num_characters] -
state-width[state-log_widths_offset];

The routine does a binary search for the number of characters that will fit
on the line then does a linear search backwards for a proper line break.
Index: pango-glyph.h
===
--- pango-glyph.h	(revision 2271)
+++ pango-glyph.h	(working copy)
@@ -100,6 +100,12 @@
 		 PangoRectangle   *ink_rect,
 		 PangoRectangle   *logical_rect);
 
+void pango_glyph_string_get_cummulative_widths (PangoGlyphString *glyphs,
+	const char   *text,
+	int   length,
+	int   embedding_level,
+	int  *cummulative_width);
+
 void pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
 	const char   *text,
 	int   length,
Index: glyphstring.c
===
--- glyphstring.c	(revision 2271)
+++ glyphstring.c	(working copy)
@@ -297,6 +297,79 @@
  * @text: the text corresponding to the glyphs
  * @length: the length of @text, in bytes
  * @embedding_level: the embedding level of the string
+ * @cummulative_width: an array whose length is g_utf8_strlen (text, length) + 1
+ *  to be filled with the cummulative character widths. The first
+ *  entry is always 0.
+ *
+ * Given a #PangoGlyphString resulting from pango_shape() and the corresponding
+ * text, determine the screen width corresponding to each character. When
+ * multiple characters compose a single cluster, the width of the entire
+ * cluster is divided equally among the characters.
+ **/
+void
+pango_glyph_string_get_cummulative_widths (PangoGlyphString *glyphs,
+  const char   *text,
+  int   length,
+  int   embedding_level,
+  int  *cummulative_width)
+{
+  int i, j;
+  int last_cluster = 0;
+  int width = 0;
+  int last_cluster_width = 0;
+  const char *p = text;		/* Points to start of current cluster */
+  int cummulative = 0;
+
+  if (cummulative_width) cummulative_width[0] = 0;
+
+  for (i=0; i=glyphs-num_glyphs; i++)
+{
+  int glyph_index = (embedding_level % 2 == 0) ? i : glyphs-num_glyphs - i - 1;
+
+  /* If this glyph belongs to a new cluster, or we're at the end, find
+   * the start of the next cluster, and assign the widths for this cluster.
+   */
+  if (i == glyphs-num_glyphs || p != text + glyphs-log_clusters[glyph_index])
+	{
+	  int next_cluster = last_cluster;
+
+	  if (i  glyphs-num_glyphs)
+	{
+	  while (p  text + glyphs-log_clusters[glyph_index])
+		{
+		  next_cluster++;
+		  p = g_utf8_next_char (p);
+		}
+	}
+	  else
+	{
+	  while (p  text + length)
+		{
+		  next_cluster++;
+		  p = g_utf8_next_char (p);
+		}
+	}
+
+	  for (j = last_cluster; j  next_cluster; j++)
+	cummulative = cummulative_width[j+1] = 
+  (width - last_cluster_width) / (next_cluster - last_cluster) + 
+   cummulative;
+
+	  last_cluster = next_cluster;
+	  last_cluster_width = width;
+	}
+
+  if (i  glyphs-num_glyphs)
+	width += glyphs-glyphs[glyph_index].geometry.width;
+}
+}
+
+/**
+ * pango_glyph_string_get_logical_widths:
+ * @glyphs: a #PangoGlyphString
+ * @text: the text corresponding to the glyphs
+ * @length: the length of @text, in bytes
+ * @embedding_level: the embedding level of the string
  * @logical_widths: an array whose length is g_utf8_strlen (text, length)
  *  to be filled in with the resulting character widths.
  *
Index: pango-layout.c
===
--- pango-layout.c	(revision 2271)
+++ pango-layout.c	(working copy)
@@ -30,6 +30,9 @@
 
 #include pango-layout-private.h
 
+#define GET_WIDTH(num_characters)  \
+  (state-width[state-log_widths_offset + num_characters] -  \
+   state-width[state-log_widths_offset])
 
 typedef struct _Extents Extents;
 typedef struct _ItemProperties ItemProperties;
@@ -3014,7 +3017,7 @@
   int start_offset;		/* Character offset of first item in state-items in layout-text */
   

Re: Problem to open a new window using libglade

2007-03-07 Thread patrick
Hello,
if I use g_idle_add, then when the function from g_idle_add is
executed, it blocks the 'update_pbar' function.
So I probably must make it with threads but by now I think it's to
early for me to work with threads. It's easier if I add the
progressbar into the main window, and update it with:
while (gtk_events_pending())
  gtk_main_iteration();

Later I would probably try it with threads.

Thanks for the help.


2007/3/6, Karl H. Beckers [EMAIL PROTECTED]:
 Am Montag, den 05.03.2007, 17:03 +0100 schrieb patrick:
  Great! Thank you very much, this works.
  But how can I make something during gtk_dialog_run?
  I'd like to do somthing like this.
 
  g_timeout_add(1000, update_pbar, dialog);
  result = gtk_dialog_run(GTK_DIALOG(dialog));
  ...my process which progressbar should show
  g_spawn...
  progress = 0.2
  other work
  gtk_widget_destroy(dialog);
  dialog = NULL;
 
 
  update_pbar (gpointer dialog)
  {
  ...
  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(probar), progress);
  ...
  }

 Well,
 you either need another scheduled function (prolly g_idle_add) or start
 a separate thread when entering your callback and join it before ending.

 You prolly want to avoid multi-threading for such a rather limited
 use-case.

 Also, I've noted a flaw in my pseudo-code around setting dialog to NULL
 which does not change the pointer that has already been passed to
 update_pbar ... a static global would prolly do here or smth. similar.

 HTH,

 Karl.


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


Re: Problem to open a new window using libglade

2007-03-05 Thread patrick
Great! Thank you very much, this works.
But how can I make something during gtk_dialog_run?
I'd like to do somthing like this.

g_timeout_add(1000, update_pbar, dialog);
result = gtk_dialog_run(GTK_DIALOG(dialog));
...my process which progressbar should show
g_spawn...
progress = 0.2
other work
gtk_widget_destroy(dialog);
dialog = NULL;


update_pbar (gpointer dialog)
{
...
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(probar), progress);
...
}

Thank you


2007/3/2, Karl H. Beckers [EMAIL PROTECTED]:
 Well,

 there's prolly several ways of doing it, but smth. along the following
 lines should work:

 GladeXML *gxml = glade_xml_new (GLADE_FILE, dialog1, NULL);
 GtkWidget *dialog = glade_xml_get_widget(gxml, dialog1);
 g_assert(dialog);
 GtkResponseType result;

 // register function to be executed in intervals
 g_timeout_add(1000, update_pbar, dialog);
 result = gtk_dialog_run(GTK_DIALOG(dialog));

 if (result == GTK_RESPONSE_OK)
 {
 }

 gtk_widget_destroy(dialog);
 dialog = NULL;

 then you need the timeout function:

 gboolean
 update_pbar (gpointer dialog)
 {
 // stop executing and unregister this function if dialog has
 // been set to NULL
 if (!dialog) return 0;
 // if dialog has not been displayed yet, don't bother updating
 // the progress bar
 if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(dialog))) return 1;

 ...
 do whatever needs to be done to update the progressbar here

 return 1;
 }

 HTH,

 Karl.



 Am Freitag, den 02.03.2007, 23:32 +0100 schrieb patrick:
  Thanks for your answer.
 
   if I'm not completely mistaken here, this has nothing to do with glade.
   The thing just is, that you need to return to the main loop from the
   callback for the widgets to be drawn properly.
   That is prolly why you put in your gtk_main_iteration though I doubt
   there is a guaranteed way to make this work.
  I think this is my problem.
  So I made a new dialog:
 
  GladeXML *gxml = glade_xml_new (GLADE_FILE, dialog1, NULL);
  GtkWidget *dialog = glade_xml_get_widget(gxml, dialog1);
  GtkResponseType result;
 
  result = gtk_dialog_run(GTK_DIALOG(dialog));
 
  if (result == GTK_RESPONSE_OK)
  {
  }
  gtk_widget_destroy(dialog);
 
  The window (dialog) now appears, but I want a progress window, with
  a progressbar and a label for the description. But how can I make
  somthing while the dialog is visible so that I can show the progress
  to the user?
 
  Thanks for the help.
 
 
  2007/3/2, Karl H. Beckers [EMAIL PROTECTED]:
   Am Freitag, den 02.03.2007, 11:33 -0500 schrieb
   [EMAIL PROTECTED]:
 void
 on_button1_clicked(GtkButton *button, gpointer data)
 {
   /* the button was clicked */
   //Print out to console
   g_print(Beginn break\n);

   //Create the new progress window
   GladeXML*gxml_progress = NULL;
   gxml_progress = glade_xml_new (GLADE_FILE, window2, NULL);

   //show the window
   GtkWidget *window2 = glade_xml_get_widget(gxml_progress,
window2);
   gtk_widget_show_all(window2);

   while (gtk_events_pending())
   gtk_main_iteration();

   //Make 5 sec. break
   g_usleep(500);
   g_print(End break\n);
 }
  
   Hi there,
  
   if I'm not completely mistaken here, this has nothing to do with glade.
   The thing just is, that you need to return to the main loop from the
   callback for the widgets to be drawn properly.
   That is prolly why you put in your gtk_main_iteration though I doubt
   there is a guaranteed way to make this work.
  
   So the complicated version would probably involve having hooking up a
   callback to the configure event for the second window that starts smth.
   and then automatically deregisters itself after the first run.
  
   The other thing I've found to work is use a GTK_DIALOG rather than a
   generic window and then do smth. along the lines of:
  
   result = gtk_dialog_run (GTK_DIALOG (dialog));
  
   if (result == GTK_RESPONSE_OK) {
   got_file_name =
   gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
  
   xml = NULL;
   xml = glade_get_widget_tree (GTK_WIDGET (xvc_pref_main_window));
   g_assert (xml);
  
   w = NULL;
   w = glade_xml_get_widget (xml, xvc_pref_sf_filename_entry);
   g_assert (w);
  
   gtk_entry_set_text (GTK_ENTRY (w), strdup (got_file_name));
   }
  
   gtk_widget_destroy (dialog);
  
   Of course, if you're not really interested in the user's input you can
   just ignore the result.
  
   HTH,
  
   Karl.
  
  
  
 


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

Re: Problem to open a new window using libglade

2007-03-02 Thread patrick
Thanks for your answer.

 if I'm not completely mistaken here, this has nothing to do with glade.
 The thing just is, that you need to return to the main loop from the
 callback for the widgets to be drawn properly.
 That is prolly why you put in your gtk_main_iteration though I doubt
 there is a guaranteed way to make this work.
I think this is my problem.
So I made a new dialog:

GladeXML *gxml = glade_xml_new (GLADE_FILE, dialog1, NULL);
GtkWidget *dialog = glade_xml_get_widget(gxml, dialog1);
GtkResponseType result;

result = gtk_dialog_run(GTK_DIALOG(dialog));

if (result == GTK_RESPONSE_OK)
{
}
gtk_widget_destroy(dialog);

The window (dialog) now appears, but I want a progress window, with
a progressbar and a label for the description. But how can I make
somthing while the dialog is visible so that I can show the progress
to the user?

Thanks for the help.


2007/3/2, Karl H. Beckers [EMAIL PROTECTED]:
 Am Freitag, den 02.03.2007, 11:33 -0500 schrieb
 [EMAIL PROTECTED]:
   void
   on_button1_clicked(GtkButton *button, gpointer data)
   {
 /* the button was clicked */
 //Print out to console
 g_print(Beginn break\n);
  
 //Create the new progress window
 GladeXML*gxml_progress = NULL;
 gxml_progress = glade_xml_new (GLADE_FILE, window2, NULL);
  
 //show the window
 GtkWidget *window2 = glade_xml_get_widget(gxml_progress,
  window2);
 gtk_widget_show_all(window2);
  
 while (gtk_events_pending())
 gtk_main_iteration();
  
 //Make 5 sec. break
 g_usleep(500);
 g_print(End break\n);
   }

 Hi there,

 if I'm not completely mistaken here, this has nothing to do with glade.
 The thing just is, that you need to return to the main loop from the
 callback for the widgets to be drawn properly.
 That is prolly why you put in your gtk_main_iteration though I doubt
 there is a guaranteed way to make this work.

 So the complicated version would probably involve having hooking up a
 callback to the configure event for the second window that starts smth.
 and then automatically deregisters itself after the first run.

 The other thing I've found to work is use a GTK_DIALOG rather than a
 generic window and then do smth. along the lines of:

 result = gtk_dialog_run (GTK_DIALOG (dialog));

 if (result == GTK_RESPONSE_OK) {
 got_file_name =
 gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));

 xml = NULL;
 xml = glade_get_widget_tree (GTK_WIDGET (xvc_pref_main_window));
 g_assert (xml);

 w = NULL;
 w = glade_xml_get_widget (xml, xvc_pref_sf_filename_entry);
 g_assert (w);

 gtk_entry_set_text (GTK_ENTRY (w), strdup (got_file_name));
 }

 gtk_widget_destroy (dialog);

 Of course, if you're not really interested in the user's input you can
 just ignore the result.

 HTH,

 Karl.



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


Problem to open a new window using libglade

2007-03-01 Thread patrick
Hi All,

I'd like to open a new window, when a button is clicked by using libglade.
But the window appears always at the end of the function, but it
should appear at the beginnig, so that I can show the progrwess to the
user.
I also tried to add while (gtk_events_pending())
gtk_main_iteration(); but then only the outlines are visible, not the
labels, and progressbars.

So I put together a short example to explain the problem.
Now the window appears with the beginning of the break, but the labels
etc, at the end.
How can I open the window, so that the labels etc. are visible, to
show the progress to the user?
thanks a lot!

Patrick

/* sample.glade */

?xml version=1.0 standalone=no? !--*- mode: xml -*--
!DOCTYPE glade-interface SYSTEM http://glade.gnome.org/glade-2.0.dtd;

glade-interface

widget class=GtkWindow id=window1
  property name=border_width10/property
  property name=visibleTrue/property
  property name=title translatable=yeswindow1/property
  property name=typeGTK_WINDOW_TOPLEVEL/property
  property name=window_positionGTK_WIN_POS_NONE/property
  property name=modalFalse/property
  property name=resizableFalse/property
  property name=destroy_with_parentFalse/property
  property name=decoratedTrue/property
  property name=skip_taskbar_hintFalse/property
  property name=skip_pager_hintFalse/property
  property name=type_hintGDK_WINDOW_TYPE_HINT_NORMAL/property
  property name=gravityGDK_GRAVITY_NORTH_WEST/property
  property name=focus_on_mapTrue/property
  property name=urgency_hintFalse/property

  child
widget class=GtkButton id=button1
  property name=width_request150/property
  property name=visibleTrue/property
  property name=can_focusTrue/property
  property name=label translatable=yesRun/property
  property name=use_underlineTrue/property
  property name=reliefGTK_RELIEF_NORMAL/property
  property name=focus_on_clickTrue/property
  signal name=clicked handler=on_button1_clicked
last_modification_time=Mon, 19 Feb 2007 20:34:21 GMT/
/widget
  /child
/widget

widget class=GtkWindow id=window2
  property name=border_width10/property
  property name=visibleTrue/property
  property name=title translatable=yeswindow2/property
  property name=typeGTK_WINDOW_TOPLEVEL/property
  property name=window_positionGTK_WIN_POS_NONE/property
  property name=modalFalse/property
  property name=resizableFalse/property
  property name=destroy_with_parentFalse/property
  property name=decoratedTrue/property
  property name=skip_taskbar_hintFalse/property
  property name=skip_pager_hintFalse/property
  property name=type_hintGDK_WINDOW_TYPE_HINT_NORMAL/property
  property name=gravityGDK_GRAVITY_NORTH_WEST/property
  property name=focus_on_mapTrue/property
  property name=urgency_hintFalse/property

  child
widget class=GtkVBox id=vbox1
  property name=visibleTrue/property
  property name=homogeneousFalse/property
  property name=spacing0/property

  child
   widget class=GtkLabel id=label1
 property name=visibleTrue/property
 property name=label translatable=yesProgress window/property
 property name=use_underlineFalse/property
 property name=use_markupFalse/property
 property name=justifyGTK_JUSTIFY_LEFT/property
 property name=wrapFalse/property
 property name=selectableFalse/property
 property name=xalign0.5/property
 property name=yalign0.5/property
 property name=xpad0/property
 property name=ypad0/property
 property name=ellipsizePANGO_ELLIPSIZE_NONE/property
 property name=width_chars-1/property
 property name=single_line_modeFalse/property
 property name=angle0/property
   /widget
   packing
 property name=padding0/property
 property name=expandFalse/property
 property name=fillFalse/property
   /packing
  /child

  child
   widget class=GtkProgressBar id=progressbar1
 property name=visibleTrue/property
 property name=orientationGTK_PROGRESS_LEFT_TO_RIGHT/property
 property name=fraction0/property
 property name=pulse_step0.1000149/property
 property name=ellipsizePANGO_ELLIPSIZE_NONE/property
   /widget
   packing
 property name=padding0/property
 property name=expandFalse/property
 property name=fillFalse/property
   /packing
  /child

  child
   widget class=GtkLabel id=label2
 property name=visibleTrue/property
 property name=label translatable=yesprogress_description/property
 property name=use_underlineFalse/property
 property name=use_markupFalse/property
 property name=justifyGTK_JUSTIFY_LEFT/property
 property name=wrapFalse/property
 property name=selectableFalse/property
 property name=xalign0.5/property
 property name=yalign0.5/property
 property name=xpad0/property
 property name=ypad0/property
 property name=ellipsizePANGO_ELLIPSIZE_NONE/property
 property name=width_chars-1/property
 property name=single_line_modeFalse/property
 property name

Hardcore C++/unix/linux trading system development roles - top Wall Street firms

2006-01-19 Thread Patrick Burke
All full-time, permanent positions on various financial trading desks.Looking for core server-side C++ development skills on linux/unixplatforms. Highly challenging and rewarding work and you'll be compensated
well. Financial experience is not required.

If you'd like to learn more, please send me a note.

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


Making a window that doesn't block mouse events to the root window (desktop)

2005-07-18 Thread Patrick Conheady
G'day there,

I'd like to have a non-editable text box layer just on
top of my desktop so that it's behind everything, and
have it pass all its mouse events to the desktop.
While it should visibly cover part of the desktop, I
don't want it to get in the way of desktop right-click
menus.

Can the GtkWindow widget do this, and how do I do it?

Thanks,
-Pat.





___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list