[gtk-osx-users] Building GTK 2 on apple silicon

2022-04-19 Thread Gabriele Greco via gtk-osx-users-list
I'm trying to build gtk+2 on apple silicon but I have a small problem in
the bootstrap stage:

The itstool download site seems broken (401 on download) and I cannot find
alternative download locations for:

http://files.itstool.org/itstool/itstool-2.0.6.tar.bz2

Can someone help me (also sending me the file itself through e-mail if
nothing better :) )

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] Newer macOS version (12.0) than being linked (11.0)

2022-01-07 Thread Gabriele Greco via gtk-osx-users-list
The warning you have are almost harmless, they said just that the MAIN
application is built with an OSX sdk older than the libraries it uses. This
can be a problem since the application will be able to run on macos 11 but
the library may use some macos12 only symbols.

I usually build with 10.10 MACOSX_DEPLOYMENT_TARGET env variable, both the
libraries (gtk, ffmpeg...) and the application.

Please note that the C target (so most GTK APIs) has an ABI that is almost
freezed, but if you use also C++ libraries (ie GTKmm) having libraries
compiled against a newer SDK than the application may be a problem.

On Mon, Jan 3, 2022 at 1:53 AM john  wrote:

>
>
> On Jan 2, 2022, at 3:23 AM, Pascal  wrote:
>
>
> Le 30 déc. 2021 à 19:31, John Ralls  a écrit :
>
> On Dec 30, 2021, at 10:21 AM, Pascal  wrote:
>
> Le 30 déc. 2021 à 17:57, Paul Emsley via gtk-osx-users-list <
> gtk-osx-users-list@gnome.org> a écrit :
>
> On 30/12/2021 16:13, Pascal wrote:
>
> Le 30 déc. 2021 à 14:43, Paul Emsley via gtk-osx-users-list <
> gtk-osx-users-list@gnome.org> a écrit :
>
> On 30/12/2021 11:29, Pascal wrote:
>
> Hello,
>
> My configuration is macOS 12, I just built:
>
> % jhbuild bootstrap-gtk-osx
> % jhbuild build python3
> % jhbuild build meta-gtk-osx-bootstrap
>
> When I build my program I got a lot of:
> ld: warning: dylib (/usr/local/xnadalib-2021/lib/libgtk-3.dylib) was built
> for newer macOS version (12.0) than being linked (11.0)
>
> It is not so clear.
> What is this actually meaning?
>
> This seems just to be a warning but my program shows some erroneous GTK
> executions.
>
> How to deal with it?
>
> NB : with GTK which was built when I was on macOS 11, I have no warning
> and no issue to build my program on macOS 12.
>
> Have you installed homebrew? If so, rename or remove it while compiling
> gtk-osx.
>
> No Paul, I haven't.
>
> OK, interesting. It seems that you do have something in /usr/local though
> - do you know what it is?
>
>
> I found only CLI tools like BBEdit or OSXFuse.
>
> I have MacPorts installed in /opt/local but not in PATH.
> Should I delete XDG_CACHE_HOME folder before building GTK?
>
>
> I don't know, sorry. My feeling is that you shouldn't need to do so.
>
>
> When looking in environnement variables in jhbuild shell, I found:
> [JH] % echo $MACOSX_DEPLOYMENT_TARGET
> 12
>
> Should I specify 11 in calling setup_sdk in jhbuildrc-custom?
>
> If so, I wonder: why the link message is issued as I have rebuilt all on
> macOS 12?
>
>
> The link message is saying that whatever you're trying to link was
> compiled with macosx-version-min=11.0 while libgtk-3.dylib was compiled
> with macosx-version-min=12.0. Did you perhaps forget to reconfigure your
> project after rebuilding everything else?
>
>
> Hello John,
>
> I aim to build the GTKAda bindings with the fixed version of GTK for macOS
> 12.
> I dig in my building configuration without success.
> In fact the issue is coming from my Ada compiler which is stuck to macOS
> 11, the internal compilation is done with -mmacosx-version-min=11.0.0.
>
> So I got:
> otool -l
> /usr/local/xnadalib-2021/lib/gtkada/gtkada.relocatable/gtkada/libgtkada.dylib
>  cmd LC_BUILD_VERSION
>  cmdsize 32
> platform 1
>minos 11.0
>  sdk 10.17
>
> Thus the warning.
>
> The test program is nevertheless running but fails with:
> Gtk:ERROR:../../../../gtk+-3.24.30/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon:
> assertion failed (error == NULL): Failed to load
> /usr/local/xnadalib-2021/share/icons/Adwaita/24x24/status/image-missing.png:
> Unrecognized image file format (gdk-pixbuf-error-quark, 3)
> Bail out!
> Gtk:ERROR:../../../../gtk+-3.24.30/gtk/gtkiconhelper.c:494:ensure_surface_for_gicon:
> assertion failed (error == NULL): Failed to load
> /usr/local/xnadalib-2021/share/icons/Adwaita/24x24/status/image-missing.png:
> Unrecognized image file format (gdk-pixbuf-error-quark, 3)
>
> However the GTKAda source code is the same since I built it on macOS 11
> with success.
>
> Well now, should I specify setup_sdk(target="11") in jhbuildrc-custom and
> rebuild all GTK stuff?
>
>
> The gdk-pixbuf errors have to do with not being able to find its modules.
> That might be because you need to run gdk-pixbuf-query-loaders
> --update-cache (in a jhbuild shell of course!) or you need to set
> GDK_PIXBUF_MODULEDIR to point at where it is, see
> http://manpages.ubuntu.com/manpages/impish/man1/gdk-pixbuf-query-loaders.1.html
> .
>
> Regards,
> John Ralls
>
> ___
> gtk-osx-users-list mailing list
> gtk-osx-users-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list
>


-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] Crash on big sur

2021-01-26 Thread Gabriele Greco via gtk-osx-users-list
Hi guys,

I found a crash on big sur of my application, that uses gtk-osx through the
official build scripts and digging in the net I found the very exact
problem in both gimp and inkscape (that are maybe the two biggest gtk 2
programs out there).

The problem itself is in cairo:

https://gitlab.gnome.org/GNOME/gimp/-/issues/5279

... reading the comments I saw that it has been fixed 1 month ago in the
macOS build system of GIMP (that I suppose it's not gtk-osx-build)

because looking at

https://gitlab.gnome.org/GNOME/gtk-osx

... that is if I remember correctly the repository where the build system
read the modulesets from I do not see the patch, I see only a refcount
patch of 5 months ago on cairo:

https://gitlab.gnome.org/GNOME/gtk-osx/-/commit/cea9f2e9e2b65f012ec299f591996507da17533f

It seems that the patch the mono guys did, and that was incorporated in
cairo upstream (and the gimp build system, since there is no new cairo
version with the patch) is totally different:

https://github.com/mono/bockbuild/pull/162/files

I think there is a fork in gitlab with the correct version that is:

https://gitlab.gnome.org/samm-git/gtk-osx

... should I switch building from there or do you plan to upstream those
patches soon?

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] GTK with Quartz backend

2021-01-12 Thread Gabriele Greco via gtk-osx-users-list
I read in a mailing list (not the one of osxcross) that some do not use
> Apple hardware as an European court would consider it a vexatious
> clause, and therefore that software related clause should only be
> applied in the USA.
> Anyway should be always possible legally cross-compile from Linux on
> Apple HW.
>

The gtk-osx-build system itself require macOS to work, but nothing prevents
you from building it on a Mac, then move the whole tree it created (that
with jhbuild you can place for instance in /usr/local/gtkosx ) to another
machine, also linux, provided you use a similar build system and deployment
target, AFAIK osxcross supports libc++, so it should be possible.

You will be able to build macOS binaries that use the GTK quartz backend,
probably you will need to do some changes to the scripts if you want to use
also the gtk-mac-bundler to build an app bundle with the gtk libraries
inside since it depends from command line utils that usually have different
names in not macOS targets.

Anyway since virtualizing macOS is forbidden on non macOS hosts, building
macOS software with CI services (like github actions, travis...) is very
expensive, amazon just introduced an AWS mac mini, but it's more expensive
that an AI instance with a TESLA cad I'm not really sure that cross
compiling to mac is a bad thing... also because you are not using the
software itself, but just some supporting files (header and libraries) that
you are allowed to use as developer.

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] GtkGLArea and gtk3 osx

2020-05-26 Thread Gabriele Greco via gtk-osx-users-list
Hi guys,

I'm having some strange problems with GtkGLArea widget.

Latest stable moduleset (the widget should be available since 3.16).

If I try to create the widget in glade I get a label on it "The current
backend does not support OpenGL"

If I try to load a builder xml file with GtkGLArea element in I get:

Undefined type GtkGLArea

... if I build a simple command that does:

gtk_gl_area_new()

... and then I use opengl through epoxy... it works

It seems to me that somewhere in the chain, once GtkGLArea has been
implemented in OSX, there is still code "blocking" it.

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] New build system

2020-05-20 Thread Gabriele Greco via gtk-osx-users-list
... beside that with setup_sdk set in jhbuildrc-custom the compilation fail
at:

*** Error during phase build of gobject-introspection: ## Error
running ninja   *** [21/32]

distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET
mismatch: now "10.10" but "10.15" during configure

On Wed, May 20, 2020 at 8:59 AM Gabriele Greco 
wrote:

> Hi guys, I have problems with the new build system (the one with pyenv) to
> make jhbuild honor the osx min version (MACOS_DEPLOYMENT_TARGET /
> -mmacosx-version-min ).
>
> I've added the line in .config/jhbuildrc-custom;
>
> setup_sdk(target="10.10")
>
> If I start "jhbuild shell" I get the variables correctly configured
> (partial output of "env"):
>
> MACOSX_DEPLOYMENT_TARGET=10.10
> LDFLAGS=-L/Users/raffo/gtk/inst/lib -L/Users/raffo/gtk/inst/lib -arch
> x86_64
> -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
> -mmacosx-version-min=10.10 -Wl,-headerpad_max_install_names
> CFLAGS=-arch x86_64
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
> -mmacosx-version-min=10.10
> CXXFLAGS=-arch x86_64
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
> -mmacosx-version-min=10.10
> OBJCFLAGS=-arch x86_64
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
> -mmacosx-version-min=10.10
> CPPFLAGS=-I/Users/raffo/gtk/inst/include -arch x86_64
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
>
> CMAKE_PREFIX_PATH=/Users/raffo/gtk/inst:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr
>
> LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
>
> SDKDIR=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
>
> SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
>
> CUPS_CONFIG=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/bin/cups-config
> CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
> OBJC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
> CXX=/Applications/Xcode.app/Contents/Developer/usr/bin/g++
>
> LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
> BUILDCFLAGS=-arch x86_64
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
> -mmacosx-version-min=10.10
> CFLAGS_FOR_BUILD=-arch x86_64
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
> -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
> -mmacosx-version-min=10.10
>
>  but when I start the build itself (jhbuild bootstrap-gtk-osx) it
> seems to ignore these settings:
>
> NEW BUILD:
> iMac-2 $ otool -l /Users/raffo/gtk/inst/lib/libintl.dylib | grep -A 3
> LC_VERS
> [ nothing ]
>
> OLD BUILD (working):
> iMac-2 $ otool -l /usr/local/gtk/lib/libintl.dylib | grep -A 3 LC_VERS
>   cmd LC_VERSION_MIN_MACOSX
>   cmdsize 16
>   version 10.9
>   sdk 10.14
>
> --
> Bye,
>  Gabry
>
>

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] New build system

2020-05-20 Thread Gabriele Greco via gtk-osx-users-list
Hi guys, I have problems with the new build system (the one with pyenv) to
make jhbuild honor the osx min version (MACOS_DEPLOYMENT_TARGET /
-mmacosx-version-min ).

I've added the line in .config/jhbuildrc-custom;

setup_sdk(target="10.10")

If I start "jhbuild shell" I get the variables correctly configured
(partial output of "env"):

MACOSX_DEPLOYMENT_TARGET=10.10
LDFLAGS=-L/Users/raffo/gtk/inst/lib -L/Users/raffo/gtk/inst/lib -arch
x86_64
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.10 -Wl,-headerpad_max_install_names
CFLAGS=-arch x86_64
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.10
CXXFLAGS=-arch x86_64
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.10
OBJCFLAGS=-arch x86_64
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.10
CPPFLAGS=-I/Users/raffo/gtk/inst/include -arch x86_64
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
CMAKE_PREFIX_PATH=/Users/raffo/gtk/inst:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr
LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
SDKDIR=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
CUPS_CONFIG=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/bin/cups-config
CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
OBJC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
CXX=/Applications/Xcode.app/Contents/Developer/usr/bin/g++
LD=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
BUILDCFLAGS=-arch x86_64
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.10
CFLAGS_FOR_BUILD=-arch x86_64
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.10

 but when I start the build itself (jhbuild bootstrap-gtk-osx) it seems
to ignore these settings:

NEW BUILD:
iMac-2 $ otool -l /Users/raffo/gtk/inst/lib/libintl.dylib | grep -A 3
LC_VERS
[ nothing ]

OLD BUILD (working):
iMac-2 $ otool -l /usr/local/gtk/lib/libintl.dylib | grep -A 3 LC_VERS
  cmd LC_VERSION_MIN_MACOSX
  cmdsize 16
  version 10.9
  sdk 10.14

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] CodeSigning and Catalina security issue.

2020-02-21 Thread Gabriele Greco via gtk-osx-users-list
>
>
> For the demo program you might see if you can set enough of the
> environment in Info.plis using
> https://developer.apple.com/documentation/bundleresources/information_property_list/lsenvironment
> to get it to run. For your actual program the easiest solution is to
> rewrite your launcher in python and put it in Resources, compile
> python-launcher.c and use the result as the main-binary.
>

I don't know how it works with python gtk+ apps, but with C/C++ apps it's
quite easy to avoid using a launcher script, I have a setup_paths()
function that I run before gtk_init(), that does a job similar to the
launcher script, it has the advantage over the LSEnvorinment stuff to be
able to bind the resources to the current app bundle path, I'm sharing it
here if someone is interested:

void
setup_paths()
{
char execpath[MAXPATHLEN+1];
char path[MAXPATHLEN * 4], *c;

uint32_t pathsz = sizeof (execpath);
_NSGetExecutablePath (execpath, );

// if we are not in a bundle let's use the system GTK enviroment...
if (!strstr(execpath, ".app")) {
ILOG << "Not in bundle, doing normal startup";
return;
}

fprintf(stderr, "EXECPATH: %s\n", execpath);
c = strrchr(execpath, '/');
*c = 0;
strcat(execpath, "/../Resources");
chdir(execpath);
getcwd(path, sizeof(path));
fprintf(stderr, "CWD: %s\n", path);

strcpy(path, execpath);
strcat(path, "/lib/gtk-2.0");
setenv ("GTK_PATH", path, 1);
strcpy(path + strlen(execpath), "/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache");
setenv ("GDK_PIXBUF_MODULE_FILE", path, 1);
// pango prefix
strcpy(path + strlen(execpath), "/etc");
setenv("PANGO_SYSCONFDIR", path, 1);
strcpy(path + strlen(execpath), "/lib");
setenv("PANGO_LIBDIR", path, 1);
ILOG << "OSX GTK resource setup completed";
// strcpy(path + strlen(execpath), "/../Resources/share/themes");
// setenv ("GTK_DATA_PREFIX", path, 1);
}

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] macOS Catalina’s new security features versus GTK.

