From: Sean Woods on 10 Mar 2010 05:14 On Mar 4, 9:11 pm, Zhang Weiwu <zhangweiwu+J...(a)realss.com> wrote: > Hello. I am a developer who occasionally work out some tcl/tk projects > with cross-platform deployment in mind. In a recent project there is a > need for simple ready-run-off (or "portable") desktop application that I > intend to do with tcl/tk. The user interface logic is really simple, so > does the underlying database, but a high level of nice-looking is > needed, as it is part of the VI strategy. I want to apply my tcl/tk > skill but had the impression that most of the tk have application in > mind but less flexible on the look. > > Although this topic had been discussed many a time, but most of the > discussion seems focusing on how to make tcl/tk generally appears good > (widget work), or to make it work with the same look and feel as its > windowing system. example of such discussion are here: > > http://wiki.tcl.tk/8646[What applications written in Tcl/Tk look really > good?] > > http://wiki.tcl.tk/8646[Tk widgets look fine under Windows] > > They are not what I look for. I intend to know if I can customize it for > a particular VI requirement on only one application. My goal is a user > interface as different to its windowing system (be it X, Mac OS or > Windows) as this one: > > http://johnbokma.com/mexit/2007/01/05/nero-startsmart-burn-image-to-d... > > How do you think? As I am planning, do you think this is a huge work, or > very simple? Looking at your example, it would be reasonably straightforward to build it on the canvas, with the occasional TTK widget thrown in for combobox selectors, buttons, etc. The advantage for you is mainly that the interface can appear whimsical and unique to the user, but the back end would not be unfamiliar to any Tcl/Tk developer. I use the canvas to display the layout of a ship, it's systems, and the crew running around keeping it all working. So needless to say, it's quite flexible. --Sean "The Hypnotoad" Woods
From: am on 10 Mar 2010 15:51 Arndt Roger Schneider wrote: > am schrieb: > ... >>>>Zhang Weiwu wrote: >>>>here is a mock-up: >>>> >>>>[go the following bug and download its attachment, 60KB png] >>>>https://bugs.launchpad.net/addressbook/+bug/535039 >>The standard canvas can do all this. You have to manage the shadow yourself. >>See >>http://wiki.tcl.tk/15549 (Shadow Photo) and >>http://wiki.tcl.tk/15611 (Photo Gallery) >> >> >> > > No the canvas cannot handle the shadow effect. > It is possible to fake a gradient by using layered lines, with an > uniform coloured background, but not with a structured background. > > am are you seriously suggesting to fake a shadow gradient with images > --Not even the shadow image works with the structured background? Standard Tk with an actual Img extension (png-images) _can_ do this: package require Tk pack [canvas .c -width 100 -height 100] ..c create line 0 0 50 50 -width 2 # this will stand for a background image package require Img image create photo i1 -format png -data { iVBORw0KGgoAAAANSUhEUgAAABkAAAABC AYAAAFcazUDAAAABGdBTUEAAYagMeiWXwAAAD5J REFUCJltyKEBgCAQAMDDLzSTjeQEDukCNJPzm QGTxWQzXLnAiYIJV2DHjDtQsWHFgown4UDD QP/xfcN4AX1yEDyWzx+fAAAAAElFTkSuQmCC} # this is a one line png with alpha blending width 25. image create photo border -width 25 -height 100 # make a larger image border copy i1 -to 0 0 25 100 -compositingrule set # fill larger image from small image. This runs completley in c and is fast. ..c create image 20 17 -image border # show this border bind .c <1> {border copy i1 -to 0 0 25 100 } # every click makes the border darker >>The headings must be a picture because it would be too difficult to shadow >>the text. >> >> >> > ... which also means that you have to use fixed-size fonts in the rest of > the given design --forget it and use tkpath or tkzinc! > If you have to dynamically resize the complete application - yes >>For the left part use normal canvas commands >> .c create rectangle ... >> .c create text .... -tag [list row1] >>you can than get the bounding box of the text row1, add a few pixel on the >>top, left and bottom and draw the grey rectangle below the text but above >>the blue rectangle. >> > ... the major workload is to reimplement > the listbox interaction for the first listbox element in your example. looking at the mockup, I'd say that you can go by with a mouse click (no keyboard traversal) >>For the middle part place a frame in the canvas and use normal grid geometry >>manager to add a listbox and a normal scrollbar. >> > Yes, will suffice for the given task... > ... place a tkpath path element behind the frame and include the > selection to the left in the path description (a gstripes contour). > --tkzinc curve would be slightly easier, though. > ?? >>For the right part use normal canvas commands: >>.c create text ... -width 100 for word wrapping >>for the table below again use the bounding box of the texts to move the >>pieces to the correct position. >> >> >> > This way you will loose any resize-ability; any resize operation will > destroy the design! It's necessary to embed Yes, resizing has to be handled by hand. > the middle frame into the tk canvas window with this approach > --don't use the grid geometry manager. It is so much easier to let grid handle the geometry management of everything "normal" on a frame and than insert this frame into the canvas pseudo code: frame .c.f -width 100 -height 200 listbox .c.f.lb ... scrollbar .c.f.sy ... grid .c.f.lb .c.f.sy -sticky nsew grid columnconfigure .c.f 0 -weight 1 grid rowconfigure .c.f 0 -weight 1 ..c create window 120 20 -window .c.f > > lines and rectangles ain't anti-aliased with tk canvas under X11. it isn't directly necessary to anti-alias horizontal or vertical lines (including rectangles). :-) > -roger -- Mit freundlichen Gr��en Albrecht Mucha Software Entwicklung ---------------------------------------------------------------------- MediTec GmbH IT-L�sungen f�r das Gesundheitswesen Griesbergstr. 1b-c eMail : [string map {X {}} a.Xmucha(a)Xmeditec-gmbh.com] 31162 Bad Salzdetfurth Internet : www.meditec-gmbh.com
From: Arndt Roger Schneider on 11 Mar 2010 13:37 am schrieb: >Arndt Roger Schneider wrote: > > > >>am schrieb: >> >> >> >.. > > >>>>>Zhang Weiwu wrote: >>>>>here is a mock-up: >>>>> >>>>>[go the following bug and download its attachment, 60KB png] >>>>>https://bugs.launchpad.net/addressbook/+bug/535039 >>>>> >>>>> > > > >>>The standard canvas can do all this. You have to manage the shadow >>> >>> >yourself. > > >>>See >>>http://wiki.tcl.tk/15549 (Shadow Photo) and >>>http://wiki.tcl.tk/15611 (Photo Gallery) >>> >>> >>> >>> >>> >>No the canvas cannot handle the shadow effect. >>It is possible to fake a gradient by using layered lines, with an >>uniform coloured background, but not with a structured background. >> >>am are you seriously suggesting to fake a shadow gradient with images >>--Not even the shadow image works with the structured background? >> >> > >Standard Tk with an actual Img extension (png-images) _can_ do this: > >package require Tk >pack [canvas .c -width 100 -height 100] >.c create line 0 0 50 50 -width 2 ># this will stand for a background image >package require Img >image create photo i1 -format png -data { > iVBORw0KGgoAAAANSUhEUgAAABkAAAABC > AYAAAFcazUDAAAABGdBTUEAAYagMeiWXwAAAD5J > REFUCJltyKEBgCAQAMDDLzSTjeQEDukCNJPzm > QGTxWQzXLnAiYIJV2DHjDtQsWHFgown4UDD > QP/xfcN4AX1yEDyWzx+fAAAAAElFTkSuQmCC} ># this is a one line png with alpha blending width 25. >image create photo border -width 25 -height 100 ># make a larger image >border copy i1 -to 0 0 25 100 -compositingrule set ># fill larger image from small image. This runs completley in c and is fast. >.c create image 20 17 -image border ># show this border >bind .c <1> {border copy i1 -to 0 0 25 100 } ># every click makes the border darker > > > Alright, nice of tkImg ;-)... you can see the overlap between two "border" images. The horizontal shadow must be 1-pixel width and the vertical shadow 1-pixel height to use these shadow images with a variable element...hundreds or even thousands of images. >>>The headings must be a picture because it would be too difficult to shadow >>>the text. >>> >>> >>> >>> >>> With tkpath: Convert the text into a SVG-path object (Inkscape for example), the import the svg with Jeszra into tcl/tk. The resulting path object is fully resizeable and may feature a semitransparent gradient. >>... which also means that you have to use fixed-size fonts in the rest of >>the given design --forget it and use tkpath or tkzinc! >> >> >> >If you have to dynamically resize the complete application - yes > > > The cruical question: resizable or not. When the design has a fixed size simply photoshop the decor and put a hugelist to the left a hugelist (with am's middle code below) into the middle and a frame for the details to the right. >>>For the left part use normal canvas commands >>> .c create rectangle ... >>> .c create text .... -tag [list row1] >>>you can than get the bounding box of the text row1, add a few pixel on the >>>top, left and bottom and draw the grey rectangle below the text but above >>>the blue rectangle. >>> >>> >>> hugelist, preserves the interaction of a listbox and it's simple enough to get the coordinates of the current selection, then translate these coordinates to the canvas to align the rectangle. >>... the major workload is to reimplement >>the listbox interaction for the first listbox element in your example. >> >> > >looking at the mockup, I'd say that you can go by with a mouse click (no >keyboard traversal) > > > > See above. >>>For the middle part place a frame in the canvas and use normal grid >>> >>> >geometry > > >>>manager to add a listbox and a normal scrollbar. >>> >>> >>> > > > >>Yes, will suffice for the given task... >>... place a tkpath path element behind the frame and include the >>selection to the left in the path description (a gstripes contour). >>--tkzinc curve would be slightly easier, though. >> >> >> > >?? > > > >>>For the right part use normal canvas commands: >>>.c create text ... -width 100 for word wrapping >>>for the table below again use the bounding box of the texts to move the >>>pieces to the correct position. >>> >>> >>> >>> >>> No, a canvas embedded frame with oridinary tk label and messages, to use variables for them. >>This way you will loose any resize-ability; any resize operation will >>destroy the design! It's necessary to embed >> >> > >Yes, resizing has to be handled by hand. > > > Resize is what gstripes does! BTW it has a triple interface: tkpath 0.2 and 0.3 and tk canvas... didn't bother to implement the tk canvas part, though. >>the middle frame into the tk canvas window with this approach >> --don't use the grid geometry manager. >> >> > >It is so much easier to let grid handle the geometry management of >everything "normal" on a frame and than insert this frame into the canvas >pseudo code: >frame .c.f -width 100 -height 200 >listbox .c.f.lb ... >scrollbar .c.f.sy ... >grid .c.f.lb .c.f.sy -sticky nsew >grid columnconfigure .c.f 0 -weight 1 >grid rowconfigure .c.f 0 -weight 1 >.c create window 120 20 -window .c.f > > > --don't use the grid geometry manager ...for the overall design, >>lines and rectangles ain't anti-aliased with tk canvas under X11. >> >> > >it isn't directly necessary to anti-alias horizontal or vertical lines >(including rectangles). :-) > > > Agreed :-) -roger
From: Zhang Weiwu on 12 Mar 2010 07:18 Sean Woods 写道: > Looking at your example, it would be reasonably straightforward to > build it on the canvas, with the occasional TTK widget thrown in for > combobox selectors, buttons, etc. The advantage for you is mainly that > the interface can appear whimsical and unique to the user, but the > back end would not be unfamiliar to any Tcl/Tk developer. > Following yours and other people's comments I am convinced the "whimsical" thing is possible with canvas, and there are packages to process it even better. It greatly helps if the application is not only cross-platform but also very portable, by which I mean it can run off from USB stick on Windows, and many Linux distribution have supporting library installed by default so it can also run off from USB stick on Linux. On Windows, it better not require installation, while on Linux, it better not require additional library than frequently pre-deployed onces. This need, of which the importance I only began to understand recently, in turn require a common widget set.
From: Y.T. on 12 Mar 2010 13:37 On Mar 4, 6:11 pm, Zhang Weiwu <zhangweiwu+J...(a)realss.com> wrote: > http://johnbokma.com/mexit/2007/01/05/nero-startsmart-burn-image-to-d... > > How do you think? As I am planning, do you think this is a huge work, or > very simple? Two comments that are somewhat orthogonal to what you're looking for: 1) There's a reason for user interface guidelines. Speaking only for myself, I *Hate* applications that force some kinds of pretty pictures on me where I can't tell which elements are clickable, which might accept text input, where might I be allowed to drag-n-drop something etc. I something functions like a button, then I want it to look like a button and not have to guess around and learn a new set of rules for how-to-interact with an app for every single application out there. 2) For over ten years now, whenever I wanted user-interactivity beynd "plain and simple" I've coded my apps to talk to a port. Yes, this means generating HTML, but it means the display/graphics/pretty surface get divorced from the functional core of the application (in best U*X manner) and the user can pick up the interface in a browser of their choice (i.e. a browser they're comfortable with) and it doesn't even have to be on the same machine (or with the same OS). People know how websites work, and making local apps behave "like a website" leaves them a lot less surprised than making a local app *look* like a website (but not behave like the local system at all). Just something to think about. cordially Y.T. -- Remove YourClothes before you email me.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Ttk::notebook without tabs? Next: TclDevKit/Starpack failing to load a package DLL |