• Announcing: What's Your Type version 0.1 (beta).

    From Luc@luc@sep.invalid to comp.lang.tcl on Sat Mar 9 21:22:14 2024
    From Newsgroup: comp.lang.tcl

    Yeah, well, I only began this thing because I thought it would be 100,
    maybe 150 lines of code. And it ballooned to more than 1,600.

    OK, it was good. It's not very polished, it's poorly tested and a few
    things can be considered unfinished, but it's pretty usable. I will
    improve it later.


    What's Your Type, version 0.1, beta. https://sourceforge.net/projects/whatsyourtype/

    Linux only. Windows coming soon.

    What's Your Type is a program with a GUI that lets you browse all the
    fonts you have installed in your operating system and pick/isolate a
    few you may want to use in some project. It is specifically designed
    for people who are working on some graphical design project that
    requires fancy fonts such as Web sites, fliers, newsletters etc.
    and need to browse and choose fonts.

    package require Tk
    package require tile
    package require Thread
    package require BWidget

    All comments are welcome.

    Big "Thank you" to all who helped.
    --
    Luc


    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Rolf Ade@rolf@pointsman.de to comp.lang.tcl on Sun Mar 10 19:19:43 2024
    From Newsgroup: comp.lang.tcl


    Luc <luc@sep.invalid> writes:
    Yeah, well, I only began this thing because I thought it would be 100,
    maybe 150 lines of code. And it ballooned to more than 1,600.

    OK, it was good. It's not very polished, it's poorly tested and a few
    things can be considered unfinished, but it's pretty usable. I will
    improve it later.


    What's Your Type, version 0.1, beta. https://sourceforge.net/projects/whatsyourtype/

    Linux only. Windows coming soon.

    Thanks for sharing. I gave your script a try and it raised error at
    startup:

    Error in startup script: no such variable
    (read trace on "env(XDG_CONFIG_HOME)")
    invoked from within
    "set ::homedir $env(XDG_CONFIG_HOME)"

    I don't have XDG_CONFIG_HOME set in my enviroment because I just use the default (~/.config). This is just fine, according to the XDG Base
    Directory Specification[1]:

    "$XDG_CONFIG_HOME defines the base directory relative to which
    user-specific configuration files should be stored. If $XDG_CONFIG_HOME
    is either not set or empty, a default equal to $HOME/.config should be
    used."

    I altered your script like:

    if {[info exists env(XDG_CONFIG_HOME)]} {
    set ::homedir $env(XDG_CONFIG_HOME)
    } else {
    # Try to be future ready: no tilde expansion
    # anymore in Tcl 9
    set ::homedir $env(HOME)/.config
    }

    and then it runs fine for me.

    rolf

    [1] https://specifications.freedesktop.org/basedir-spec/latest/

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From saitology9@saitology9@gmail.com to comp.lang.tcl on Sun Mar 10 17:28:21 2024
    From Newsgroup: comp.lang.tcl

    On 3/10/2024 2:19 PM, Rolf Ade wrote:

    Luc <luc@sep.invalid> writes:
    Yeah, well, I only began this thing because I thought it would be 100,
    maybe 150 lines of code. And it ballooned to more than 1,600.

    OK, it was good. It's not very polished, it's poorly tested and a few
    things can be considered unfinished, but it's pretty usable. I will
    improve it later.


    What's Your Type, version 0.1, beta.
    https://sourceforge.net/projects/whatsyourtype/

    Linux only. Windows coming soon.



    I altered your script like:

    if {[info exists env(XDG_CONFIG_HOME)]} {
    set ::homedir $env(XDG_CONFIG_HOME)
    } else {
    # Try to be future ready: no tilde expansion
    # anymore in Tcl 9
    set ::homedir $env(HOME)/.config
    }




    Thanks for sharing.

    You can get it to run on Windows too. Changes for Windows are:

    1) Remove or comment out the entire block of code above and just say this:

    set ::homedir [pwd]

    2) there are a few places that use commands similar to "wm attributes
    $::b1 -zoomed 0". This usage is Linux specific and will throw an error.
    You can just comment these out altogether and then just resize the
    windows yourself.

    3) Some bindings are not defined. But you will get the app up and running.


    However, I am not sure what I am looking at. Typing c will let you
    change some settings. It is very hard to scroll - maybe it is not meant
    to be scrolled. It displays the fonts on your system with a sample text
    to see what they look like.

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Luc@luc@sep.invalid to comp.lang.tcl on Sun Mar 10 19:21:51 2024
    From Newsgroup: comp.lang.tcl

    On Sun, 10 Mar 2024 19:19:43 +0100, Rolf Ade wrote:

    I don't have XDG_CONFIG_HOME set in my enviroment because I just use the >default (~/.config). This is just fine, according to the XDG Base
    Directory Specification[1]:

    I had no idea. I trusted that variable to be universal. Will be fixed in the next version. Thank you.



    On Sun, 10 Mar 2024 17:28:21 -0400, saitology9 wrote:

    You can get it to run on Windows too. Changes for Windows are:
    1) Remove or comment out the entire block of code above and just say this: >set ::homedir [pwd]
    2) there are a few places that use commands similar to "wm attributes
    $::b1 -zoomed 0". This usage is Linux specific and will throw an error.

    Those are things that I will find out when I get it running on Windows. I
    only have XP and I don't have Tcl/Tk installed on Windows. I tried it with a cross-compiled Freewrap binary, but I am having problems with BWidget:

    https://sourceforge.net/p/freewrap/bugs/62/

    It seems I am not the only one:

    https://sourceforge.net/p/freewrap/bugs/50/

    But the proposed fix doesn't work for me.

    I suspect LaBelle will close my ticket as wont-fix but first I want to
    see if he has anything to say.

    Please remember that very few people even know what Tcl/Tk is so I
    really need to distribute binary versions.


    However, I am not sure what I am looking at. Typing c will let you
    change some settings. It is very hard to scroll - maybe it is not meant
    to be scrolled. It displays the fonts on your system with a sample text
    to see what they look like.

    The description of the program is quite clear on its SourceForge page.
    There is also a manual. Did you press F1? You should have been informed
    of the F1 binding on the first run.

    Please elaborate on "very hard to scroll." It should scroll smoothly. Are
    you on Windows?
    --
    Luc


    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From saitology9@saitology9@gmail.com to comp.lang.tcl on Sun Mar 10 18:43:41 2024
    From Newsgroup: comp.lang.tcl

    On 3/10/2024 6:21 PM, Luc wrote:

    Please remember that very few people even know what Tcl/Tk is so I
    really need to distribute binary versions.


    Sure - absolutely. I'd say, in general, users don't want an app to start
    in full screen mode; so perhaps just removing those lines would be fine.



    The description of the program is quite clear on its SourceForge page.
    There is also a manual. Did you press F1? You should have been informed
    of the F1 binding on the first run.

    I think it said press c or something. I may be wrong though.


    Please elaborate on "very hard to scroll." It should scroll smoothly. Are
    you on Windows?


    You can't use the mousewheel scroll. It doesn't do anything. I can
    click or select anything. I can grab the scrollbar and then it works
    but it is a bit different? When I do Control-A, in full selection mode,
    you see the outlines if widgets and stuff.

    I guess my confusion was around the precise widget positioning stuff
    that was discussed in the threads. You can completely ignore my comment.

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From saitology9@saitology9@gmail.com to comp.lang.tcl on Sun Mar 10 18:52:39 2024
    From Newsgroup: comp.lang.tcl



    You can't use the mousewheel scroll.  It doesn't do anything.  I can

    This should read: "I cannot select anything...". I realize it may be a Windows thing.


    Nice app though.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Luc@luc@sep.invalid to comp.lang.tcl on Sun Mar 10 19:53:13 2024
    From Newsgroup: comp.lang.tcl

    On Sun, 10 Mar 2024 18:43:41 -0400, saitology9 wrote:

    You can't use the mousewheel scroll. It doesn't do anything. I can
    click or select anything. I can grab the scrollbar and then it works
    but it is a bit different? When I do Control-A, in full selection mode,
    you see the outlines if widgets and stuff.

    I guess my confusion was around the precise widget positioning stuff
    that was discussed in the threads. You can completely ignore my comment.

    **************************

    The mousewheel scroll works fine for me on Linux. The selection doesn't
    go along though. So yes, it's awkward. I will have to fix that.

    Control-A doesn't work at all for me. Does it for you? I can select all
    by double-clicking the background. But that should not happen. Will fix
    it too.

    Windows is not supported for the time being. As soon as I get a chance
    to actually run it on Windows I should iron out those and other
    problems.

    Thank you for the feedback.
    --
    Luc


    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Rich@rich@example.invalid to comp.lang.tcl on Sun Mar 10 23:00:08 2024
    From Newsgroup: comp.lang.tcl

    Luc <luc@sep.invalid> wrote:
    On Sun, 10 Mar 2024 19:19:43 +0100, Rolf Ade wrote:

    I don't have XDG_CONFIG_HOME set in my enviroment because I just use the >>default (~/.config). This is just fine, according to the XDG Base
    Directory Specification[1]:

    I had no idea. I trusted that variable to be universal. Will be fixed in the next version. Thank you.

    XDG_* is all Linux/Unix specific stuff, windows has its own, different, vaariant.

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From saitology9@saitology9@gmail.com to comp.lang.tcl on Sun Mar 10 19:03:52 2024
    From Newsgroup: comp.lang.tcl

    On 3/10/2024 6:53 PM, Luc wrote:
    On Sun, 10 Mar 2024 18:43:41 -0400, saitology9 wrote:


    The mousewheel scroll works fine for me on Linux. The selection doesn't
    go along though. So yes, it's awkward. I will have to fix that.


    OK - it depends on where your mouse is. If you pointer is in the empty
    space near the scrollbars, then it seems to be OK. In the middle, it
    goes a bit and then stops. Towards the left where font stuff is
    displayed, none at all.


    Control-A doesn't work at all for me. Does it for you? I can select all
    by double-clicking the background. But that should not happen. Will fix
    it too.


    Yes, it does. I tried double click and it works the same way as COtnrol-A.


    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Lawrence Woodman@lorrywoodman@gmail.com to comp.lang.tcl on Mon Mar 11 07:50:07 2024
    From Newsgroup: comp.lang.tcl

    On Sun, 10 Mar 2024 19:21:51 -0300, Luc wrote:

    On Sun, 10 Mar 2024 19:19:43 +0100, Rolf Ade wrote:

    I don't have XDG_CONFIG_HOME set in my enviroment because I just use the >>default (~/.config). This is just fine, according to the XDG Base
    Directory Specification[1]:

    I had no idea. I trusted that variable to be universal. Will be fixed in
    the next version. Thank you.

    I have written two modules that you might find useful to handle this
    situation. Both have sensible defaults. Here's some details in case
    you're interested.

    xdgbasedir
    ----------
    This is ia TCL module to handle the XDG Base Directory Specification https://github.com/lawrencewoodman/xdgbasedir_tcl

    To access the XDG directories you would typically specify the subdirectory
    that these directories will be relative to. The subdirectory is normally
    the name of the application:

    package require xdgbasedir

    puts "XDG_DATA_HOME: [XDG::DATA_HOME myapp]"
    puts "XDG_CACHE_HOME: [XDG::CACHE_HOME myapp]"
    puts "XDG_CONFIG_HOME: [XDG::CONFIG_HOME myapp]"

    puts "XDG_RUNTIME_DIR: [XDG::RUNTIME_DIR myapp]"
    puts "XDG_DATA_DIRS: [XDG::DATA_DIRS myapp]"
    puts "XDG_CONFIG_DIRS: [XDG::CONFIG_DIRS myapp]"

    The XDG procs ending in _DIRS return a list of directories in order of preference.


    AppDirs
    -------
    A Tcl module to simplify cross-platform application file locations https://github.com/lawrencewoodman/appdirs_tcl

    An application that is installed on a variety of platforms will use
    different locations on each platform to access files. This module aims to provide access to these locations through a common interface. For each operating system the module aims to use an appropriate standard for the locations, for example on Linux the XDG Base Directory Specification is
    used and on Microsoft Windows or Darwin/Mac OS X the most common locations
    for each version of the operating system is used.

    First create an instance of the AppDirs class by instantiating it with
    a brand and applicationName. The brand may be ignored depending on the
    platform that is being used. You can then call the methods on this
    instance as follows:

    package require AppDirs

    set myAppDirs [AppDirs new myBrand myApp]

    # Return location of user-specific data files
    puts "data home: [$myAppDirs dataHome]"

    # Return location of user-specific configuration files
    puts "config home: [$myAppDirs configHome]"

    # Return a list of locations for system-wide configuration files in
    # preference order
    puts "data dirs: [$myAppDirs dataDirs]"

    # Return a list of locations for system-wide data files in
    # preference order
    puts "config dirs: [$myAppDirs configDirs]"



    Best wishes


    Lorry


    ---
    XCCP: A Shell Extension for CP/M https://techtinkering.com/articles/xccp-a-shell-extension-for-cpm/

    --- Synchronet 3.20a-Linux NewsLink 1.114