2020-01-20 Thread Gabriele Greco via gtk-osx-users-list
>
>
>
> Catalina won't let you have a bundle that runs a program that's not in the
> bundle, nor will it allow a bundled program to dyld libraries outside of
> the bundle and not in the system library directories. (You can dlopen
> outside libraries from pre-specified locations if you use the plugins
> entitlement when code signing the bundle, but that's a bit different.)
>
> The simplest path forward is to use gtk-mac-bundler.
>

... did the codesign option in the bundler works correctly now? At the
moment I'm still doing something like:

gtk-mac-bundler app.bundle find installers/myapp.app -name *.dylib -exec
codesign [...];
find installers/myapp.app -name *.so -exec codesign[...];
codesign -vvv --deep --force --options runtime --strict [...]
dmgbuild -s dmg_setup.py "MyApp $(VERSION)" installers/MyApp-$(VERSION).dmg
codesign [...] installers/MyApp-$(VERSION).dmg

... to have a DMG that passes the notarization process.

I'm not sure if his problem may be related, but it's possible that a not
notarized/stapled binary cannot request at all "unlocking" access to
certain path locations?

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] macOS 10.15.x and notarizing

2019-10-10 Thread Gabriele Greco via gtk-osx-users-list
On Tue, Oct 8, 2019 at 11:08 PM John Ralls  wrote:

>
>
> The notarization process is supposed to mean that if it notarizes then
> Catalina's gatekeeper will happily allow it. There's no guarantee that you
> don't have a crasher bug, of course, but if it runs on Mojave it will
> probably be OK on Catalina.
>

Before finding the page on the gnome wiki my first notarization attempt
failed that way: the process reaches the end also if the libraries are not
signed (I thought the --deep flag was enough to sign them all), but the
program fails at runtime to load a .dylib without signature.

BTW: I've upgraded a machine to Catalina and tried the build (that I made
on another machine), everything seems to work, without any specific
entitlement.

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] macOS 10.15.x and notarizing

2019-10-08 Thread Gabriele Greco via gtk-osx-users-list
Hi guys,

yesterday apple released macOS 10.15 and one of the new "features" is that
all the developer signed apps should be notarized (sent to apple for an
automatic review), I found and used the instructions in this page:

https://wiki.gnome.org/Projects/GTK/OSX/Bundling#Notarizing

... and I've been able to create an application that passes the apple
process, what I'm not sure of is if a C/C++ GTK app requires one or more of
the entitlements defined by Apple to run:

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_automation_apple-events?language=objc

... my tests show me that should be not the case, the app seems to work ok,
but I'm still on Mojave and I've not tried it in Catalina yet.

What I fear, and maybe some GTK developer may answer is that a GTK app may
"break" this:

Allow DYLD Environment Variables Entitlement


A Boolean value that indicates whether the app may be affected by dynamic
linker environment variables, which you can use to inject code into your
app’s process.
Key: com.apple.security.cs.allow-dyld-environment-variables

or this

Disable Library Validation Entitlement


A Boolean value that indicates whether the app may load arbitrary plug-ins
or frameworks, without requiring code signing.
Key: com.apple.security.cs.disable-library-validation

... I've signed every .dylib and .so, and engine/pixbuf loading seems to
work... but again I'm still on Mojave...

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: Migrating away from GtkStock stuff

2019-02-07 Thread Gabriele Greco via gtk-app-devel-list
>
>
>> If you're using `edit-find` or `document-save` then you're using a named
> icon from the icon theme, not the stock identifier.
>
> For those, you'll have to ship an icon theme like Adwaita.
>

That's really strange, it seems there is something in my gtk stack that
converts GTK_STOCK_XXX to the icon theme equivalent, anyway they should
show since I've the Adwaita theme installed.

See the following example to see how gtk-about became help-about

#include 

int main(int argc, char *argv[]) {
gtk_init(, );

GtkWidget *w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(w),
gtk_image_new_from_stock(GTK_STOCK_ABOUT, GTK_ICON_SIZE_LARGE_TOOLBAR));
gtk_widget_show_all(w);
gtk_main();
}


shelob-2 $ grep -r GTK_STOCK_ABOUT /usr/local/gtk/include/gtk-3.0/gtk
/usr/local/gtk/include/gtk-3.0/gtk/deprecated/gtkstock.h: * GTK_STOCK_ABOUT:
/usr/local/gtk/include/gtk-3.0/gtk/deprecated/gtkstock.h:#define
GTK_STOCK_ABOUT((GtkStock)"gtk-about")

shelob-2 $ g++ -o test test.c `pkg-config gtk+-3.0 --cflags --libs`
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior
is deprecated [-Wdeprecated]
test.c:8:34: warning: 'GtkStock' is deprecated [-Wdeprecated-declarations]
gtk_image_new_from_stock(GTK_STOCK_ABOUT,
GTK_ICON_SIZE_LARGE_TOOLBAR));
 ^
/usr/local/gtk/include/gtk-3.0/gtk/deprecated/gtkstock.h:123:38: note:
expanded from macro 'GTK_STOCK_ABOUT'
#define GTK_STOCK_ABOUT((GtkStock)"gtk-about")
 ^
/usr/local/gtk/include/gtk-3.0/gtk/deprecated/gtkstock.h:105:1: note:
'GtkStock' has been explicitly marked deprecated here
G_DEPRECATED
^
/usr/local/gtk/include/glib-2.0/glib/gmacros.h:432:37: note: expanded from
macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
^
test.c:8:9: warning: 'gtk_image_new_from_stock' is deprecated
[-Wdeprecated-declarations]
gtk_image_new_from_stock(GTK_STOCK_ABOUT,
GTK_ICON_SIZE_LARGE_TOOLBAR));
^
/usr/local/gtk/include/gtk-3.0/gtk/gtkimage.h:121:1: note:
'gtk_image_new_from_stock' has been explicitly marked deprecated here
GDK_DEPRECATED_IN_3_10_FOR(gtk_image_new_from_icon_name)
^
/usr/local/gtk/include/gtk-3.0/gdk/gdkversionmacros.h:329:47: note:
expanded from macro 'GDK_DEPRECATED_IN_3_10_FOR'
# define GDK_DEPRECATED_IN_3_10_FOR(f)GDK_DEPRECATED_FOR(f)
  ^
/usr/local/gtk/include/gtk-3.0/gdk/gdkversionmacros.h:49:31: note: expanded
from macro 'GDK_DEPRECATED_FOR'
#define GDK_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GDK_EXTERN
  ^
/usr/local/gtk/include/glib-2.0/glib/gmacros.h:444:29: note: expanded from
macro 'G_DEPRECATED_FOR'
#define G_DEPRECATED_FOR(f) G_DEPRECATED
^
/usr/local/gtk/include/glib-2.0/glib/gmacros.h:432:37: note: expanded from
macro 'G_DEPRECATED'
#define G_DEPRECATED __attribute__((__deprecated__))
^
2 warnings generated.

shelob-2 $ ./test

(process:77229): Gtk-WARNING **: 14:28:48.629: Locale not supported by C
library.
Using the fallback 'C' locale.

(test:77229): Gtk-WARNING **: 14:28:49.162: Could not find the icon
'help-about'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
http://icon-theme.freedesktop.org/releases

(test:77229): Gtk-WARNING **: 14:28:49.162: Error loading theme icon
'help-about' for stock: Icon 'help-about' not present in theme Adwaita

 --
Ciao,
 Gabry

-- 


Le informazioni contenute nella presente comunicazione e i relativi 
allegati possono essere riservate e sono, comunque, destinate 
esclusivamente alle persone o alla Società sopraindicati e non sono da 
considerarsi comunicazioni personali, quindi eventuali risposte potranno 
essere conosciute da persone appartenenti all’azienda. La diffusione, 
distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi 
soggetto diverso dal destinatario è proibita ai sensi dell’art. 616 c.p. I 
dati forniti verranno trattati ai sensi dell'art. 13 del Regolamento UE 
2016/679 (normativa sulla privacy). Se ha ricevuto questo messaggio per 
errore Ti preghiamo di distruggerlo e di informarci immediatamente 
contattandoci mandando una mail a priv...@wyscout.com 
. Copia integrale dell’informativa potrà essere 
visionata presso le nostre sedi. 

Any information herein included (even 
any attachments) shall be considered confidential and/or privileged 
material and meant to be only for the abovementioned persons and/or 
Company, therefore such communication is intended to be for the addressee 
only. Such information is not personal, that is why this e-mail and any 
replies may be known exclusively by people belonging to the company. It is 
expressively not allowed communicate, disclose and/or copy any 
documentation transmitted by a person other than the recipient, 

Migrating away from GtkStock stuff

2019-02-07 Thread Gabriele Greco via gtk-app-devel-list
Hi guys,

I'm in the process of migrating a big code base from GTK 2.x to GTK 3.x,
I've done most of the work, but I'm facing now some problems with GTK stock
stuff.

I used stock stuff a lot to reduce the localizable strings needed in my
code and to reduce the number of images to ship.

From what I've seen there are no more stock items in GTK 3 (3.24.2 at the
moment), since they have been deprecated in 3.10.

It's more a removal than a deprecation since my code compiles but the
program seems to fail to find at least the icons pointed by the stock item:

(:75970): Gtk-WARNING **: 12:47:16.541: Error loading theme icon
'document-new' for stock: Icon 'document-new' not present in theme Adwaita
(:75970): Gtk-WARNING **: 12:47:16.598: Error loading theme icon
'document-open' for stock: Icon 'document-open' not present in theme Adwaita
(:75970): Gtk-WARNING **: 12:47:16.599: Error loading theme icon
'document-save' for stock: Icon 'document-save' not present in theme Adwaita
(:75970): Gtk-WARNING **: 12:47:16.599: Error loading theme icon
'edit-find' for stock: Icon 'edit-find' not present in theme Adwaita

There is a stack overflow post that suggests how to handle the migration
from a GtkStock item to a "named icon" or a "gtk localized label":

https://stackoverflow.com/questions/36805505/gtk-stock-is-deprecated-whats-the-alternative

... but what about toolbar or buttons that given the theme may have icons,
labels or both?

-- 
*Bye,*
* Gabry*

-- 


Le informazioni contenute nella presente comunicazione e i relativi 
allegati possono essere riservate e sono, comunque, destinate 
esclusivamente alle persone o alla Società sopraindicati e non sono da 
considerarsi comunicazioni personali, quindi eventuali risposte potranno 
essere conosciute da persone appartenenti all’azienda. La diffusione, 
distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi 
soggetto diverso dal destinatario è proibita ai sensi dell’art. 616 c.p. I 
dati forniti verranno trattati ai sensi dell'art. 13 del Regolamento UE 
2016/679 (normativa sulla privacy). Se ha ricevuto questo messaggio per 
errore Ti preghiamo di distruggerlo e di informarci immediatamente 
contattandoci mandando una mail a priv...@wyscout.com 
. Copia integrale dell’informativa potrà essere 
visionata presso le nostre sedi. 

Any information herein included (even 
any attachments) shall be considered confidential and/or privileged 
material and meant to be only for the abovementioned persons and/or 
Company, therefore such communication is intended to be for the addressee 
only. Such information is not personal, that is why this e-mail and any 
replies may be known exclusively by people belonging to the company. It is 
expressively not allowed communicate, disclose and/or copy any 
documentation transmitted by a person other than the recipient, according 
to the Italian Criminal Code, Section 616 and the Regulation EU 2016/679. 
Your provided data are processed in accordance with Regulation EU 2016/679 
(Data Protection Law), Section 13. A full copy of the relevant information 
notice is available at the company’s registered office upon request. If you 
received this in error, please destroy it and inform us immediately by 
sending an e-mail to the following e-mail address priv...@wyscout.com 
. A full copy of the relevant information 
notice is available at the company’s registered office upon request.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

[gtk-osx-users] Pango and 10.14 (with latest clang)

2019-01-28 Thread Gabriele Greco via gtk-osx-users-list
It seems that pango (1.42.4) does not build in 10.4 with latest tools and
SDK, configured with a deployment target of 10.9, the error is pretty
cryptic, my guess is that pango somehow redefines a type used internally by
OSX headers (dispatch_source_t stuff).

I worked around this error placing in the output directory the build of the
older pango version I used with my previous build (1.38.1), that seems to
satisfay GTK+2 that depends from 1.20.

I've been able to complete the build and I found that sadly the actual
build still have the known problems with 10.14 and dark mode specifically I
found:

- Partial rendering in some circumstances (scrolling, initial layout..).
- Crash on exit when destroying surfaces with "active" rendering.
- Crash moving an app from a display to another if a rendering is going on
in the gtk app (for instance a video playback).

>From the stack traces I see that the crashing problems are related to
CGStackRestore with null pointers...

Anyway here is the output of the pango build failure:

xzcat -d "/Users/gabry/gtk/source/pkgs/pango-1.42.4.tar.xz" | tar xf -
*** Configuring pango *** [23/28]

[ cut ...]

 GISCAN   Pango-1.0.gir  CCLD libpangocairo-1.0.la
