in reply to Creating Tk Applications Graphically

I agree with flyingmoose about writing the GUI in code. You've got much more control over what you're doing and can tweak it as you desire or need to. Perhaps mave's suggestion will be the ticket for you.

When I write Tk apps, it's easier for me to layout my interface in Photoshop or Paint Shop Pro, using the rulers set in pixel, and figure out the exact placement points of where I wanted everything to go. That way I have my layout set, and can easily movepieces if I don't like where they're placed. Then I draw dark lines and print the picture, and put the x-y coordinates on the lines. I prefer using cooridinate geometry in Tk, as I find it easier than the compass point geometry.

Hope that helps!

There is no emoticon for what I'm feeling now.

  • Comment on Re: Creating Tk Applications Graphically

Replies are listed 'Best First'.
•Re: Re: Creating Tk Applications Graphically
by merlyn (Sage) on Mar 13, 2004 at 16:06 UTC
    But applications designed like that usually feel to me the same way web pages feel that are done by "visual" layout programs. That is, when I move the lower-right window size box, it should get bigger or smaller, darn it!

    If you lay out "logically" rather than "visually", you don't have any absolute pixels. Everything is just "left" or "right" or "above" other things, and when the main window is resized, everything is still like that. Pixel based layout tools are wrong for that.

    Now, maybe you meant that you do a Photoshop layout, but only to generally figure out where things go, and then you reduce it to simple ->pack calls rather than absolute ->place calls or fixed sizes for all your widgets. But I'm not sure, so I'm raising the issue here.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Actually for what I did, I wanted the absolute pixel placement. That worked out fine for me in that instance. However that's not to say I'd use that every time. I'd have to look at the app I was building.

      I used that technique with the first Tk app I ever did, and the ability to place things at x-y coordinates was easier for me to deal with for what I did as I had some graphics in my main window. I used Photoshop since I was more comfortable with it than Paint Shop Pro.

      It worked for me, it might not for others. I only offered it as a suggestion as the o.p. seemed to be looking for an easy solution for laying out widgets in Tk.

      There is no emoticon for what I'm feeling now.

      IMHO some of the best web site/UI designs are "pixel perfect" - don't forget stuff like having fixed size gifs (e.g. backgrounds) marry up to tables, etc.
        It's not a good design if it doesn't work on my cell phone, or a blind person's speaking browser, or is visible to the world's most important browsers (googlebot and to a lesser extent, scooter).

        The web is not paper. Paper designers can't seem to get over this.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.