TileGTK is C extension that implements a Ttk theme, using GTK+ 2.x for
drawing. It requires Tk >= 8.5.3 for the time being.
Where to find TileGTK
=======================================
Here:
http://www.ellogon.org/petasis/index.php?option=com_content&task=view&id=29&Itemid=45
Changes since previous version
=======================================
1) Various optimizations of the build system.
2) Ability to not link with GTK+ 2.x libraries, and load GTK+
dynamically on package loading from Tcl.
License
=======================================
TileGTK sources are BSD. GTK+ though is LGPL. So, binaries are also
LGPL.
Screenshots
=======================================
Fedora 9 - Nodoka style:
http://www.ellogon.org/~petasis/tcl/tile-gtk-dev-0.3.png
http://www.ellogon.org/~petasis/tcl/tile-gtk-dev-0.3-2.png
Vista 64 - Raleigh style:
http://www.ellogon.org/~petasis/tcl/tile-gtk-dev-0.3-win.png
George
Hi George,
I just tried the binary package with a kbskit-8.5.3. Switching to
TileGTK was easy with a few text editing windows. But when opening new
windows with scrollbars, it complains about values like '0,6543' being
no floats, which in return is right. These values should use a period
for decimal fractions.
Shin
Yes, I have seen it also. This is bug in tile of 8.5. It also happens in
my fedora 9 installation. Its not related to TileGTK, as TileGTK has
nothing to do with the widget functionality. It only deals with widget
drawing. Can you please submit a bug in Tk's SF bug tracker about this?
I think that this also affects comboboxes.
George
Also, can you please report the operating system under which you have
tested the binary, the binary version (i.e. was a nogtk one?) and the
GTK style the theme picked in your system?
George
Hi,
My system is Ubuntu 8.04 with a 2.6.24-18-generic kernel and I tried
your package 0.2 nogtk. But I also get the same error with all of your
binary versions, ending in a program crash.
To me this looks like a dependency on the Locale. I'm in Germany,
where decimal fractions are separated with commata in deed.
Shin
What do you mean with program crash?
When does TileGTK crashes? On loading it, while using it or during Tcl
exit? Does it locates GTK correctly in your system? (It prints messages
in stdout - in your terminal). Can you post what TileGTK prints in the
terminal?
Finally, regarding the scrollbar problem, it is a locale issue.
George
...
> > To me this looks like a dependency on the Locale. I'm in Germany,
> > where decimal fractions are separated with commata in deed.
>
> > Shin
>
> What do you mean with program crash?
Hi George,
it crashes, when returning from Tcl/Tk's error dialog, which came up
because of (un)float values. The corresponding console trace is...
-------- 8>< --------------------------
* Locating: gdk
++ /usr/lib/libgdk-x11-2.0.so
* Locating: gdk_pixbuf
++ /usr/lib/libgdk_pixbuf-2.0.so
* Locating: glib
++ /usr/lib/libglib-2.0.so
* Locating: gobject
++ /usr/lib/libgobject-2.0.so
* Locating: gtk
++ /usr/lib/libgtk-x11-2.0.so
* Locating: gdk_pixbuf_xlib
++ /usr/lib/libgdk_pixbuf_xlib-2.0.so
The program 'kbskit' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 4761 error_code 3 request_code 15 minor_code 0)
(Note to programmers: normally, X errors are reported
asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error()
function.)
-------- 8>< --------------------------
This looks like the crash is a consequence to an X error, which was
caused by a wrong parameter format.
Shin
Is it possible to send a small script that reproduces the problem?
I need to see which window causes the problem :-)
George
Hi George,
I can reproduce this error as follows, using kbskit-8.5.3 inside of a
starkit directory. This directory contains tilegtk's library package
in ../lib . Then doing these commands...
-------- 8>< ---------------------
# Initialize the starkit and make the package tilegtk available
package require starkit
catch {::starkit::startup}
# Loading packages
package require Tk
package require Ttk
# Replacing all widget commands with their ttk equivalents
namespace eval ::ttk {namespace export *}
namepace import ::ttk::*
# Switching theme...
::ttk::setTheme tilegtk
*Crash*
-------- 8>< ---------------------
I believe this license carry-over is true of v0.1 where you had to
link in the GTK libs, but when you dynamically load them from your own
compiled extension, you are not tainted to LGPL. Then again, IANAL.
Jeff
I am still using glib to load the other GTK libraries, which is also
LGPL. If I can use the Tcl facilities, then it will be BSD. But
currently, the API does not allow to load and library and look the
symbols into it...
George
Is kbskit-8.5.3 somewhere available for download?
I cannot reproduce the problem under ActiveTcl 8.5.2.
Instead, I get an error during namespace import ::ttk::*.
George
Hi George,
I compiled it like described on the Tcler's Wiki at:
It took me an Hour on a Celeron-M@2GHz. If you like, I can send you a
copy of the resulting binary per eMail. It runs on Linux Kernels 2.4
and 2.6.
Shin
Dear Shin,
Yes please send me your binary.
Also, can you please test with this:
http://www.ellogon.org/~petasis/tcl/tilegtk0.2-linux32-nogtk-debug.tar.gz
This is a debug binary of tilegtk 0.2, which:
1) Sets X resynchronization to true
2) Unregisters the XError handler registered by GTK, and applies back
the Tk's one. I hope Tk's one does not terminate the application.
I haven't managed to verify the new facilities, as there is no way to
get an XError in my system. Can you please try this inside gdb, and send
me the trace?
(Just type where when you get the xerror)
George
Please download from http://tcltalk.ath.cx/files/kbsbin/kbskit-8.5.3
> Also, can you please test with this:
>
> http://www.ellogon.org/~petasis/tcl/tilegtk0.2-linux32-nogtk-debug.ta...
>
> This is a debug binary of tilegtk 0.2, which:
>
> 1) Sets X resynchronization to true
>
> 2) Unregisters the XError handler registered by GTK, and applies back
> the Tk's one. I hope Tk's one does not terminate the application.
>
> I haven't managed to verify the new facilities, as there is no way to
> get an XError in my system. Can you please try this inside gdb, and send
> me the trace?
> (Just type where when you get the xerror)
>
Yes, I'll have a look at it tonight.
Shin
Ability to change GTK+ style on the fly!
http://www.ellogon.org/~petasis/tcl/tile-gtk-dev-0.6.png
For the time being, the whole Tk application has a single (global)
style, as this is a limitation of GTK+ (I think).
This means, that is not like TileQt that can have a different style per
interpreter :-(
George
I've just used your latest 0.2 and it doesn't crash anymore. I still
cannot use scrollbars. The error says:
Expected floating-point number but got "0,04"
when I try to move the slider.
When switching back to another tile theme, this error remains and I
have to quit the application.
Shin
The scrollbar error is not happening if you don't use TileGTK?
It starts happening after you load TileGTK? Can you please check this?
Also, has any XError been printed on the terminal by the TileGTK XError
handler?
George
George Petasis schrieb:
...
>
> The scrollbar error is not happening if you don't use TileGTK?
> It starts happening after you load TileGTK? Can you please check this?
This only happens, when switching to "tilegtk" and remains then, no
matter which other theme I choose. If I switch to another theme at
first, everything is ok. The "float" error comes up and stays only
after switching to tilegtk.
> Also, has any XError been printed on the terminal by the TileGTK XError
> handler?
I switched to tilegtk and then tried to open a window with 3
scrollbars and then the console log looks like:
* Locating: gdk
++ /usr/lib/libgdk-x11-2.0.so
* Locating: gdk_pixbuf
++ /usr/lib/libgdk_pixbuf-2.0.so
* Locating: glib
++ /usr/lib/libglib-2.0.so
* Locating: gobject
++ /usr/lib/libgobject-2.0.so
* Locating: gtk
++ /usr/lib/libgtk-x11-2.0.so
* Locating: gdk_pixbuf_xlib
++ /usr/lib/libgdk_pixbuf_xlib-2.0.so
bgerror failed to handle background error.
Original error: expected floating-point number but got "0,192308"
Error in bgerror: invoked "break" outside of a loop
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
bgerror failed to handle background error.
Original error: expected floating-point number but got "0,294118"
Error in bgerror: invoked "break" outside of a loop
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
bgerror failed to handle background error.
Original error: expected floating-point number but got "0,3125"
Error in bgerror: invoked "break" outside of a loop
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
===============================================================
TileGtk_XErrorHandler:
error_code = BadWindow (invalid Window parameter) (3)
request_code = 15
minor_code = 0
===============================================================
Shin
>
> George
The error is caused by GTK+ changing the application locale.
I think I have fixed it.
But the bug remains: Ttk should not assume that real numbers are always
separated by the "." character.
George
Thank you very much for your bug report. The error seems to be caused by
a call to X_QueryTree (15). Now I have to find where do I call this :-)
George
I agree! - Formatting and accepting floating point numbers should
follow the rules of the Locale.
Shin
localised float interpretation should be limited to user input?
EIAS has teeth to nick with.
uwe
Yes, but what if (not too far) releases of linux distributions impose a
different locale than C? Why not dealing with the problem now?
And I really do not understand how this is causing problems in Ttk. This
problem means that somewhere in the ttk code, a double is written to a
string with something like printf (and thus is written with the user
locale, which may use "," instead of ".") and then parsed again by tk.
Why use this "printf" in the original code?
I think we should fix this... We cannot depend that the user has not
changed the "C" locale in the environment...
George
Michael
Actually its not GTK changing the locale. The locale of my environment
is not "C", but localised to my country by default. Everything in the
distribution (including kernel messages) are localised.
Its tcl that does not follow this locale. GTK changes the locale in its
init function, so all gtk apps get the correct locale.
George
I don't mean the level of source code, but the interpreter's internal
level of communication with different modules of the integrating
environment.
Shin
How did you wrap the gtk stuff? Swig?
lets look at floats:
tcl thinks this is a float : 1234.567
english localisation 1234.567 but also 1,234.567
german localisation 1234,567 but also 1.234,567
a compiled c programm does localisation twice : parsing input, formatting output.
Further internal handling of floats does not involve localisation at all.
tcl under EIAS does this at every step again and again.
if you distribute some tcl script that defines float values like
set pi 3.14159265358979
this will break if it is sourced under any other localisation than C or en_* ..
would this require "localisation namespaces" ?
loc eval C {
set pi 3.14159265358979
set niceprice 44.11
}
set niceprice 44,11
loc eval de_DE { format %f $niceprice }
This is a can of worms.
uwe
This is most likely caused by something in glib or gtk+
calling setlocale() behind your back. Tcl requires that
the LC_NUMERIC category be set to "C", otherwise many things
will not work properly.
(Tcl itself handles this better in 8.5, but many extensions --
Tk in particular -- still use things like sprintf("%g") and
strtod() to generate string reps of doubles in many places,
which are locale-dependent.)
--Joe English
After some days of inactivity (due to local national holidays), a small
update: the button layout/drawing code has been re-worked to mimic as
much as possible the GTK+ drawing code. This means that TileGTK uses the
exact same code as GTK+ to draw buttons...
This means that TileGTK no longer uses the default ttk focus rectangle
on all buttons, but focus can be internal/external and drawn by the theme.
The screenshot is here:
http://www.ellogon.org/~petasis/tcl/tile-gtk-dev-0.7.png
George
Also the code now seems to behave reasonably under windows! Only minor
problems with notebook tabs under xp style...
http://www.ellogon.org/~petasis/tcl/tile-gtk-dev-0.7-win.png
George