pango-engine.h:300: Warning: Pango: symbol='script_engine_list': Unknown
namespace for symbol 'script_engine_list'
pango-engine.h:313: Warning: Pango: symbol='script_engine_init': Unknown
namespace for symbol 'script_engine_init'
pango-engine.h:324: Warning: Pango: symbol='script_engine_exit': Unknown
namespace for symbol 'script_engine_exit'
pango-engine.h:335: Warning: Pango: symbol='script_engine_create': Unknown
namespace for symbol 'script_engine_create'
pango-version-macros.h:287: Warning: Pango: Unknown namespace for
identifier 'Interval'
fonts.c:490: Warning: Pango: pango_font_description_set_variations_static:
unknown parameter 'variations' in documentation comment, should be
'settings'
fonts.c:530: Warning: Pango: pango_font_description_set_variations: unknown
parameter 'variations' in documentation comment, should be 'settings'
pango-coverage.c:127: Warning: Pango: pango_coverage_ref: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-coverage.c:88: Warning: Pango: pango_coverage_copy: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-coverage.c:64: Warning: Pango: pango_coverage_new: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-coverage.c:460: Warning: Pango: pango_coverage_from_bytes: return
value: Invalid non-constant return of bare structure or union; register as
boxed type or (skip)
pango-coverage.c:64: Warning: Pango: pango_coverage_new: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-coverage.c:460: Warning: Pango: pango_coverage_from_bytes: return
value: Invalid non-constant return of bare structure or union; register as
boxed type or (skip)
pango-script.c:128: Warning: Pango: pango_script_iter_new: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-script.c:128: Warning: Pango: pango_script_iter_new: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-attributes.c:164: Warning: Pango: pango_attribute_copy: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-attributes.c:303: Warning: Pango: pango_attr_language_new: return
value: Invalid non-constant return of bare structure or union; register as
boxed type or (skip)
pango-attributes.c:559: Warning: Pango: pango_attr_size_new: return value:
Invalid non-constant return of bare structure or union; register as boxed
type or (skip)
pango-attributes.c:574: Warning: Pango: pango_attr_size_new_absolute:
return value: Invalid non-constant return of bare structure or union;
register as boxed type or (skip)
pango-attributes.c:710: Warning: Pango: pango_attr_font_desc_new: return
value: Invalid non-constant return of bare structure or union; register as
boxed type or (skip)
pango-attributes.c:1040: Warning: Pango: pango_attr_shape_new: return
value: Invalid non-constant return of bare structure or union; register as
boxed type or (skip)
pango-attributes.c:995: Warning: Pango: pango_attr_shape_new_with_data:
return value: Invalid non-constant return of bare structure or union;
register as boxed type or (skip)
pango-attributes.c:1110: Warning: Pango: pango_attr_font_features_new:
return value: Invalid non-constant return of bare structure or union;
register as boxed type or (skip)
pango-attributes.c:1687: Warning: Pango: pango_attr_list_get_iterator:
return value: Invalid non-constant return of bare structure or union;
register as boxed type or (skip)
pango-attributes.c:1798: Warning: Pango: pango_attr_iterator_copy: return
value: Invalid non-constant return 

[gtk-osx-users] Bugs with 10.14 dark mode

2019-01-28 Thread Gabriele Greco via gtk-osx-users-list
Hi guys,

I've found a few rendering problems and a crash on exit with GTK+2.x (a
compile of about 1.5 years ago), and 10.14 dark mode.

I've been able to track this problem running my app with different osx
versions and then running gtktest on mojave...

When I found that the bug was related to 10.14 dark mode I've been able to
google with more suited keywords and I found this:

https://gitlab.gnome.org/GNOME/gtk/issues/1437

My question is:

is this bug opened as it seems or there is a fix or a workaround like the
last comment of John suggests?

I'm stuck at compiling the last stable modulesets for some python
incompatibilities but if the bug is still open this will not solve the
problem...

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] GTK OSX and Mojave

2019-01-25 Thread Gabriele Greco via gtk-osx-users-list
Hi guys,

I'm trying to do a new installation of GTK with JHbuild, I'm having a few
problem with python, libxml2 and the build process.

If I do:

jhbuild bootstrap
jhbuild build meta-gtk-osx-bootstrap

the second command fails because libxml2 does not work with the apple
provided python

if I run:

jhbuild bootstrap
jhbuild build python meta-gtk-osx-bootstrap

... the second step works, but then it fails on :

jhbuild build meta-gtk-osx-core

with the error

jhbuild build: could not download
http://gitlab.gnome.org/GNOME/gtk-osx/raw/master/modulesets-stable/gtk-osx.modules:


 because I think the jhbuild python does not support openssl.

I read an old thread that says to break the python build and manually add
openssl dependency but there is a more elegant way, for instance in the
.jhbuild-custom to fix this behaviour?

-- 
Bye,
 Gabry
___
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] About copy & paste

2018-06-07 Thread Gabriele Greco
Thanks a lot,

I was struggling with GtkBindingSet stuff (rather poorly documented and
without usage examples) when I found that GTK+2 has an easier way to do
that through .gtkrc-2.0:

binding "custom-text-entry"
{
bind "v" { "paste-clipboard" () }
bind "c" { "copy-clipboard" () }
bind "x" { "cut-clipboard" () }
}

class "GtkEntry" binding "custom-text-entry"


On Thu, Jun 7, 2018 at 5:54 AM, John Ralls  wrote:

>
>
> On Jun 6, 2018, at 2:13 AM, Gabriele Greco 
> wrote:
>
>
>> > There is a "clean" way to allow copy & paste on GtkEntry/GtkTextView on
>> the OSX GTK version at least ALSO with CMD-C & CMD-V ?
>> Unless you’re using a very old version of Gtk--more than 5 or 6
>> years--for some strange reason
>> it should Just Work *with out-of-the-box GtkEntry/TextView*. If the code
>> using the widgets has overridden the bindings to C and V
>> then you’ll have to patch it.
>
> In C you can use GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR instead of
>> GDK_CONTROL_MASK. GtkBuilder got a  modifier in 3.20 that does the
>> same thing, but Glade neither understands it nor uses it. Worse, Glade gets
>> it completely wrong by having a radio choice for “primary” modifier but
>> inserting  in response.
>>
>
> Sorry I forgot to mention that my apps are all based on GTK 2.24.x (with X
> the latest patch). Mostly because I found in the past (last time I checked
> was about two years ago) that Win32 and OSX versions of GTK 3 where a bit
> buggy and not suited for production environment.
>
> I also have a tiny C++ wrapper on GTK that will need a lot of work to be
> ported to GTK 3 ( https://oogtk.sourceforge.net ), but that's a secondary
> issue :)
>
> My GUI use GtkBuilder, but, as you said, GtkBuilder supports
> GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR  since 3.20.
>
> Of course grepping that macro in my GTK 2 sources do not give any result...
>
>
> For Gtk+-2 you’ll need to patch the code with #ifdef __APPLE__ or some
> such. If you’re using gtk_mac_integration you can use whatever preprocessor
> macro you use to control that. The functions you need are
> https://developer.gnome.org/gtk2/stable/gtk2-Bindings.html and the
> signals are cut-clipboard, copy-clipboard, and paste-clipboard. The command
> keys are bound to GDK_META_MASK. If the entry is created with GtkBuilder
> then load the builder file first, then override the signal’s keybinding.
>
> Regards,
> John Ralls
>
>
>


-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] About copy & paste

2018-06-06 Thread Gabriele Greco
>
>
> > There is a "clean" way to allow copy & paste on GtkEntry/GtkTextView on
> the OSX GTK version at least ALSO with CMD-C & CMD-V ?
> Unless you’re using a very old version of Gtk--more than 5 or 6 years--for
> some strange reason
> it should Just Work *with out-of-the-box GtkEntry/TextView*. If the code
> using the widgets has overridden the bindings to C and V
> then you’ll have to patch it.

In C you can use GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR instead of
> GDK_CONTROL_MASK. GtkBuilder got a  modifier in 3.20 that does the
> same thing, but Glade neither understands it nor uses it. Worse, Glade gets
> it completely wrong by having a radio choice for “primary” modifier but
> inserting  in response.
>

Sorry I forgot to mention that my apps are all based on GTK 2.24.x (with X
the latest patch). Mostly because I found in the past (last time I checked
was about two years ago) that Win32 and OSX versions of GTK 3 where a bit
buggy and not suited for production environment.

I also have a tiny C++ wrapper on GTK that will need a lot of work to be
ported to GTK 3 ( https://oogtk.sourceforge.net ), but that's a secondary
issue :)

My GUI use GtkBuilder, but, as you said, GtkBuilder supports
GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR  since 3.20.

Of course grepping that macro in my GTK 2 sources do not give any result...

-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] About copy & paste

2018-06-05 Thread Gabriele Greco
Hi guys,

There is a "clean" way to allow copy & paste on GtkEntry/GtkTextView on the
OSX GTK version at least ALSO with CMD-C & CMD-V ?

I've done something that almost work using a keyboard snooper but I do not
like it at all...

-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


GUI size and translations

2017-04-26 Thread Gabriele Greco
I've recently received the localization strings for my application in a few
languages and I've found that few translations keep the gui minimum size
larger that the screen of many notebook (my target is to make it fit 1280
pixels).

I've not found an easy way to understand what string is causing the
problem, also because I've a 12 pages notebook that is used to display the
various GUI layouts (and one of the 12 may be the culprit of the gui
horizontal grow).

I'm quite new to localization and gettext and I was wondering if there is a
standard way to check for this kind of problems without having to explore
every single mask of the program with every supported language... (actually
I will be already in the order of several hundreds tests...)

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


Re: Input event reduction

2017-03-30 Thread Gabriele Greco
>
>
> Thanks. While I can remember have read your explanations somewhere
> already, I really missed that g_main_context_invoke() function.


There is some difference/advantage on calling:

g_main_context_invoke(NULL, func, data)?

instead of

g_idle_add(func, data);

As far as I can see from the function documentations g_main_context_invoke
seems useful when having multiple contexts on different threads, I'm wrong?

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


Re: gdk_threads_leave is possible to cause segmentation fault?

2017-03-28 Thread Gabriele Greco
> But  now this functions aren't running. This is my main thread
> void *vGtkMain_Thread(gpointer data)
> {
> gdk_threads_enter();
> gtk_main();
> gdk_threads_leave();
> return NULL;
> }
>

You should remove everywhere in your code gtk_threads_ calls.

You cannot call gtk_label_get_text from a thread different from the gtk
main loop one, get the result of the call and pass it to the thread
function as parameter.

You should take care that the functions you call with g_idle_add() return
FALSE otherwise they will be called every time the main loop is idle using
100% of CPU (this can be a desired behaviour in some circumstances).

You should also take care that the global data you access in
iUpdateConfigNow, gbUpdateStatusNow... is not changed while you are
updating the GUI


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


Re: gdk_threads_leave is possible to cause segmentation fault?

2017-03-28 Thread Gabriele Greco
>
>
> In gdk manual i see thath gdk_threads_enter and leave has been
> deprecated and alll gdk and gtk+ calls should be made from main thread.
> How we do this? Someone have any example?
>
> You have to call g_idle_add (that is thread safe) every time you need to
update one or more widgets from an external thread.

Let's think about a common situation, for instance you are encoding a video
file and you want to update a progress bar:

[from encoding thread]
struct progress {
char label[50];
float value;
};

myprg = malloc(sizeof(struct progress));
myprg->value = 75.0;
strncpy(myprg->label, "Second pass", sizeof(myprg->label));
g_idle_add((GCallback)progress_update, myprg);

gboolean progress_update(struct progress *p);
{
 gtk_progress_bar_set_text(p->label);
 gtk_progress_bar_set_fraction(p->value);
 free(p);
 return FALSE; // it means that you want to run this only once
}

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


Re: Fwd: Resize and place a background image (Expose Event)

2017-03-02 Thread Gabriele Greco
>
>
> Now, application crash after start, but i think that is because i make
> the unref of pixbuf, and in next expose event, fails (i think)...
>
> GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF
> (src)' failed


This happens because your original "pixbuf"  is a global object, remove the
first of the three _unref and you should be fine!

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


Fwd: Resize and place a background image (Expose Event)

2017-03-02 Thread Gabriele Greco
>
> This works, but application blocks after a while..
>

I'm quite sure the problem is that you are leaking at least 2 pixbuf and a
pixmap for every expose event your app receives, and anyway, are you sure
you have to do it every time an expose event is thrown and not only when
the window is resized (configure_event)?


