Version 11 of GTK Stardust-like theme for Ttk widgets?

Updated 2009-01-28 22:14:42 by wjg

D. McC 2009 Jan 25: Some people actually seem to prefer the GTK2 look to anything you can get with Tk, even in 8.5. I don't for the most part, but I've got to admit I've never seen anything in Tk that looks as cool as the bubbly blue buttons and bars of the GTK2 Stardust theme. I've tried gnocl, which picked up on the Stardust theme right away—but, at least on first impression, I am not too favorably impressed by gnocl's functionality or ease of use compared to Tk. So ... I was just wondering whether anyone has developed, or is developing, or might conceivably develop, a Stardust-like theme for the easy-to-use and highly functional Ttk widgets. Yes? Please?!


NEM 2009-01-26: You could try TileGTK.

D. McC 2009 Jan 28: No, I couldn't, until I see some documentation explaining how to use it. I downloaded the TileGTK 0.2 tarball and all I got was one shared object, a package index, and one Tcl script, no documentation. I don't see any documentation online, either. Am I missing something?

NEM Fair enough. I'll add an example to the TileGTK page to show you how to use it.


WJG (26-Jan-09) On your comments on Gnocl. Its good to hear that you are favorably (thought not excessively) impressed by Gnocl functionality. Gnocl is not a Tk look-alike. As it implements a Gtk/Gnome interface inevitably commands and options will reflect those Gtk library calls they provide access to, something which will cause some surprises for those committed to Tk. In terms of ease of use, its just as easy or difficult as any other Tcl package. Gnocl is a complex package, sure, and takes some time to adjust to, just like Tk. But, of course, it is totally Gtk+ compliant.

D. McC 2009 Jan 28: I'm favorably impressed by some of gnocl's functionality. I can get used to the rather different geometry management. I can live with the less exhaustive documentation, as long as it gives me at least some hint of how to do things. One thing I can't live with, though, is a three-line text widget that won't let me specify a different size! When I try, I get an error message saying "-height" and "-width" aren't valid configuration options for a gnocl text widget. When I look at the documentation, I draw a blank about how to tell a text widget how big to be. If you, or anyone, can tell me how to do this, I'll give gnocl a more thorough look. If not, I won't, because I need a text widget about 20 lines high, not three lines, for a project I'm working on (right now employing easy-to-use, highly functional, and well-documented Tk and Ttk widgets).

WJG (29-Jan-09) The 0.9.92 / 0.9.93 releases don't have sizing options for the text widget. But, if you add the following 2 lines to the list of textOptions in text.c of the sourcecode and recompile, you will be able to request a default size for the container which holds the GtkTextView widget. Then, of course, re-compile and reinstall Gnocl. The requested height will be in pixels.

        { "-heightRequest", GNOCL_INT, "height-request" },
        { "-widthRequest", GNOCL_INT, "width-request" },

 The follow example code demonstrates the feature that you're looking for, ie a 20 lines high widget.

 #!/bin/sh
 # the next line restarts using tclsh \
 exec tclsh "$0" "$@"

 package require Gnocl

 # create a new window and add widgets
 set box1 [gnocl::box -orientation vertical]
 set lab1 [gnocl::label -text "Some Stuff Goes Here!"]
 set lab2 [gnocl::label -text "More Stuff Goes Here!"]
 set txt2 [gnocl::text \
        -font { sans 10 } \
         -scrollbar always \
        -heightRequest 300 \
        -widthRequest 300]

 for {set i 0} {$i < 20} {incr i} {
        $txt2 insert end "$i\n"
 }

 $box1 add $lab1 -fill {1 0}
 $box1 add $txt2 -fill {1 1}  -expand 1
 $box1 add $lab2 -fill {1 0}

 # window is set six, and not re-sizable
 set win2 [gnocl::window \
         -title {Test Window} \
        -child $box1 \
        -defaultHeight 400 \
        -defaultWidth 500 \
        -resizable 0 \
        -onDelete { exit }
        ]

 gnocl::mainLoop