Menu

#31 dialog code

open
tile (27)
5
2014-07-30
2005-10-15
No

This is not a patch but a snidget a bit inspired by the tile
dialog code.
Since you probably want to write your own code just pick the
pieces you want.

This code fixes a few things:

1) It sets the paddings etc to be platform specific and as
close to the
HUI guidelines as I've been able to figure out.

2) It uses the option database for a number of things which
makes it more
flexible.

3) It sets the button orders according to platform habits, mac:
cancel+ok,
windows: cancel+ok etc.

4) It uses grid instead of pack so that minsize can be set.
This gives a more
consistent look, and is necessary on mac. Dialog widths
should be independent
of message lengths.

5) It uses ::tk::unsupported::MacWindowStyle on mac to set
the correct
toplevel style. Note that despite -modal 1 you need a grab
anyway.

6) Client area is lined up with the text boxes.

7) Use pngs from Everaldo with permission which makes a
HUGE difference.
The 1 bit alpha for gifs just wont do any blending with the
background.
Png support is necessary for any decent looking UI. tkpng
seems like a
good choice.

8) It uses "badges" to indicate which application is giving you
a message.
Idea from Apple. I think this is an excellent idea.

9) It uses 64x64 icons which I think we can afford with
todays screen sizes.

Perhaps we shouldn't use -class Dialog, -class JDialog is
perhaps a better
choice for tile.

Screenshot also attached.

I've been experimenting with snidgets a bit and some code
gets much cleaner,
while other code just gets clumsy. Not an obvious choice.
Destruction is
particularly problematic.

Mats

Discussion

  • Mats Bengtsson

    Mats Bengtsson - 2005-10-15

    screenshot

     
  • Mats Bengtsson

    Mats Bengtsson - 2005-10-15
     
  • Mats Bengtsson

    Mats Bengtsson - 2005-10-15

    utility code for dialog.tcl

     
  • Mats Bengtsson

    Mats Bengtsson - 2005-10-15
    • labels: --> tile
    • assigned_to: nobody --> jenglish
     
  • Mats Bengtsson

    Mats Bengtsson - 2005-10-15

    Logged In: YES
    user_id=108900

    Correction: I meant -class TDialog, of course.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-10-16

    Logged In: YES
    user_id=72656

    Please look at widget::dialog in the tklib widget package.
    That is a dialog snidget. It doesn't do the -icon -message
    in particular, trying to be more general purpose, but it
    could. I don't think the handling and destruction there are
    awkward, but feel free to comment.

    I'm finding snidgets to be an ease and breeze to code up in
    comparison to other packages. The tile dialog is also
    likely not to go into the Ttk stuff.

     
  • Mats Bengtsson

    Mats Bengtsson - 2005-10-16

    Logged In: YES
    user_id=108900

    I find it a good choice using the option database for many of the
    platform specific stuff (showed in the attached dialog.tcl) instead of
    hardcoding it into the sources.

    Snidget destruction: I had problems using
    method grab {} {
    grab $win
    }
    which failed when window was closed.

    Using snit, install widget must be made before $self configurelist
    which can be a problem if the installation depends on some option
    not set directly in the argument list. Sorry for being vague. I guess
    it takes some time to getting used to.

     
  • Mats Bengtsson

    Mats Bengtsson - 2005-10-16

    Logged In: YES
    user_id=108900

    Correction, I meant:

    method grab {} {
    grab $win
    tkwait window $win
    }

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.