>
>
>  pixbuf = gdk_pixbuf_scale_simple(pixbuf, widget->allocation.width,
>

If the original pixbuf has been created just for this operation, this call
leaks a pixbuf object, you shoud do something like:

GdkPixbuf *scaled = gdk_pixbuf_scale_simple(pixbuf,
widget->allocation.width, [...]
g_object_unref(pixbuf);


> widget->allocation.height, GDK_INTERP_BILINEAR);
>  gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
>

At this point you leak the second pixbuf, use for instance:
g_object_unref(scaled);


>  style->bg_pixmap[0] = background;
>  gtk_widget_set_style (GTK_WIDGET(widget), GTK_STYLE(style));
>

I'm quite sure set_style will increase reference count for 'background', so
after this call you should unref that pixmap:

g_object_unref(background);

You'll receive runtime errors if one of my statements here is not correct,
it's better to add a not needed unref in development and fix it that
release a version that leaks memory.

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


Re: how shoul I solve error "The Procedure entry Point deflateSetHeader could not be located in the Dynamic link: ...\gtk3.6.4\bin\libgio-2.0-0.dll"

2017-01-12 Thread Gabriele Greco
>
>
>
> "The Procedure entry Point deflateSetHeader could not be located in the
> Dynamic link:
> ...\gtk3.6.4\bin\libgio-2.0-0.dll".
>
>
You miss libz dll, I find useful to build win32 environment to use
"depends.exe" (http://www.dependencywalker.com/) to find similar problems.

Please note that you do not need .lib, but only dll since that's not a
direct dependency on your application.

Actually my GTK/curl win32 runtime includes the following dlls...

freebl3.dll icuuc56.dll libfontconfig-1.dll
libglib-2.0-0.dll   libjasper-1.dll libpangowin32-1.0-0.dll
libstdc++-6.dll nssdbm3.dll
icudata56.dll   libatk-1.0-0.dlllibfreetype-6.dll
libgmodule-2.0-0.dlllibjpeg-8.dll   libpixman-1-0.dll
libtasn1-6.dll  nssutil3.dll
icui18n56.dll   libcairo-2.dll  libgailutil-18.dll
 libgobject-2.0-0.dllliblzma-5.dll   libplc4.dll
libtiff-5.dll   smime3.dll
icuio56.dll libcairo-gobject-2.dll  libgcc_s_seh-1.dll
 libgpg-error6-0.dll libnspr4.dlllibplds4.dll
 libwinpthread-1.dll softokn3.dll
icule56.dll libcrypto-10.dlllibgcrypt-20.dll
 libgtk-win32-2.0-0.dll  libp11-kit-0.dlllibpng16-16.dll
libxml2-2.dll   ssl3.dll
iculx56.dll libcurl-4.dll   libgdk-win32-2.0-0.dll
 libharfbuzz-0.dll   libpango-1.0-0.dll  libsqlite3-0.dll
 libxslt-1.dll   zlib1.dll
icutest56.dll   libexpat-1.dll  libgdk_pixbuf-2.0-0.dll
libidn-11.dll   libpangocairo-1.0-0.dll libssh2-1.dll
nss3.dll
icutu56.dll libffi-6.dlllibgio-2.0-0.dll
 libintl-8.dll   libpangoft2-1.0-0.dll   libssl-10.dll
nssckbi.dll

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


[gtk-osx-users] About deprecations

2017-01-12 Thread Gabriele Greco
Every time I run my GTK+2 (2.24.X quartz built with jhbuild not more than 2
months ago) from terminal I get the following warning:

*** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on
10.7 and later. It should not be used in new applications. Use
convertRectToBacking: instead.

AFAIK the problem is in gdk/quartz/gdkscreen-quartz.c, and is present also
in current GIT (all branches), there are plans to replace this with the
suggested method or there are compatibilities issues with older OSX
versions in that way?

-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: [gtk-osx-users] About Glade

2016-11-15 Thread Gabriele Greco
Ok I did "jhbuild build glade3"...

It seems that the version of the stable module set is the 3.8.2 and it has
the problem i wrote in the previous mail with gtkosapplication,
anyway after fixing that thing the resulting binary has the same right
click problem that I have with my 3.8.5 build.

Note that right click works in other GTK2 applications so it's something
related with the way glade handle it...

Anyone has a working glade/osx? Just to know if it's something that has
been always broken or that has been broken by a recent version of gtk2 or
glade.


On Tue, Nov 15, 2016 at 5:02 PM, John Ralls <jra...@ceridwen.us> wrote:

>
> > On Nov 15, 2016, at 12:15 AM, Gabriele Greco <gabrielegr...@gmail.com>
> wrote:
> >
> > There is not a module to build glade with jhbuild isn't it?
> >
> > I built it with configure/make (after installing GTK+ OSX 2.24.x with
> jhbuild) but my build has some problems with mouse (no right click) and
> with glade this is a big problem since a few important actions are hidden
> behind the context menu.
> >
> > I also had to fix the gtkosx integration since it used the old function
> names (gtk_osxapplication instead of gtkosx_application...).
>
> Sure there is. Two, in fact: "glade" for Gtk3 and (confusingly) "glade3"
> for Gtk2. They're in gtk-osx-random.modules.
>
> Odd that right-click wouldn't work, unless Glade is doing some special
> mouse handling. It works everywhere else.
>
> Regards,
> John Ralls
>
>


-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


GTK+ 2 and prelight

2016-11-15 Thread Gabriele Greco
... still trying to build from a graphics designer mockup :)

There is a way to override the .gtkrc-2.0 file to avoid button prelight
state?

I want the some widgets (mostly toggle buttons) to keep their actual state
(normal or active) also if the cursor is on them.

It's a functional behaviour, not only aesthetics since a toggle button in
prelight state can be both active or not, but you can't see its state until
you move the mouse pointer...

Thanks in advance!

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


[gtk-osx-users] About Glade

2016-11-15 Thread Gabriele Greco
There is not a module to build glade with jhbuild isn't it?

I built it with configure/make (after installing GTK+ OSX 2.24.x with
jhbuild) but my build has some problems with mouse (no right click) and
with glade this is a big problem since a few important actions are hidden
behind the context menu.

I also had to fix the gtkosx integration since it used the old function
names (gtk_osxapplication instead of gtkosx_application...).

-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


GtkEntry placeholder in GTK2

2016-11-14 Thread Gabriele Greco
Hello,

I know GTK 3.2+ has a nice gtk_entry_set_placeholder_text() method, but I'm
wondering if there is some clever method to do something similar with GTK2,
I've not found anything googling around, but placeholder texts are a so
common interface concept today that I doubt that someone has not yet
"emulated" it in gtk2...

If no one has already done it, I think this could work:

- initialize the widget with placeholder text
- set a user data on the widget telling the text is placeholder
- set the color of the foreground text for this text widget to gray
- add a focus in event and a on change event on the widget
- if focus in and user data == placeholder, erase the text, save it in
another user data, remove the custom style from the gtkentry
- if on changed and result text empty reload the placeholder text and
switch the style
- if on changed and previous text was empty clear the placeholder text and
switch the style

I wonder if this can work... I can also build a subclass string with this
behaviour since I need this in a few different places :(

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


Re: [gtk-osx-users] Correct way to build a 10.8+ compatible GTK version with xcode8

2016-10-28 Thread Gabriele Greco
I can confirm that compling with xcode8 tools moving the deployment target
from 10.8 to 10.9, but still using 10.12 sdk, works.



On Fri, Oct 28, 2016 at 2:42 PM, Christoph Reiter <
reiter.christ...@gmail.com> wrote:

> On Fri, Oct 28, 2016 at 2:26 PM, Gabriele Greco <gabrielegr...@gmail.com>
> wrote:
> > Hi guys,
> >
> > I recently updated to 10.12 and xcode8, I've seen that this version of
> xcode
> > does not allow the use of older SDKs.
> >
> > I've tried to add a 10.8 SDK inside xcode8 bundle, extracted from xcode5,
> > and to specify in .jhbuild-custom:
> >
> > setup_sdk(target="10.8", sdk_version="10.8",
> architectures=[_default_arch])
> >
> > ... but jhbuild failed on the bootstrap stage at the first package,
> since it
> > seems that the newer clang compiler is unable to build working code with
> > older sdks...
>
> Have you updated the xcode command line tools as well?
>
> I've recently hit similar problems with 10.12 targeting 10.9 where some
> things
> no longer run on <10.12 (Python for example) and cli tools was mentioned
> multiple times for when the build itself fails.
>
> I've reverted back to 10.11 for now...
>



-- 
Bye,
 Gabry
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


[gtk-osx-users] Correct way to build a 10.8+ compatible GTK version with xcode8

2016-10-28 Thread Gabriele Greco
Hi guys,

I recently updated to 10.12 and xcode8, I've seen that this version of
xcode does not allow the use of older SDKs.

I've tried to add a 10.8 SDK inside xcode8 bundle, extracted from xcode5,
and to specify in .jhbuild-custom:

setup_sdk(target="10.8", sdk_version="10.8", architectures=[_default_arch])

... but jhbuild failed on the bootstrap stage at the first package, since
it seems that the newer clang compiler is unable to build working code with
older sdks...

So I tried to specify only target 10.8 and to compile link with the default
SDK:

setup_sdk(target="10.8", sdk_version="10.12", architectures=[_default_arch])

... I've seen simpler projects work flawlessy on older versions of OSX
simply with MACOSX_DEPLOYMENT_TARGET=10.8

... the compilation worked successfully till glib when it failed on
gobject-introspection (please note that those messages seems to be "mixed",
maybe cause they are the mixed outputs of different threads):

dyld: lazy symbol binding faileddyld: lazy symbol binding failed: Symbol
not found: _g_cocoa_notdyld: lazy symbol binding failed: Symbol not found:
_g_cocoa_notdyld: lazy symbol binding failedification_backend_get_type

nst/lib/libgio-2.0.0.dylib  Experenced from: /Users/gabry/gtk/idyld: Symbol
not found: _g_cocoaected in: flat namespace

nst/lib/libgio-2.0.0.dylib  Expdyld: Symbol not found:
_g_cocoa_notification_backend_get_type

[...]


What's the correct way to compile GTK+ to be compatible with older OSX
releases?

I have to install and use the compiler provided by an older Xcode version
(5 in this scenario)?

In that case there is a way to tell jhbuild to use the older xcode version
or I have to use xcode-select from the command line before "bootstrap"?

-- 
Bye,
 Gabry

PS: obviously I can compile without errors with target/sdk 10.12
___
Gtk-osx-users-list mailing list
Gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list


Re: final gtk+maverick battles

2014-02-14 Thread Gabriele Greco


 barely compiled gcc 4.8.2 (make install first failed, then, after
 ldconfig, it succeeded)

 The upgraded gcc doesn't seem to have an effect on my gtk+ woes. (!)
 :-((   (unless make is still using the old gcc, but I don't see an
 indication of that)

 Same /bin/sh: --: invalid option error with the git source, but with a
 cleanly unpacked tarball I get a different error :

 http://www.flight.us//misc/gtk_compile_error2.txt



Have you tried with the John Rails scripts?

GTK on MacOSX requires a few dependencies to build and those script
download them all and build them with clang default compiler without too
many issues.

https://wiki.gnome.org/action/show//Projects/GTK+/OSX/Building

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


Re: ScrolledWindow, DrawingArea, and setting step-increment

2013-11-13 Thread Gabriele Greco

 Hmm. I used to have something using that, in one of the early tests,
 but there was either a critical performance problem, or something I
 couldn't do with it. Can that handle mark-and-copy, clickable URLs,
 and so on? Or possibly it's that you say thousands there; to me,
 thousands of lines is just barely getting started. My current session


Mark  copy and clickable urls are supported in the code example I sent you.

About the thousands...

I've not done specific benchmarks but I used to keep a scrollback of 5
lines in my old powerbook 800mhz without slowdowns.


 in Gypsum has barely started and I already have 50K lines; my RosMud
 session currently has 300K lines of scrollback; and I've noted as an
 unsolvable RosMud bug that it's unacceptably slow adding the
 16,777,216th line to the buffer (because it does a naive

 I think that so many lines may be a problem for GtkTextBuffer, I mean,
they are also a problem for an editor like vim :)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: ScrolledWindow, DrawingArea, and setting step-increment

2013-11-12 Thread Gabriele Greco

 I'm developing a MUD client in Pike, using GTK2 for the UI, and
 there's an aspect of scrolling that's bugging me. The display uses
 discrete lines of text of a fixed height (or, to be more technically
 accurate, a fixed distance from the start of one line to the start of
 the next), and I'd really like the scrolling to be done in lines


I suggest you to use GtkTextView for your text output, thank to GtkTextTag
it's flexible enough to do everything a mud client needs, also blinking
text, it scrolls at line boundaries and let you keep thousands of lines of
textbuffer without slowdowns.

For an example of ANSI16 parser/output with GtkTextView using GTK2 you can
look at my own mud client ( source
http://sourceforge.net/p/ggmud/code/HEAD/tree/trunk/ggmud/ ).

I think most of the code you may be interested in is in ansi.c  window. c.

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


GTK2 + SDL2 (partial fail)

2012-12-13 Thread Gabriele Greco
I've a SDL that on linux uses a gtk2 file chooser, I've just migrated it to
SDL2 and I'm finding a strange problem connected with the initialization
order of the two libraries:

SDL_Init - gtk_init - OK

gtk_init - SDL_Init - CRASH

Here is a simple program that trigger this behaviour:

#include gtk/gtk.h
#include SDL.h

int main(int argc, char *argv[]) {
// swap SDL_Init and gtk_init to make it work
gtk_init(argc, argv);
if (SDL_Init(SDL_INIT_VIDEO )  0)  return -1;

GtkWidget *dialog = gtk_file_chooser_dialog_new (Test, NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
NULL);

if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
gchar *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER
(dialog));
fprintf(stderr, Selected %s\n, filename);
g_free (filename);
}
}

Compile it with:
gcc -g -o gtksdl gtksdl.c `pkg-config --cflags --libs gtk+-2.0 sdl2`



Here is the GDB stack trace (crashes inside gtk_dialog_run() ):

Program received signal SIGSEGV, Segmentation fault.
__pthread_mutex_lock (mutex=0x656c7974) at pthread_mutex_lock.c:50
50 pthread_mutex_lock.c: No such file or directory.
(gdb) bt
#0  __pthread_mutex_lock (mutex=0x656c7974) at pthread_mutex_lock.c:50
#1  0x00a7b94d in ?? () from /usr/lib/i386-linux-gnu/libX11.so.6
#2  0x00a96b40 in XrmQGetResource () from
/usr/lib/i386-linux-gnu/libX11.so.6
#3  0x00a72003 in XGetDefault () from /usr/lib/i386-linux-gnu/libX11.so.6
#4  0x00c4b64f in ?? () from /usr/lib/i386-linux-gnu/libcairo.so.2
#5  0x00c4d6da in ?? () from /usr/lib/i386-linux-gnu/libcairo.so.2
#6  0x00c1a8a6 in cairo_surface_get_font_options () from
/usr/lib/i386-linux-gnu/libcairo.so.2
#7  0x00bd951c in ?? () from /usr/lib/i386-linux-gnu/libcairo.so.2
#8  0x00bde00a in ?? () from /usr/lib/i386-linux-gnu/libcairo.so.2
#9  0x00bce05e in cairo_show_glyphs () from
/usr/lib/i386-linux-gnu/libcairo.so.2
#10 0x00a51141 in ?? () from /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0
#11 0x00a51494 in ?? () from /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0
#12 0x00e8e2fe in pango_renderer_draw_glyphs () from
/usr/lib/i386-linux-gnu/libpango-1.0.so.0
#13 0x00a517f4 in ?? () from /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0
#14 0x009bf4d3 in ?? () from /usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#15 0x00e8e2fe in pango_renderer_draw_glyphs () from
/usr/lib/i386-linux-gnu/libpango-1.0.so.0
#16 0x00e8e3f6 in pango_renderer_draw_glyph_item () from
/usr/lib/i386-linux-gnu/libpango-1.0.so.0
#17 0x00e8f027 in pango_renderer_draw_layout_line () from
/usr/lib/i386-linux-gnu/libpango-1.0.so.0
#18 0x00e8f1aa in pango_renderer_draw_layout () from
/usr/lib/i386-linux-gnu/libpango-1.0.so.0
#19 0x009c060b in gdk_draw_layout_with_colors () from
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#20 0x009c08b8 in gdk_draw_layout () from
/usr/lib/i386-linux-gnu/libgdk-x11-2.0.so.0
#21 0x012590bd in ?? () from
/usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/engines/libmurrine.so
#22 0x00303317 in gtk_paint_layout () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#23 0x0025ea64 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#24 0x0026b8a2 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#25 0x005a72fd in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#26 0x005a83d2 in g_closure_invoke () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#27 0x005ba70d in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#28 0x005c1ff5 in g_signal_emit_valist () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#29 0x005c2453 in g_signal_emit () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#30 0x003a5413 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#31 0x001deeb8 in gtk_container_propagate_expose () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#32 0x001deee0 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#33 0x0019f4ad in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#34 0x001dd537 in gtk_container_forall () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#35 0x001dd782 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#36 0x0026b8a2 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#37 0x005a72fd in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#38 0x005a83d2 in g_closure_invoke () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#39 0x005ba70d in ?? () from /usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#40 0x005c1ff5 in g_signal_emit_valist () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#41 0x005c2453 in g_signal_emit () from
/usr/lib/i386-linux-gnu/libgobject-2.0.so.0
#42 0x003a5413 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#43 0x001deeb8 in gtk_container_propagate_expose () from
/usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#44 0x001deee0 in ?? () from /usr/lib/i386-linux-gnu/libgtk-x11-2.0.so.0
#45 0x001a236b in ?? () from 

Re: Re: DLL Hell on Windows..

2012-08-06 Thread Gabriele Greco
 I have wondered why we use dlls on windows, we should link statically to
 the libraries.


I think the main reason is to make easier for app developer to be LGPL
compliant.

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0100980150  Fax: +39-0100980184
s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: need help with final callback

2012-07-19 Thread Gabriele Greco
Guys, I need your help with the last piece of my
 voice-by-computer program.  the appended section compiles to
 the binary xD that lets the user choose the gender,
 word-per-minute speed, delay-between-words, and pitch of th
 e voice.  Without this 'option' the user would type hello
 and hit enter, a male voice would sound thru the speakers.


I don't understand what is the object of your help request.

Your program seems to work.

Do you need to add a text entry to it so that you can write inside it and
call an external program to render the speech?

Do you want to integrate your speech system system-wide?

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


Re: GTK 2.24.10 memory leak on win32?

2012-07-03 Thread Gabriele Greco
 code (that I think is correct) do not leak in linux (ubuntu 12.04, gtk
  2.24.10) nor on win32 (GTK 2.16) while it leaks about 12kbyte/sec with
 GTK
  2.24.10 on win32.
 G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --tool=memcheck
 --num-callers=32 src/your-binary


I had already tested there was no leak in linux (same gtk version 2.24.10),
with ps hat is not that accurate in the short term, but if you let your
program run a pair of hours and both VSZ and RSS do not change I think it's
accurate enough.

Anyway I ran valgrind (without suppress file) for a pair of minutes and I
got a positive result (at least I think):

==11727== HEAP SUMMARY:
==11727== in use at exit: 320,761 bytes in 5,570 blocks
==11727==   total heap usage: 72,767 allocs, 67,197 frees, 3,161,964 bytes
allocated
==11727==
==11727== LEAK SUMMARY:
==11727==definitely lost: 0 bytes in 0 blocks
==11727==indirectly lost: 0 bytes in 0 blocks
==11727==  possibly lost: 9,848 bytes in 309 blocks
==11727==still reachable: 310,913 bytes in 5,261 blocks

... on win32 with gtk 2.24.10 (20120208 bundle from gtk.org) the program
leaks about 10kb per sec, and as I said there is no leak also on win32 with
2.16.6 (20100207 bundle from gtk.org)

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0100980150  Fax: +39-0100980184
s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK 2.24.10 memory leak on win32?

2012-07-03 Thread Gabriele Greco

 ... on win32 with gtk 2.24.10 (20120208 bundle from gtk.org) the program
 leaks about 10kb per sec, and as I said there is no leak also on win32 with
 2.16.6 (20100207 bundle from gtk.org)


Filed bug 679312 https://bugzilla.gnome.org/show_bug.cgi?id=679312

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


Re: GTK 2.24.10 memory leak on win32?

2012-07-03 Thread Gabriele Greco
Your code looks a bit strange, but I agree it should work with no
 leaks. Probably a bug.


In the real code there are 1 to X (up to 12) GdkImage(s) that are semaphore
protected and filled by h264 decoders in different threads. Once the thread
fills his  GdkImage with the frame data it uses g_idle_add() to signal the
GUI thread that the associated GdkDrawingArea has to be redraw, the idle
function simply queue the draw of the widget and the expose event locks the
gdkimage and do the real drawing.

This works quite smoothly (25fps) with twelve 352x288 video inputs on any
dual core PC .

I pulled out all the threaded logic and made an example as simple as
possible to trigger the problem, actually I could also remove the drawing
itself, but it was useful to see that the program was not hung :)

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


GTK 2.24.10 memory leak on win32?

2012-07-02 Thread Gabriele Greco
We have found a regression that block us to migrate our existing apps from
GTK 2.16.x to GTK 2.24.10 (20120208), it seems there is a memory leak in
g_idle_add() use or something related to queue_draw(), anyway the following
code (that I think is correct) do not leak in linux (ubuntu 12.04, gtk
2.24.10) nor on win32 (GTK 2.16) while it leaks about 12kbyte/sec with GTK
2.24.10 on win32.

I'm posting the code here before creating a bugzilla entry for it since I'm
not sure I can use g_idle_add to notify a new frame is available without
freeing the source, that works in linux and in older WIN32 versions and it
seems correct since g_idle_add() documentation says:

*If the function returns FALSE it is automatically removed from the list of
event sources and will not be called again.*

The (real) code is a video player with multiple realtime streams, this code
use g_timeout_add() to simulate the 25fps of the video, I fill the drawing
area with a simple red/blue pattern without thinking to much to endianness
of the pixel components, but this is a sample, the code leaks on
win32/2.24.10 also if I do not draw inside the GdkImage...

Anyway here is the code, as short as I could make it :)

#include gtk/gtk.h
#include stdint.h

double last_update;
GtkWidget *dest;
GdkImage *img;
GdkGC *gc;
int frames = 0;

int queue_draw() {
gtk_widget_queue_draw(dest);
return FALSE;
}

double get_timer() {
GTimeVal now;
g_get_current_time(now);
return  (double)now.tv_sec + ((double)now.tv_usec / 100.0f);
}

void on_expose() {
gdk_draw_image(dest-window, gc, img, 0, 0, 0, 0, img-width,
img-height);
frames++;
}

int draw_func() {
static int pos = 0;
uint32_t *ptr = (uint32_t *)img-mem;
int x, y;
for (x = 0; x  img-width; ++x) {
for (y = 0; y  pos; ++y)
ptr[x + y * img-width] = 0xff;
for (y = pos; y  pos + (img-height / 2)  y  img-height; ++y)
ptr[x + y * img-width] = 0x00ff;
for (y = pos + img-height / 2 ; y  img-height; ++y)
ptr[x + y * img-width] = 0xff;
}

g_idle_add((GSourceFunc)queue_draw, NULL);
if (++pos = img-height)
pos = 0;

return TRUE;
}


int main(int argc, char *argv[])
{
gtk_init(argc, argv);

GtkWidget *w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
dest = gtk_drawing_area_new();
gtk_container_add(GTK_CONTAINER(w), dest);
gtk_widget_set_usize(dest, 352, 288);
g_signal_connect(dest, expose-event, on_expose, NULL);
gtk_widget_set_app_paintable(w, TRUE);
gtk_widget_set_double_buffered(w, FALSE);
gtk_widget_show_all(w);
last_update = get_timer();
double secs = get_timer();
img =  gdk_image_new(GDK_IMAGE_FASTEST, gdk_visual_get_system(), 352,
288);
gc = gdk_gc_new(w-window);

g_signal_connect(w, delete-event, (GCallback)gtk_main_quit, NULL);
g_timeout_add(40, (GSourceFunc)draw_func, NULL);
gtk_main();

secs = get_timer() - secs;
g_printf(%d frames in %f seconds, %f fps\n, frames, secs,
(double)frames / secs);
}

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0100980150  Fax: +39-0100980184
s-mail: Piazza Della Vittoria 9/3 - 16121 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Can I develop gtk app in Mac OS X ?

2011-12-02 Thread Gabriele Greco


  Here is a starting point to install GTK on OSX:
 
  http://live.gnome.org/GTK%2B/OSX/

 And  It can running separately from X in OSX?


YES, the build documentation I pointed to is for the native (Quartz)
version of GTK, that works quite well (still has some minor bugs here and
there).

You can also bundle GTK libraries inside an OSX .app with the
gtk-mac-bundler.


The X11 version of GTK can be easily installed from fink or macports, but
it needs an X11 server running on your machine and it's not friendly at all
if you want to create an application you want to share with someone.

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


Re: GTK+ 2.24.8

2011-11-11 Thread Gabriele Greco
  http://download.gnome.org/sources/gtk+/2.24/
  ftp://ftp.gnome.org/pub/GNOME/sources/gtk+/2.24/
 * Win32 updates:
  Major update of the win32 backend, it now works
  at least as well as the old 2.16.x version that
  a lot of windows applications was forced to use


Anyone has a prebuilt package with all the dependencies like the 2.16 and
2.24.0 bundles available in the gtk.org website or a cross-build script to
build them through mingw32, I'd like to try my various win32 projects, all
stuck at 2.16.x, with 2.24.8 but I have no time frame at the moment to
build everything from scratch :(

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


Tooltip in GtkComboBox

2011-06-08 Thread Gabriele Greco
Is possibile to assign different tooltips to the various elements in the
GtkListStore associated to a GtkComboBox?

I've added to the model a column with the tooltip but it seems GtkComboBox
do not have the API GtkTreeView has to do
this (gtk_tree_view_set_tooltip_column), nor anything similar...

I cannot find any hint about how to do this looking at the properties of the
objects involved (GtkComboBox, GtkTreeViewColumn, GtkCellRendererText and
GtkListStore)

I obviously googled for an answer before posting, without luck...

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


g_idle_add source memory leaks

2011-05-09 Thread Gabriele Greco
If I use g_idle_add to send to my main thread that does the GTK rendering
some notifications I have to free the source handle that the function
returns to me every time or not to avoid a memory leak?

Here is a simple code example, that seems not to leak on linux (ps gives
constant resource occupation, gtk 2.22), but it seems to leak on win32 (task
manager mem usage grows, gtk 2.16):

#include gtk/gtk.h

GtkLabel *l;

int mycbk(int val)
{
char buffer[16];
sprintf(buffer, %09d, val);
gtk_label_set_text(l, buffer);
return FALSE;
}

void threadfunc(void *unused) {
int msec = 0;
while (1) {
msec++;
g_usleep(1000);
g_idle_add((GSourceFunc)mycbk, (void *)msec);
}
}

int main(int argc, char *argv[]){
GtkWidget *w;
g_thread_init(NULL);
gtk_init(argc, argv);

g_thread_create((GThreadFunc)threadfunc, NULL, TRUE, NULL);
w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
l = GTK_LABEL(gtk_label_new(-));
gtk_container_add(GTK_CONTAINER(w), GTK_WIDGET(l));
gtk_widget_show_all(w);
gtk_main();
return 0;
}


-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Horizontal TreeView?

2011-02-08 Thread Gabriele Greco
There is a way to populate a GtkTreeView so that it grows horizontally?

I want to setup cell columns so that physically they are ROWS of the
GtkTreeView and obviously in a fixed number and to make the list grow
horizontally as long as I add elements to my GtkListStore.

I've looked in the GtkTreeView documentation but I didn't find anything that
hints that this is possible (something like
gtk_tree_view_set_orientation(widget, GtkOrientation) would be optimal :) ),
but I wonder if it's possible at rc/style level since GTK already support
right/left or top/bottom writing styles maybe it also can support
left-right lists :)

