Menu

make placeholder less blurry

Anonymous
2022-05-18
2022-05-19
  • Anonymous

    Anonymous - 2022-05-18

    The commands & lambdas (bindings) generate handy placeholder functions...so you can hammer away & click buttons and see "something happen" when the first code is run. However, the lines are all blurred together, making it somewhat confusing as to which goes with what, or just losing your place.

    def sbTchan1_cmd(*args):
    print('hot_auger_support.sbTchan1_cmd')
    for arg in args:
    print ('another arg:', arg)
    sys.stdout.flush()


    adding a few spaces by default makes it MUCH easier to read as you click/poke all of the graphics...indent the args a few spaces
    print (' another arg:', arg)

    also adding a \n beginning of the first print also helps, though not as much as the indenting.
    print('\nhot_auger_support.sbTchan1_cmd')

    from this
    hot_auger_support.tempress
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="122" y="105">
    hot_auger_support.tempress
    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="129" y="61">
    pwrbar arg: 2
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="117" y="94">
    scroll touch: 8
    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="66" y="37">
    pwrbar arg: 2
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="88" y="69">
    scroll touch: 8
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="256" y="98">
    scroll touch: 1</buttonpress></buttonpress></buttonpress></buttonpress></buttonpress></buttonpress>


    TO THIS
    hot_auger_support.tempress

    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="75" y="40">
    pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="73" y="90">
    scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="296" y="114">
    scroll touch: 1</buttonpress>

    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="96" y="49">
    pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="72" y="87">
    scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="253" y="94">
    scroll touch: 1</buttonpress>

     
  • Anonymous

    Anonymous - 2022-05-18

    Whoops!! actually with the indents it looks like this
    hot_auger_support.tempress

    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="75" y="40">
    pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="73" y="90">
    scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="296" y="114">
    scroll touch: 1</buttonpress>

    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="96" y="49">
    pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="72" y="87">
    scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="253" y="94">
    scroll touch: 1</buttonpress>

     
  • Anonymous

    Anonymous - 2022-05-18

    Interesting....the posting loses the spaces !!!! Try again
    hot_auger_support.tempress

    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="75" y="40">
    pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="73" y="90">
    scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="296" y="114">
    scroll touch: 1</buttonpress>

    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="96" y="49">
    pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="72" y="87">
    scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="253" y="94">
    scroll touch: 1</buttonpress>

     
  • Anonymous

    Anonymous - 2022-05-18

    ARRRRRRG...for some reason the posting forces left justify...so I'll use dots to get the idea across
    hot_auger_support.tempress

    hot_auger_support.pwrbar

    pwrbar arg: <buttonpress event="" num="1" x="75" y="40">
    . pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    . scroll touch: <buttonpress event="" num="1" x="73" y="90">
    . scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    . scroll touch: <buttonpress event="" num="1" x="296" y="114">
    . scroll touch: 1</buttonpress>

    hot_auger_support.pwrbar
    . pwrbar arg: <buttonpress event="" num="1" x="96" y="49">
    . pwrbar arg: 2</buttonpress>

    hot_auger_support.scrolltemp
    . scroll touch: <buttonpress event="" num="1" x="72" y="87">
    . scroll touch: 8</buttonpress>

    hot_auger_support.scrolltemp
    . scroll touch: <buttonpress event="" num="1" x="253" y="94">
    . scroll touch: 1</buttonpress>

     
  • Anonymous

    Anonymous - 2022-05-18

    Interesting I tried DOT SPACE SPACE SPACE SPACE TEXT & post removed all the spaces!!! I hope the idea is clear! I just gave up and attached a photo!!!

     
  • Greg Walters

    Greg Walters - 2022-05-18

    First, you might want to use the Code post helper above (The formatting option in the bar above that is just after the "H" for heading)...

    def main(*args):
        '''Main entry point for the application.'''
        global root
        root = tk.Tk()
        root.protocol( 'WM_DELETE_WINDOW' , root.destroy)
        # Creates a toplevel widget.
        global _top1, _w1
        _top1 = root
        _w1 = test1.Toplevel1(_top1)
        root.mainloop()
    

    Second, I appreciate your determination on trying to get your point across, but I'm unsure exactly what you are trying to say.

    Is there a question there somewhere?

    Greg

     
  • Anonymous

    Anonymous - 2022-05-18

    Yeah, it was aggravating trying to post...also could find no way to go back and edit a post.
    Ok look at the photo above...see it is nice and NEAT...I edited all of the page placeholder codes to include a \n for the first print and spaces in the arg print lines...GIVES NICE AND NEAT...this should be what page generates..(add \n to first print and spaces to the arg print) ...instead Page generates this "mess" result, hard to see/understand the buttons working:
    hot_auger_support.tempress
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="122" y="1&lt;img alt=" "="" src="![](https://)https://">05">
    hot_auger_support.tempress
    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="129" y="61">
    pwrbar arg: 2
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="117" y="94">
    scroll touch: 8
    hot_auger_support.pwrbar
    pwrbar arg: <buttonpress event="" num="1" x="66" y="37">
    pwrbar arg: 2
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="88" y="69">
    scroll touch: 8
    hot_auger_support.scrolltemp
    scroll touch: <buttonpress event="" num="1" x="256" y="98">
    scroll touch: 1</buttonpress></buttonpress></buttonpress></buttonpress></buttonpress></buttonpress>

     
  • Greg Walters

    Greg Walters - 2022-05-18

    I understand now. I'm not sure how much can be done, but I did talk to Don about it this morning.

    I'm planning on seeing if I can come up with a formatting statement to help that along. If I do, I'll post it here for you as well as sending it to Don to see if he can incorporate it.

    Just for my knowledge, what version of Python are you using? All of the "good" formatting commands really require Python 3.7+.

    Greg

     
  • Greg Walters

    Greg Walters - 2022-05-18

    Ok. Looking at the capture.jpg image, I think what I have done might match what you are looking for. Just not in the current release.

    I threw together a demo and here is the output (in my IDE)

    test2_support.py
    test2_support.on_rdobtn
            another arg: 1
    test2_support.on_rdobtn
            another arg: 2
    test2_support.on_rdobtn
            another arg: 3
    test2_support.on_rdobtn
            another arg: 4
    test2_support.on_chkbtn
            another arg: 1
    test2_support.on_chkbtn
            another arg: 2
    test2_support.on_chkbtn
            another arg: 3
    test2_support.on_chkbtn
            another arg: 4
    test2_support.on_btnExit
    

    Hopefully that's basically what you are looking for. Now, here is the code I used in the two callback functions...

    def on_chkbtn(*args):
        print('test2_support.on_chkbtn')
        for arg in args:
            print('\tanother arg:', arg)
        sys.stdout.flush()
    
    
    def on_rdobtn(*args):
        print('test2_support.on_rdobtn')
        for arg in args:
            print('\tanother arg:', arg)
        sys.stdout.flush()
    

    As you can see, it's just a simple workaround change to the code that PAGE provides of modifying the print statement from a "normal" print to one that starts with an embedded Tab character (the "\t" portion right after the opening single quote. Is that what you were looking for?

    Greg

     
  • Anonymous

    Anonymous - 2022-05-19

    As you can see, it's just a simple workaround change to the code that PAGE provides of modifying the print statement from a "normal" print to one that starts with an embedded Tab character (the "\t" portion right after the opening single quote. Is that what you were looking for?

    Exactly!! I know how to do it, I want PAGE to do it...why should I edit 50 or 60 sample callbacks, when page can generate the improved spacing itself. I suggest also putting the \n leading the first print statement (right after def) , since not all callbacks print any args and those single line ones will clump together. These improvements increase the readability a lot (at least until you revamp the callbacks for actual use).

     
  • Greg Walters

    Greg Walters - 2022-05-19

    Your "request" will be passed on to Don.

    Greg

     

Anonymous
Anonymous

Add attachments
Cancel





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.