Otherwise I fear I'll have to build a custom widget, or try to see if adding
widgets that rapresent my elements inside a GtkHBox within a
GtkScrollingWindow is good looking enough :)

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Horizontal TreeView?

2011-02-08 Thread Gabriele Greco
On Tue, Feb 8, 2011 at 2:55 PM, Costin Chirvasuta cost...@gmail.com wrote:

 Would GtkIconView be suitable?


It seems that GtkIconView suffers from the same problems of GtkTreeView, it
grows only vertically, it has gtk_icon_view_set_columns(), but it doesn't
have gtk_icon_view_set_rows(), so when u add items they are arranged
vertically... also if u configure your scrolling window to resize only
horizontally...

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: which gtk-win32 version to use?

2010-09-30 Thread Gabriele Greco
On Tue, Sep 28, 2010 at 2:50 PM, Manu manutm...@gmail.com wrote:



 Thanks. I have just installed gdb for mingw.


Another thing that helps to catch problems that you cannot reproduce easily
is Dr.Mingw, you can find it in the mingw-utils package. It's a crash
handler to be installed on the windows machine.

If you compile your source code with -gstabs debug symbols is able to show
you the stack trace of your program when it crashes.

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


Re: GTK deadlock in gtk_main

2010-08-04 Thread Gabriele Greco
2010/8/3 Tomas Soltys tomas.sol...@range-software.com

 All right, so at the end it was my bug :)

 Thank you all for your explanations.


Note also that part of the magic of gdk_threads_enter/leave that you can use
on unix to use gtk functions in subthreads does not work on win32 (and also
on OSX).

I had really some bad headaches trying to use it in a cross platform way
then I gave up and redesigned the application to use a lot of small idle
functions executed when needed (returning false they are executed only
once, and you can queue multiple idle functions also from different threads
in a safe way since the idle function queue is protected by a lock) from the
subthreads to update the GUI so that every GTK function is called on the
main thread. This works quite well and does not require locking at all.

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


From GdkPixbuf to GdkImage

2010-07-21 Thread Gabriele Greco
As subject says, what is the correct way to blit from a GdkPixbuf to a
GdkImage without passing through a drawable?

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


Re: From GdkPixbuf to GdkImage

2010-07-21 Thread Gabriele Greco
 On 07/21/2010 04:18 PM, Gabriele Greco wrote:
  As subject says, what is the correct way to blit from a GdkPixbuf to a
  GdkImage without passing through a drawable?
 I *know* you asked for GdkImage.
 That I do not know. My usage has been from GdkPixbuf to GtkImage -- Hope
 this
 might help...


Sadly it does not, the operation should be done in memory without any widget
affected, blitting to gtkimage probabily requires a realized widget and a
flush operation that I need to avoid.

The problem I have is that I have to update my gdkimage (allocated with the
FASTEST method) in a way that is blitted on a GtkDrawingArea at every expose
event.

Usually this gdkimage is composed with a YUV (4:2:0) - RGB conversion, but
when the video is not available I want to blit a video unavailable image
instead of the actual black image.

I can read the byte by byte the source gdkpixbuf and copy them on my
gdkimage, but this will require different code paths cause I don't know the
pixel format of the gdkimage in advance.

It's strange that GDK does not provide a method to do this since it already
provides method to blit gdkpixbufs to every other client or server type of
bitmap objects :)

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


Re: Setting a Tree View Cell to insensitive and uneditable

2010-04-19 Thread Gabriele Greco


 Is it possible to set a cell in a specific column and row to insensitive
 and uneditable and not affect the rest of the cells in the same column?


Yes, you should change your TreeModel to have two additional boolean columns
to map the sensitive and editable boolean field for your TreeViewColumn,
something like (let's get the simple case of a single editable text field):


mymodel = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN);

gtk_list_store_set(mymodel, it, 0, Editable Cell, 1, TRUE, 2, TRUE, -1);
gtk_list_store_set(mymodel, it, 0, Not editable Cell, 1, TRUE, 2, FALSE,
-1);
gtk_list_store_set(mymodel, it, 0, Insensitive Cell, 1, FALSE, 2, FALSE
/*may be also true*/, -1);

gtk_tree_view_insert_column_with_attributes(mytreeview, -1,
My column title, r, markup, 0, sensitive, 1,
editable, 2,
NULL);

I've written not the full code but just the lines that should differ from
your actual implementation :)

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


gtk_builder_add_from_file error handling

2010-01-13 Thread Gabriele Greco
I just found that with a builder file with a syntax error my app crashed
with:

*** glibc detected *** ./packager: double free or corruption (out):
0x09aa33d0 ***

I think I'm using gtkbuilder error handling in the right way and
documentation does not suggest my how to use it:

GError *err = NULL;
if (!gtk_builder_add_from_file(builder_, myfile.xml, erro)) {

}

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk_builder_add_from_file error handling

2010-01-13 Thread Gabriele Greco
Sorry last message was sent by accident pushing an hotkey while editing...

This should be the complete version of my question:


I just found that with a builder file with a syntax error my app crashed
with:

*** glibc detected *** ./packager: double free or corruption (out):
0x09aa33d0 ***

I think I'm using gtkbuilder error handling in the right way and
documentation does not suggest my how to use it:

GError *err = NULL;
if (!gtk_builder_add_from_file(builder_, myfile.xml, err)) {
   if (err) {
  cerr  builder load fail:   err-message  '\n';
  g_free(err); // commenting this solves the crash but other gtk apis
  // and examples I've found always free error handling
pointers
   }
   else
  cerr  builder load fail, unknown error\n;

   return false;
}

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


Re: gtk_builder_add_from_file error handling

2010-01-13 Thread Gabriele Greco
 GError *err = NULL;
  if (!gtk_builder_add_from_file(builder_, myfile.xml, err)) {
 if (err) {
g_free(err); // commenting this solves the crash but other gtk apis

 I don't know gtkmm, but at least in C GErrors are freed with
 g_error_free(err).


You are obviously right. I always used g_free() to free errors, my fault.
I've grepped tons of sources and I had everywhere the code bugged, then I
googled around to search some more examples and I've found there are a lot
of other sources in the net where a GError is freed with g_free, I think
improving the documentation of the functions that use a GError as input
parameter may help programmers do not write wrong code in this situation.

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


Re: gtk_builder_add_from_file error handling

2010-01-13 Thread Gabriele Greco


 The proper handling of GErrors is described in great detail in the
 GError documentation.

 I don't think it is reasonable to explain this in the documentation of
 every function that uses GError to report errors as there are almost 80
 of them just in Gtk+ (and over 400 in GLib, and many more elsewhere).


I think, and I'm used to see in almost every framework documentations, that
every time a function allocates something that the API user must free
himself the documentation should explicitly say so. Documentation should be
redundant when it may cause errors the fact it is not.

This is the case of GError and for
instance gtk_ui_manager_add_ui_from_file/string
and gtk_builder_add_from_file/string.

It's not a case that in UI toolkit debates one of the most common criticism
to GTK is the lack of documentation.

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


Re: GTK+ 2.16.6 released

2009-09-10 Thread Gabriele Greco
On Sat, Aug 29, 2009 at 4:47 PM, Matthias Clasen mcla...@redhat.com wrote:

 GTK+ 2.16.6 is now available for download at:

  ftp://ftp.gtk.org/pub/gtk/2.16/
  http://download.gnome.org/sources/gtk+/2.16/


Any chance or problem for the windows binaries on the website/ftp?

I'm too used to update my runtime using the binary bundle that Tor usually
makes available on the website :)

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


Re: GTK+ 2.16.4 released

2009-07-03 Thread Gabriele Greco
On Thu, Jul 2, 2009 at 5:28 PM, Thomas Stover tho...@wsinnovations.comwrote:


 There is some official (like Tor Win32 bundles) or unofficial OSX framework
 released or we have to build from sources?

 Building an OSX universal binary framework compatible with 10.4+ is not
 exactly easy like configure/make :)




 I have some notes from August '08 when I built gtk for osx with the x11
 back end. Let me know if you are interested. Most of the steps should be
 about the same. It was sort of funny in the sense that I have still never
 even used osx in gui mode. A friend set me up a shell account on his osx box
 on our lan, and from there via ssh and no root access, I made it all the way
 to screen shots for a presentation. I was very


Compile an X11 version or also a quartz version in the standard way it's
quite easy, the problem is that u get a ton of libraries for only one
architecture and it's really tough to fit them inside your application
bundle.

What I need are updated frameworks built like the one on www.gtk-osx.org,
that are really outdated (2.14.3).

Yesterday I've lost half of my afternoon trying to make the jhbuild scripts
used to build universal frameworks to work without luck...

The info on http://live.gnome.org/GTK%2B/OSX are not enough, neither are
some other I found googling around...

Maybe most of the problems I have are related to the fact I'm trying to
compile on 10.4.

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


Re: GTK+ 2.16.4 released

2009-07-02 Thread Gabriele Greco
On Thu, Jul 2, 2009 at 12:58 AM, Matthias Clasen mcla...@redhat.com wrote:

 GTK+ 2.16.4 is now available for download at:



About 2.16 releases:

There is some official (like Tor Win32 bundles) or unofficial OSX framework
released or we have to build from sources?

Building an OSX universal binary framework compatible with 10.4+ is not
exactly easy like configure/make :)


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


Re: latest glib and gtk for Windows?

2009-04-21 Thread Gabriele Greco
On Sun, Apr 19, 2009 at 5:53 PM, Tor Lillqvist t...@iki.fi wrote:
 I don't mean to be a pest, but when might glib 2.20.1 and gtk
 2.16.1 become available at
 http://www.gtk.org/download-windows.html ?

 Soon... Been a bit busy with other hackinh.

About this issue, I've been able to build the whole win32 GTK
environment only on WIN32 mingw since all the configure process relies
too much on pkg-config to be usable from a cross-compiler (we usually
build all of our apps on linux with the mingw crosscompiler
distributed with all the debian derived distro).

Anyone has some ./configure lines for the various
glib/cairo/pango/atk/gtk packages to crossbuild them in a clean way
without manual hacking on the generated files? :)

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


Re: latest glib and gtk for Windows?

2009-04-21 Thread Gabriele Greco
On Tue, Apr 21, 2009 at 11:16 AM, Tor Lillqvist t...@iki.fi wrote:
 Soon...

 The binaries are at the usual place
 (http://ftp.gnome.org/pub/GNOME/binaries/win32/gtk+/2.16/ etc) but the
 http://www.gtk.org/download-windows.html page has not updated,
 apparently thanks to some missing git hooks or whatever.


Thx, I'm cutting down a runtime package from the bundle.

Just a question:

In the bin directory I can safely remove every binary except:

gspawn-win32-helper-console.exe
gspawn-win32-helper.exe

... if I only need a RUNTIME package, isn't it?

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


Re: GIO channels and connection closed by foreign host on WIN32

2009-03-18 Thread Gabriele Greco
On Tue, Mar 17, 2009 at 6:59 PM, Tor Lillqvist t...@iki.fi wrote:
 (Yes, it might well be that it should be considerd a bug that one on
 Windows has to explicitly watch for G_IO_HUP in addition to G_IO_IN to
 be able to catch EOF. Please file a bug for that.

This change made the trick:

g_io_add_watch(ch, (GIOCondition) G_IO_IN|G_IO_HUP, cbk, NULL);


I filed a bug about this behaviour, 575806, I just replied here to
tell that with G_IO_HUP in the callback also the classic logic

if recv(fd) == 0 then IS DISCONNECT

works.

 The exact intended semantics of the GIOChannel API isn' clearly
 specified IMHO, and even if it was, one can say that it is more
 important that code that de facto does work on Unix should also work
 on Windows, even if strictly speaking the code would not need to work
 even on Unix according to specs... )

Why? The only real problem was the fact the cbk was void.

GIOChannel API give the user a g_io_channel_unix_get_fd() call, so I
suppose it should be supported handling the channel yourself. This is
a very important feature since there are a few network toolkit that
can be made interoperable with GTK through this feature.

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


GIO channels and connection closed by foreign host on WIN32

2009-03-17 Thread Gabriele Greco
I have a problem with the WIN32 port of a project.

I use a GIO channel to wrap the socket, I handle the socket as async
(so in case of error I check for EWOULDBLOCK/EINPROGRESS...), the
program works ok and the callback is called when there is data on the
socket.

The problem I have is that on linux if the connecton is closed from
the foreign host (ctrl + c in a shell with nc -lp 4000 in my basic
tests) the callback is called and recv() returns a 0, so I can detect
the socket is closed.

On WIN32 closing the remote host connection has no effect at all, no
callback is called. I detect the situation only if I send()
something

I thought it was a different behaviour of win32 / linux socket
implementation, so I've built a small program that uses select()
instead of GTK+ to wait for the sockets, and I get a consistent
behaviour both in win32 and linux (select trigger - FD_ISSET sock -
recv sock - returns 0).

I checked the GIO channel documentation but except for the well known
fact that polling a GSource on Win32 put the socket in async mode I
found nothing else...

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


Re: GIO channels and connection closed by foreign host on WIN32

2009-03-17 Thread Gabriele Greco
On Tue, Mar 17, 2009 at 4:26 PM, Tor Lillqvist t...@iki.fi wrote:
 Do you have a minimal but complete sample program that exhibits the problem?

 --tml


Here it is, I've made it as minimal as a crossplatform gtk socket
program can be, the code may give a pair of warnings and passes the fd
as userdata, this is to mimic the real code that passes a class base
pointer that contains also the FD and to specify that the code doesn't
use gio channels API to get FD or read/write.

It compiles both on win32 and linux, command line on linux for both builds:

Linux native:
gcc -o t test.c `pkg-config gtk+-2.0 --cflags --libs`

WIN32 cross:
/usr/i586-mingw32msvc/bin/gcc -o test.exe -gstabs
-I/usr/i586-mingw32msvc//include/glib-2.0
-I/usr/i586-mingw32msvc//lib/glib-2.0/include/
-I/usr/i586-mingw32msvc//include/cairo
-I/usr/i586-mingw32msvc//include/gtk-2.0
-I/usr/i586-mingw32msvc//include/atk-1.0
-I/usr/i586-mingw32msvc//include/pango-1.0
-I/usr/i586-mingw32msvc//lib/gtk-2.0/include -mno-cygwin
-mms-bitfields -DOOGTK_DEBUG socktest.c
-L/usr/i586-mingw32msvc//lib/gtk-2.0 -lgtk-win32-2.0 -lgdk-win32-2.0
-latk-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lpangowin32-1.0 -lgmodule-2.0
-lgobject-2.0 -lgthread-2.0 -lglib-2.0 -luser32 -lws2_32

How to reproduce:
On a linux server machine type (say with address 192.168.1.10):
nc -vlp 4000

On a client machine (if win32 you should run it from a cmd since it
does most of this output on stderr):
test 192.168.1.10 4000

Now type something in the shell where you launched netcat (hello
enter, hi enter...)

You should see the label of the gtk program update.

Last step, the one where the problem is, close netcat with CTRL+C.

If the gtk client is linux it will disconnect.
*** If the gtk client is win32 it will not receive any error ***

Test is done both on win32 and linux with GTK 2.14.x (latest version
before the 2.16 stable).

Source:

#include gtk/gtk.h
#include stdlib.h
#ifdef WIN32
#include winsock2.h
#else
#include sys/socket.h
#include netinet/in.h
#endif

GtkWidget *label;
void cbk(GIOChannel *c, int cond, int fd)
{
char buffer[1024];
int rc = recv(fd, buffer, sizeof(buffer), 0);
if (rc == 0) {
fprintf(stderr, Connection closed\n);
gtk_main_quit();
}
else if (rc  0) {
fprintf(stderr, Error handling removed!\n);
gtk_main_quit();
}
else {
fprintf(stderr, Received %d bytes\n, rc);
buffer[rc] = 0;
gtk_label_set_text(GTK_LABEL(label), buffer);
}
}
int main(int argc, char *argv[])
{
GtkWidget *w;
GIOChannel *ch;
struct sockaddr_in addr;
int fd;
if (argc != 3) {
fprintf(stderr, Use %s host port\n, argv[0]);
exit(0);
}
#ifdef WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD( 2, 0 ), wsaData) != 0) return;
#endif
gtk_init(argc, argv);
w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
label = gtk_label_new(NULL);
gtk_container_add(GTK_CONTAINER(w), label);

fd = socket(AF_INET, SOCK_STREAM, 0);
memset((void*)addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(atoi(argv[2]));
addr.sin_addr.s_addr = inet_addr(argv[1]);

if (connect(fd, (struct sockaddr *)addr, sizeof(addr))  0) {
fprintf(stderr, Error in connect to %s/%d!\n, argv[1], atoi(argv[2]));
exit(0);
}
#ifdef WIN32
ch = g_io_channel_win32_new_socket(fd);
#else
ch = g_io_channel_unix_new(fd);
#endif
g_io_add_watch(ch, G_IO_IN, cbk, fd);
gtk_widget_show_all(w);
gtk_main();
}

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


Re: GIO channels and connection closed by foreign host on WIN32

2009-03-17 Thread Gabriele Greco
 Here it is, I've made it as minimal as a crossplatform gtk socket
 program can be, the code may give a pair of warnings and passes the fd
 as userdata, this is to mimic the real code that passes a class base
 pointer that contains also the FD and to specify that the code doesn't
 use gio channels API to get FD or read/write.

BTW if this can be useful:

I've made a modified version of the program that uses GIO functions to
read datas from the server, it also sets the encoding to NULL and
buffering to FALSE since I've seen that is the right way to have a
behaviour similar to a plain recv() and it checks the return code with
G_IO_STATUS_EOF, the result is the same as the bare socket version:

In linux a ctrl+c on the server notify the client that receive
G_IO_STATUS_EOF, in windows it doesn't.

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


Re: Stop text view to scroll on pageup/down (Gabriele Greco)

2008-10-08 Thread Gabriele Greco
On Tue, Oct 7, 2008 at 4:14 PM, Garth's KidStuff
[EMAIL PROTECTED]wrote:

Thanks for the reply!

the scrolledwindow but without results:

g_signal_connect(sw, key-press-event, (GCallback)eat_pageupdown,
 NULL);

 I just asked a very similar question a few days ago on the list and Murray
 was kind enough to point out that I needed to connect my signal *before*
 the
 regular signal handler (as opposed to after, which is the default).  In
 gtkmm, this was easy as the connect function has a parameter for that very
 purpose.  I don't see how to so so here.  Sorry :(


g_signal_connect_before doesn't exists because the documentation of
g_signal_connect says:

Connects a 
GCallbackhttp://library.gnome.org/devel/gobject/2.6/gobject-Closures.html#GCallbackfunction
to a signal for a particular object.

The handler will be called before the default handler of the signal.

As far as I've seen gtkmm there is no connect_before() also there, but there
is a boolean flag after... Anyway it seems that none of the widget
involved (textview, scrolledwindow, verticalscrollbar) receive
key-press-event nor key-release-event so connecting it before or after
the default handler will not change the behaviour...

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


Stop text view to scroll on pageup/down

2008-10-06 Thread Gabriele Greco
I've assigned a global meaning to the PageUp/Down keys in a application and
I catch them with a key snooper. The keys are catched and the action
performed, but if the window contains a textview also the textview contents
are scrolled, so I tried to catch the keys in the textview, and then in
the scrolledwindow but without results:

g_signal_connect(sw, key-press-event, (GCallback)eat_pageupdown,
NULL);
g_signal_connect(tv, key-press-event, (GCallback)eat_pageupdown,
NULL);
g_signal_connect(sw, key-release-event, (GCallback)eat_pageupdown,
NULL);
g_signal_connect(tv, key-release-event, (GCallback)eat_pageupdown,
NULL);

Where eat_pageupdown is:

gboolean eat_pageupdown(GtkWidget  *widget, GdkEventKey *event, gpointer
user_data)
{
return (event-keyval == GDK_Page_Up || event-keyval == GDK_Page_Down);
}

Obviously this doesn't work... So here is my question: what is the correct
way to override the standard paging keys for a TextView?

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


Re: [semi-OT] dependencies libraries

2008-09-01 Thread Gabriele Greco
On Sun, Aug 31, 2008 at 10:46 AM, Brian J. Tarricone [EMAIL PROTECTED]wrote:

  for example: if i develop with gtk 2.12 (but i can do the same
  reasoning with any other library) how can i do to know if i used (or
  not) new functions/classes introduced on that version? (of course
  without look inside library documentation for every function/class
  that i used)

 That's pretty much the only way to do it, looking through the
 documentation.  If you really want to target a specific minimum version
 (say, 2.8), then you should develop against that version.


The autopackage project (www.autopackage.org) distributes a set of OLD gtk
headers/linklibs (I think 2.4, or 2.6 ones), suited to develop GTK+ apps
that runs on the vast majority of linux distro actually deployed.

Linking to them also remove the dependency from cairo. This is important
because if you link to a recent version of GTK (2.8+) also if you take care
to use only 2.0 apis you'll give your program an implicit dependency from
cairo.

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


Re: CellRendererToggle with custom pixbuf?

2008-08-19 Thread Gabriele Greco
On Sun, Aug 17, 2008 at 10:52 PM, Jeffrey Barish
[EMAIL PROTECTED]wrote:

 I am using a CellRendererToggle.  I would like to be able to specify
 pixbufs
 to use to draw the toggle in its two states.  Basically, I want to toggle
 between two images in a TreeView.  When I click on one image, it changes to
 the other.  Is there an easy way to do this?


I think the best way it's to make a GDK_TYPE_PIXBUF column and switch
between the two images attaching an handler to the button_press event and
using gtk_tree_view_get_path_at_pos to find if the image was clicked or
another place in the row to check if you have to switch the image in the
model or not.

I've seen that also pixbuf engine based themes do not allow to change the
aspect of the toggle buttons inside a treeview, so I fear this is the only
way to go.

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


Re: XML and treeviews

2008-07-25 Thread Gabriele Greco
 Couldn't you just add another row in the TreeStore for the closing tag?
 If root is 0 and node is 0:0, then inserting a row after node
 with parent root would be 0:1.


The problem doing it in this way is that I've to attach an handler to every
collapse/expand event and I've to show/hide a line for each of those events,
I can do it but I thought there was a cleaner solution like an attribute of
the CellRenderer to change the indent level of a given column item.


-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Getting a Column Number

2008-07-16 Thread Gabriele Greco

 How do you get the column number from a GtkTreeViewColumn pointer?  Is
 there a way to get the previous and/or next Column or column number?



Use  gtk_tree_view_get_columns() to get a GList of all the column and check
the pointer of focus_column against the GList with g_list_index(), this will
return your column number.

You can also add the column number as data to your GtkTreeViewColumn objects
with something like:

g_object_set_data(column, colnum, GINT_TO_POINTER(X))

when you create the columns...

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


Re: Using g_signal_connect in class

2008-07-15 Thread Gabriele Greco
On Tue, Jul 15, 2008 at 12:09 PM, Marco Rocco [EMAIL PROTECTED] wrote:

 Hello, this is my first post on this mailing list, now i do my request:
 can i use g_signal_connect  in a method of my class, using as c_handler a
 private function of class? ...and if i can, how i can do ?


If you use C++ and plain GTK, supposing you are initializing your callback
in the  you should do something like this:

class MyClass
{
  GtkWidget *mywidget_;
  static void handle_click_cbk(GtkWidget *mywidget_, MyClass *data) {
data-handle_click(); }

  void handle_click(); // your real callback
public:
  MyClass() {
 mywidget_ = gtk_button_new();
 g_signal_connect(mywidget_, clicked, GCallback(handle_click_cbk),
this);
  }
};

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


Trimming GTK+ win32 runtime

2008-07-09 Thread Gabriele Greco
I'm trying to trim down GTK runtime to the minimum possible.

I've read a Tor mail in this list of a month ago about this topic and
applied its suggestions.

My starting point was the bundle.

- all the documentation, all the headers, all the link libraries, all the
translations...
- all immodules except im-ime.dll (can I remove also that one?),  I've
updated the relative index file.
- the pixbuf loaders I don't use and I've updated the relative file.
- the pangoft2 dll.
- all executables in bin except gspawn-win32-*.exe
- charset.alias (was empty)

I tried also to strip the .dlls with mingw strip tool but the application
didn't run after that!

My application SEEMS to work this way, my question is this kind of trimmed
down runtime can be considered enough generic to be used on other western
languages only applications (except for the missing translations of course)

Anyway the runtime size bzipped is about 3.5mb this way.

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


Re: Forking from Gtk

2008-07-08 Thread Gabriele Greco
On Mon, Jul 7, 2008 at 11:03 PM, G Hasse [EMAIL PROTECTED] wrote:

 Hello,

 I have a small demo app. This works on FreeBSD but I can't
 get to work on Linux. I know that in Linux setsid will fail
 if the child has the same session_id as the parent. So on
 Linux you must fork twice. But it also seems that the parent
 must do an exit. And I don't want that. The code is not very
 long - so I include it here.



I think you should avoid fork and use one of the functions glib provide to
spawn processes (
http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html), or
a thread if you need to simply call a function.

In general using fork() in a GUI program is a bad idea.


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


About GTK 2.13.x window redirection

2008-05-30 Thread Gabriele Greco
I've read with much interest the new features of the unstable branch, will
the window redirection feature allow to use GTK+ to render to offscreen
bitmaps?

This will allow a quite easy GTK+ deployment on top of OpenGL, that will be
a very useful feature...

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


Re: How to make a gtktreeview column flexible?

2008-04-28 Thread Gabriele Greco

 How do i make the column always use a much space as possible but never
 more than available?



You have to call the following function:

gtk_tree_view_column_set_expand(your_column, TRUE);

Maybe you'll have also to call:

gtk_tree_view_column_set_fixed_width (column, width);

or

gtk_tree_view_column_set_expand(column, FALSE);

... for the other columns.

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: image update

2008-04-23 Thread Gabriele Greco
  I am working in images with pifbuf and gtkimage. I want draw other
  image using the composite method. The problem is when use this method
  the pifbuf don´t update well.
 
 Solved making the widget visible to false and after making the visible
 true.
 a better method?


 What is the type of widget you are rendering to?

If it's a drawing area (and I think it's the best suited one for this kind
of stuff) you should do your drawing inside an expose event handler.

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


function parameters not const

2008-04-15 Thread Gabriele Greco
There is a reason for functions like:

gtk_tree_store_iter_depth, gtk_tree_store_iter_is_valid,
gtk_list_store_iter_is_valid

[large part of all the iterator related api, mostly for GtkTreeIter type]

does not use a const GtkTreeIter * but a simple GtkTreeIter *?

In C programs is almost the same but for C++ programmers and compilers in
general specifying const where it's correct to do so will be very useful,
and AFAIK in a few API functions this has been already done (most
GtkTextIter related API have their prototypes using const where possible).

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


Re: Gtk::ProgressBar doesn't work synchronously

2008-04-09 Thread Gabriele Greco
 Start a complex task
 Create a Progress Monitor dialog and show it
 Update the dialog as the task progresses
 Destroy the dialog


Every time you update the dialog (or also more often if you can) you should
do something like:

while (gtk_events_pending())
   gtk_main_iteration();

To let GTK update the interface.

GTK runs only when you give the control to gtk_main() or if you give him
some space with gtk_main_iteration() :)

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


Re: Video overlay problem

2008-04-04 Thread Gabriele Greco
On 3/30/08, Colm Aengus Murphy [EMAIL PROTECTED] wrote:


 It looks like the video is being overlayed over all tabs.
 The only widget that it doesn't get overlayed on is a gtktextview widget.

 Any ideas on how I can ensure the video is only ever seen in its own tab ?


Add a GtkEventBox to the other tabs where the video should not be seen.

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


Re: GTK from assembly

2008-03-27 Thread Gabriele Greco
On 3/26/08, Jason Ward [EMAIL PROTECTED] wrote:

 It didn't work.
 was there something else I am supposed to do after I download this bundle.
 I
 do have the run-time installed since I installed Pidgin


Note that there is at least one version of Pidgin that installs a private
copy of GTK inside it's directory, so you cannot see it from your
application, install the full GTK+ bundle:

http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.12/gtk+-2.12.9-bundle.zip

And place your executable in the path where DLLs are.

If your assembler don't let you build executables maybe you should tell it
where to find GTK dlls or def files, I cannot tell you how to do that since
it's specific to your development enviroment, but you find all the
developers files in the package in the link.

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


Re: Quitting an application

2008-03-27 Thread Gabriele Greco

 I am writing a music library manager and I have a small problem when
 terminating the application.
 On starting the app, I scan a DB and load the tracks into a treeview.
 When this is in progress, if the user closes the application, a segfault
 occurs
 because gtk_main_quit() has been called and the scanning function tries to
 access
 data structures that are no more. How do I synchronize between them ?


Intercept the delete_event or modify the callback where you do the
gtk_main_quit() and insert there some thread sync code.

You should take care also when you add the rows to your Tree/ListStore if
you do that directly from the  thread that scans the db.

I suppose there is a thread since if there isn't one when you quit the main
loop nothing can crash it (except something you call after gtk_main()) :)

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


Re: Problem with references

2008-03-17 Thread Gabriele Greco
  After some headache with my gtk C++ classes I've found  with a small
  test program this fact about the gobject references:
 Sorry, not sure what you're trying to do.  Are you trying to do
 something with gtkmm?  Or are you creating your own bindings?


I'm doing some experimental header only bindings for an application I'm
writing, maybe I'll publish the binding once the app is finished if I find
they provide some REAL advantages over gtkmm, and IF I have the time to
cover at least a good part of the GTK api.

Actually I cover only the widgets I use in this app. I'm not using gtkmm
mostly to avoid extra dependencies.

Anyway let's talk about the problem.

Gtk owns all toplevel windows.  It already does _ref_sink() on
 GtkWindows on creation (see gtk_window_init() in gtk/gtkwindow.c).  In
 this case, if you want to keep an extra reference to 'w', you'd just
 call g_object_ref() on it.


Ok, the problem is that I expected to be able to delete those top level
windows with g_object_unref(), but it seems it's not enough, here is an
example:

int main()
{
gtk_init(NULL, NULL);

GtkWidget *w = gtk_window_new(GTK_WINDOW_TOPLEVEL);

gtk_widget_show(w);

GtkWidget *d = gtk_message_dialog_new(NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
Hello!);
gtk_dialog_run(GTK_DIALOG(d));
fprintf(stderr, After run!\n);
g_object_unref(d);
fprintf(stderr, After unref\n);

gtk_main();
}

The message dialog is still opened after the unref, if I want to get rid of
it I have to use gtk_widget_destroy() that is not what I want cause I may
not be the owner of the object.

This should be ok as well, IFF you've previously called g_object_ref()
 and thus own a reference to it.  As I said, Gtk owns the initial
 (non-floating) reference GtkWindow that you get back with
 gtk_window_new().


Adding an additional reference to the dialog don't help me close it with
g_object_unref()...

This more or less works (because non-window GtkObjects are created
 floating), but that's usually not what you'd want to do.  Again you'd
 probably want to just take a normal reference on the widget and then
 unref it when you don't need it anymore.  When you add a widget to a
 container, it will take care of ditching the floating reference and
 taking a real reference.


This is what I want and it works perfectly except for top level windows :)
With toplevel windows I'm unable to get rid of them  with the same method I
use with the other objects (g_object_unref), I can superclass it to do
gtk_widget_destroy() if I see that the object count is 2 or less (since my
reference is added to the initial one of GTK), but I'd like a cleaner way.

It's strange that if you call twice g_object_unref() the top level window
closes but you also get this kind of error:
(unknown:6412): GLib-GObject-WARNING **: instance with invalid (NULL)
class pointer

(unknown:6412): GLib-GObject-CRITICAL **: g_signal_handlers_destroy:
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

Seems like GTK wants to do something more on the dialog after I remove his
last reference!


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


Problem with references

2008-03-14 Thread Gabriele Greco
After some headache with my gtk C++ classes I've found  with a small test
program this fact about the gobject references:

Window
Creation: 1 Sink: 2 End: 1
Label
Creation: 1 Sink: 1 End: 0

It seems that window derived widgets are created with a not floating
reference, so they should be handled differently, are window classes the
only GTK objects created with a strong reference or there are also other
widgets?

The strange thing is that both GtkWindow and GtkLabel derive from
GObjectInitiallyUnowned. And that if I use:

g_object_is_floating() to avoid the additional reference on the window
object when I unref it I get:

(unknown:29976): GLib-GObject-WARNING **: instance with invalid (NULL)
class pointer

(unknown:29976): GLib-GObject-CRITICAL **: g_signal_handlers_destroy:
assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
End: -1


Here is the code (tested with GTK 2.12):

#include gtk/gtk.h

int main()
{
gtk_init(NULL, NULL);

GtkWindow *w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget *l = gtk_label_new(Test);

printf(Window\nStart: %d , G_OBJECT(w)-ref_count);
g_object_ref_sink(G_OBJECT(w));
printf(Sink: %d , ((GObject *)w)-ref_count);
g_object_unref(G_OBJECT(w));
printf(End: %d\n, ((GObject *)w)-ref_count);

printf(Label\nStart: %d , G_OBJECT(l)-ref_count);
g_object_ref_sink(G_OBJECT(l));
printf(Sink: %d , ((GObject *)l)-ref_count);
g_object_unref(G_OBJECT(l));
printf(End: %d\n, ((GObject *)l)-ref_count);
}

-- 
Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240  Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Signal prototypes

2008-02-21 Thread Gabriele Greco
Given that different signals may have different prototypes:

clicked: void (*)(GtkWidget *, void *)
keypress: gboolean (*)(GtkWidget *, GdkEvent *, void *)
delete_event: gboolean (*)(GtkWidget *, void *)
[...]

There is a way, from the signal name, to find in ADVANCE what kind of 
prototype the signal will expect?

---
Bye,
 Gabry


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


GtkBuilder, win32 signals

2008-02-13 Thread Gabriele Greco
I'm doing some tests with GtkBuilder and I've built a simple program
that open a window with a pair of buttons with a signal for each button
and it works perfectly in linux.

I've tried to crosscompile it to win32 with this command line:

i586-mingw32msvc-gcc -o main.exe main.c -mno-cygwin -mms-bitfields
-I$CROSSDIR/include/gtk-2.0/glib-2.0
-I$CROSSDIR/lib/gtk2/glib-2.0/include/ -I$CROSSDIR/include/cairo
-I$CROSSDIR/include/gtk-2.0 -I$CROSSDIR/include/atk-1.0
-I$CROSSDIR/include/pango-1.0 -I$CROSSDIR/lib/gtk-2.0/include  -s
-L$CROSSDIR/lib/gtk-2.0 -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lpango-1.0 -lpangowin32-1.0  -lgmodule-2.0
-lgobject-2.0 -lglib-2.0 -lgthread-2.0 -Wl,--export-dynamic

This is mostly the line I use in our production enviroment, the program
compile and link, but complains about missing signal handlers when I call:
gtk_builder_connect_signals (b, NULL);

I'm wondering if the gmodule inspecting feature to link the handlers
is broken in win32 or if I have to add some more flag (gmodule-2.0.pc of
the win32 dev archive doesn't show anything relevant...) and
g_module_supported() returns true!

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


Re: GtkBuilder, win32 signals

2008-02-13 Thread Gabriele Greco
On 2/13/08, Tor Lillqvist [EMAIL PROTECTED] wrote:

   I'm wondering if the gmodule inspecting feature to link the handlers
   is broken in win32 or if I have to add some more flag

 I quote the documentation for gtk_builder_connect_signals() in trunk:

 * When compiling applications for Windows, you must declare signal
 callbacks
 * with G_MODULE_EXPORT, or they will not be put in the symbol table.
 * On Linux and Unices, this is not necessary; applications should instead
 * be compiled with the -Wl,--export-dynamic CFLAGS, and linked against
 * gmodule-export-2.0.

 I.e. define your callback functions like this:

 G_MODULE_EXPORT int
 foobar (...)
 {
 ...
 }


That works perfectly thanks, I'm replying to the list just because this is
not available in the stable documentation in gtk.org and maybe someone
else has interest on this topic.

Nice addon this GtkBuilder BTW :)

I think I'll try to move on the development of our applications from the
built in code generation to this, the fact that doesn't need an external
library and that connects signals is a big plus over the libglade approach.

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


Change interface font in a GTK application at runtime without reopening windows

2007-12-12 Thread Gabriele Greco
A lot of users are asking me for the capability to change the font of an
  application runtime.

I know that the correct answer should be change your gtk theme or edit
the application RC file, but while this kind of answer is good with
power users, normal users often want to be able to grab a font from a
list and quickly try it on the REAL application interface without the
need of a restart.

I know that I can change the font of a single widget with
gtk_widget_modify_font(), and that I can change the font of EVERY future
widget with something like:


gtk_rc_parse_string(gtk-font-name=\sans 13\\n);

But what if I want to change the font of the actual interface without
having to close all the application window and open them again?

I'm quite sure it's possible since I've seen a few apps doing it. Sadly
I don't remember the apps, otherwise I'd go peek at their sources :)

I think there should be cleaner way that a full iteration on the widget
tree of every window and a gtk_widget_modify_font() Call on each widget,
isn't it? :)

Bye,
  Gabry


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


Re: Multiple threads and gtk_main()

2007-07-11 Thread Gabriele Greco
Eduardo M KALINOWSKI wrote:
 Make your threads add stuff to a single GAsyncQueue. Let an idle 
 function (or a timeout function) always run, that checks the GAsyncQueue 
 and does something if there is something to do, or simply returns if it 
 is empty. Wouldn't that work?
   
Yes, but that would be polling, and polling is what I'm trying to avoid.

--
Bye,
 Gabry

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


Multiple threads and gtk_main()

2007-07-10 Thread Gabriele Greco
I've a few threads (more than one) doing some work (not accessing GTK 
functions), I'd like to have a general way to make them notify their 
work to the main loop.

I used the g_idle_add() in the previous context where I had only a 
thread with this behaviour, but with two or more threads the 
g_idle_add() method of notification is not correct IMHO (what happens if 
  two threads call g_idle_add() before the call of the first one is 
processed by the glib main loop?)

I thought about a mutex solution, something like this:

thread X:
lock idle_mutex
g_idle_add(my_idle_func)

my_idle_func:
unlock idle_mutex
[update the gui]
return FALSE

This way should work but when I use mutexes in context I've not full 
control on I always fear unhandled deadlock situations...

I though about using a GAsyncQueue for every thread but in this way the 
problem I have is how to notify the main loop that there is something on 
a queue, I've not found anything in the documentation... I fear the only 
  way it's to use a pipe or a socket, or an idle function, but in this 
case I will occur again in the locking problem, I hope I'm wrong about 
this so I'm asking here :)

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


Fast animation prototype code

2007-07-09 Thread Gabriele Greco
I've wrote this example code and it seems to work properly both on Linux 
and Win32, I'm wandering if some GTK guru has some suggestions to 
improve it, obviously it's only an example, but this will be the 
structure that will be included in the application, the thread that 
build the image will be an h263 decoder that get the video through the 
net, this is why the simple image creation of the demo is made in a 
separate thread. It works without changes both in win32/linux and uses 
5/10% of CPU of pretty old machines.


I'm wandering what happens if I set an idle_function with g_idle_add() 
while the previous idle cbk has not yet completed (the coherence of the 
image is not a problem because I already plan to use a SpinBuffer for it 
in the real app).


I'm wandering also if it's better to use gdk_flush() when I draw a frame 
or it's also safe/fast to do gtk_widget_queue_redraw() for the drawing

area widget...

Compile with:

gcc -o test gtkview.c `pkg-config gtk+-2.0 --cflags --libs` `pkg-config 
gthread-2.0 --cflags --libs`


--
Bye,
 Gabry

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

Re: [SPAM] Fast animation prototype code

2007-07-09 Thread Gabriele Greco
Gabriele Greco wrote:

The source file as attach was cutted,  I'm pasting it inline, it's short :)
 I've wrote this example code and it seems to work properly both on 
 Linux and Win32, I'm wandering if some GTK guru has some suggestions 
 to improve it, obviously it's only an example, but this will be the 
 structure that will be included in the application, the thread that 
 build the image will be an h263 decoder that get the video through the 
 net, this is why the simple image creation of the demo is made in a 
 separate thread. It works without changes both in win32/linux and uses 
 5/10% of CPU of pretty old machines.

 I'm wandering what happens if I set an idle_function with g_idle_add() 
 while the previous idle cbk has not yet completed (the coherence of 
 the image is not a problem because I already plan to use a SpinBuffer 
 for it in the real app).

 I'm wandering also if it's better to use gdk_flush() when I draw a 
 frame or it's also safe/fast to do gtk_widget_queue_redraw() for the 
 drawing
 area widget...

 Compile with:

 gcc -o test gtkview.c `pkg-config gtk+-2.0 --cflags --libs` 
 `pkg-config gthread-2.0 --cflags --libs`
#include gtk/gtk.h
#include stdlib.h

GtkWidget *label;
GdkGC *mygc;
GdkDrawable *mydest;

gboolean blit_fast(GdkImage *img)
{
static int frames = 0;
static time_t timer = 0;

gdk_draw_image(mydest, mygc, img, 0, 0, 0, 0, img-width, img-height);
gdk_flush();

if ((frames % 100) == 0) {
time_t newtime = time(NULL);

if (timer != 0) {
char buffer[80];
newtime -= timer;

if (newtime != 0) {
sprintf(buffer, Frames: %d time: %d, %d fps, frames, 
newtime, frames / newtime);
gtk_label_set(GTK_LABEL(label), buffer);
}
}
else
timer = newtime;
}

frames++;

return FALSE;
}

void *myloop(GdkImage *img)
{
static int pos = 0;
int i, j;
GTimer *t = g_timer_new();
gdouble needed = 0.0f;
g_timer_start(t);

for(;;) {
unsigned long *ptr = img-mem;

for (j = 0; j  img-height; ++j) {
for (i = 0; i  img-width; ++i) {
if (i  pos || i  (pos + 100))
*ptr = 0;
else {
*ptr = 0xff;
}
ptr++;
}
}
pos ++;
if (pos == 640)
pos = -99;

while (g_timer_elapsed(t, NULL)  needed)
g_usleep(1);

g_idle_add(blit_fast, img);
needed += 0.040;
}
}


int main(int argc, char *argv[])
{
gtk_init(argc, argv);
g_thread_init(NULL);

GdkVisual *vis = gdk_visual_get_system ();

GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget *box = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(win), box);
GtkWidget *area = gtk_drawing_area_new();
gtk_widget_set_usize(area, 640, 480);
gtk_box_pack_start_defaults(GTK_BOX(box), area);
label = gtk_label_new(--- fps);
gtk_box_pack_end_defaults(GTK_BOX(box), label);

gtk_widget_set_app_paintable(area, TRUE);
//gtk_widget_set_double_buffered(win, FALSE);
gtk_widget_set_double_buffered(area, FALSE);

gtk_signal_connect(GTK_OBJECT(win), destroy,
GTK_SIGNAL_FUNC(exit), (void *)0);

GdkImage *img = gdk_image_new(GDK_IMAGE_FASTEST, vis, 640, 480);

printf(Img- %dx%d depth:%d bpp:%d bpl:%d\n, img-width, img-height,
img-depth, img-bpp, img-bpl);

if (img-bpp != 4) // actually only 32bit support since it's a test
return -1;

gtk_widget_show_all(win);

mygc = gdk_gc_new(area-window);
mydest = area-window;

g_thread_create(myloop, img, FALSE, NULL);

gtk_main();
}

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


Simple video playing with SDL

2007-07-06 Thread Gabriele Greco
Someone can point me some code that does video playback using *only* GTK?

If the code is not available also some directions will be enough:

- What kind of widget to use? (GtkDrawingArea, GtkImage...)
- How to handle double buffering? (perform a queue_draw after each frame
update?)
- How to blit efficiently my data (what pixel format is best suited, I
have to use my yuv - rgb conversion code? RGB24? ARGB? RGBA?)
- It's SDL blit architecture optimized enough for video playing?

I don't need big performance, I've a small 352x288 10fps stream, my
actual solution is using SDL on a GtkDrawingArea with the SDL_WINDOWID
hack. It works both on win32 and linux, but I'd like a cleaner
architecture

-- 
Bye,
  Gabry

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


Re: [SPAM] Simple video playing with SDL [- WITHOUT SDL]

2007-07-06 Thread Gabriele Greco
Gabriele Greco wrote:

Just correcting the title of my previous post, obviously I intended 
WITHOUT SDL or any external library (except the one I use to decode the 
stream :) ).
 Someone can point me some code that does video playback using *only* GTK?

 If the code is not available also some directions will be enough:

 - What kind of widget to use? (GtkDrawingArea, GtkImage...)
 - How to handle double buffering? (perform a queue_draw after each frame
 update?)
 - How to blit efficiently my data (what pixel format is best suited, I
 have to use my yuv - rgb conversion code? RGB24? ARGB? RGBA?)
 - It's SDL blit architecture optimized enough for video playing?

 I don't need big performance, I've a small 352x288 10fps stream, my
 actual solution is using SDL on a GtkDrawingArea with the SDL_WINDOWID
 hack. It works both on win32 and linux, but I'd like a cleaner
 architecture
   
Bye,
 Gabry


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


Re: [SPAM] cross compiling and ld auto-import errors

2007-06-07 Thread Gabriele Greco
Bethany Seeger wrote:
 From what I've read, I need to force (external) constants to be
 variables, but I'm not sure how I can do that when the errors are coming
 from the glib library, underneath Gtk/Gdk.  (or declare them explicitly
 with __declspec(dllimport)).  

 I'm relatively new to cross-compiling, so I'm a little baffled as to
 where to go with this. 
   
If this can be of any use when I crosscompile I don't link directly with 
the DLLs but with the import files provided in the gtk-*-dev archives:

In my makefile I have this (I've a win32 target that uses CROSSDIR, 
CROSSCXX, CROSSLIBS instead of the standard ones):

CROSSLIBS = -L$(CROSSDIR)/lib/gtk-2.0 -mwindows -mno-cygwin \
 -mms-bitfields -lgtk-win32-2.0.dll -lgdk-win32-2.0.dll -\
 -latk-1.0.dll -lgdk_pixbuf-2.0.dll -lpango-1.0.dll 
-lpangowin32-1.0.dll \
 -lgmodule-2.0.dll -lgobject-2.0.dll -lglib-2.0.dll 
-lgthread-2.0.dll \
 -lstdc++ -luser32 -lws2_32 -lexpat -ljpeg

ls /usr/i586-mingw32msvc/lib/gtk-2.0/
lib libgdk_pixbuf-2.0.dll.a  libgmodule-2.0.dll.a  
libgtk-win32-2.0.dll.a   libpangoft2-1.0.dll.a
libatk-1.0.dll.alibglib-2.0.dll.alibgobject-2.0.dll.a  
libpango-1.0.dll.a   libpangowin32-1.0.dll.a
libgdk-win32-2.0.dll.a  libglib.dll.alibgthread-2.0.dll.a  
libpangocairo-1.0.dll.a


--
Bye,
 Gabry

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


Re: [SPAM] Re: cross compiling and ld auto-import errors

2007-06-07 Thread Gabriele Greco
Tor Lillqvist wrote:
 I would leave out the .dll here to avoid risking confusion. (Somebody
 might think you are referring to the dll files themselves here.) The
 Win32-targeted linker looks for also libfoo.dll.a, not just libfoo.a
 when it encounters -lfoo. At least natively, presumably also when
 cross-compiling.
   
Yes, just tried it and it works also without the DLL :) (at least with 
the mingw version packaged in the debian 4+).

---
Bye,
 Gabry


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


g_idle_add and thread safety

2007-06-06 Thread Gabriele Greco
I know GTK APIs are not thread safe, I've an app with a thread doing a 
massive job that wants to update the gui status every few cycles, to do 
so I remembered an old post speaking about g_idle_add.

The question I have and which I didn't find answers both googling, both 
looking at the sources is if g_idle_add can be called without any extra 
mutex/lock from another thread.

- I have to use gdk_threads_init() mechanism?
- I have to use gdk_threads_enter/leave() around gtk_main() and around 
the g_idle_add call?
- If so, if I use the gdk_threads_idle_add() facility I can avoid all 
the locks or I have to lock around gtk_main anyway? (the example doesn't 
clarify this)

Ideally my code should be something like:

static progress_datas;

gint myfunc(vod *unused)
{
gtk_label_set_text(blablabla, progress_data);

return FALSE; // call only once
}

work_thread() {
while(1) {
loops++;
[... do the real work ...]
if ((loops % 1000) == 0) {
update_progress_datas();
g_idle_add(myfunc, NULL);
}
}
}

int main()
{
[..gui init and thread start]
gtk_main()
}
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: [SPAM] Re: How to create a self contained GTK+ Application for Linux

2007-05-23 Thread Gabriele Greco
Michael Ekstrand wrote:
 You might want to take a look at what the autopackage folks are doing.
 At the very least, they have a lot of documentation on what's required
 to prepare relocatable, portable binary packages.
   
Anyway the GTK hardcoded path are not a good thing IMHO. With some care 
and the use of -rpath linker option and LD_LIBRARY_PATH you can ship 
linux binaries using a wide library range.

I've shipped a commercial game with ogre, cegui, sdl, devil, boost, 
libjpeg/png/tiff, libstdc++ and other stuff, but the installer (loki) 
that use GTK, should stay compatibile with gtk 2.0.x and gtk 1.2.x 
(there are two versions) cause there is no reliable way to ship gtk 
statically linked or in a particular path (for the installer for 
instance a CDROM relative path).

Having relative paths in the gtk core libraries what problem could 
cause? In windows paths are relative so I suppose this could work also 
on linux, maybe there will be some rework in the autoconf/make scripts 
at most :)

Eg make libgtk-2.0.so try to load:

./gtk-2.0/2.10.0/loaders/libpixbufloader-gif.so

Instead of: /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-gif.so

Bye,
 Gabry

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


  1   2   >