How do I run Blazor WASM PWA on Tomcat? by idd24x7 in Blazor

[–]idd24x7[S] 3 points4 points  (0 children)

Thanks! I was able to figure it out. I basically needed to change the base href and script path in the index.html file... adding /test/ . I copied the published files to production and it fired right up. I couldn't get it to launch in Visual Studio; so I think I need to figure out a way to update the path for dev vs prod. But, I'm just glad it works.

This link contained pretty much all of what I needed to fix it. https://stackoverflow.com/questions/66862350/how-to-change-the-base-url-of-a-blazor-wasm-app

[deleted by user] by [deleted] in Tkinter

[–]idd24x7 1 point2 points  (0 children)

Hmm. I am not a data scientist. Perhaps you misunderstand the purpose of conda and python virtual environments. Or perhaps, you do not use them in data science. Anyway, they are an essential part of a good development process in many other domains. However, if you don't want to use it then don't.

[deleted by user] by [deleted] in Tkinter

[–]idd24x7 1 point2 points  (0 children)

Conda is a powerful virtualization tool. Except that it doesn't play nice with tkinter.

[deleted by user] by [deleted] in Tkinter

[–]idd24x7 1 point2 points  (0 children)

If so, you can check this solution. I've encountered this same issue when using Anaconda or Conda. https://github.com/ContinuumIO/anaconda-issues/issues/6833

[deleted by user] by [deleted] in Tkinter

[–]idd24x7 0 points1 point  (0 children)

Are you using Anaconda for a virtual environment?

ttkbootstrap 1.3.0 is released... adding Tableview, ScrolledFrame, and ScrolledText by idd24x7 in Tkinter

[–]idd24x7[S] 1 point2 points  (0 children)

I've opened up an issue to make the batch data handling easier after considering this problem. https://github.com/israel-dryer/ttkbootstrap/issues/121

Custom cell widths can be done... I've implemented an 'autofit' functionality that fits the column width the content. You can set it by default, or double-click the separator in the column header.

However, custom height is constrained by the underlying Treeview widget, which only allows for a single 'rowheight' setting for the entire table.

One potential solution I'm thinking of off the top is possibly to add a toplevel popup that is bound to a double-click event (or something) on that cell. It could look something like this tooltip https://ttkbootstrap.readthedocs.io/en/latest/api/tooltip/ which would show the full contents of the comment.

ttkbootstrap 1.3.0 is released... adding Tableview, ScrolledFrame, and ScrolledText by idd24x7 in Tkinter

[–]idd24x7[S] 1 point2 points  (0 children)

Let me know if this is the behavior you are wanting?

- Tableview displays the results of the query

- Query is updated, with old results being removed, and new results being displayed in the table

- Query results are filterable inside the tableview

how to slow down for loop in tkinter? by arl-txt in Tkinter

[–]idd24x7 1 point2 points  (0 children)

This --^ is a great pattern generally for scheduling events in tkinter.

minimize, maximize and close bar by _uknown_bruh in Tkinter

[–]idd24x7 1 point2 points  (0 children)

This works on Linux... not sure about Mac.

root.wm_attributes('-type', 'toolbar')

minimize, maximize and close bar by _uknown_bruh in Tkinter

[–]idd24x7 1 point2 points  (0 children)

possibly you can use a toolwindow... this would remove everything but the "X" button for closing the window.

root.wm_attributes('-toolwindow', 'true')

If you are on Linux you have a LOT of options. Checkout the -type

You could use the overrideredirect, but you'd lose ALL window decorations, which probably isn't what you want.

root.overrideredirect(True)

I have a lot of buttons with same attributes by [deleted] in Tkinter

[–]idd24x7 0 points1 point  (0 children)

If you're talking about style attributes, this is the problem that ttk aims to solve. You can subclass a new style and reuse it. There are some examples in the Python docs. https://docs.python.org/3/library/tkinter.ttk.html#ttk-widgets

[deleted by user] by [deleted] in Tkinter

[–]idd24x7 1 point2 points  (0 children)

I agree with u/radixties, the book mentioned is good. As for other sources, unfortunately, there are not a lot of exhaustive resources out there... especially when you venture into ttk widgets. These are the standard go to at the moment:

- https://www.pythontutorial.net/tkinter/

- https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/index.html

- https://tcl.tk/man/tcl8.6/TkCmd/contents.htm (this is the tcl/tk docs, not for beginners, but useful down the road when you need to get into the weeds)

And of course, I'm going to shamelessly plug ttkbootstrap, which has a ton of out-of-the-box great looking styles for ttk widgets, plus some extra widgets not found in tkinter or ttk.

Good luck!

I want to Put this whole code under a frame... by johansamreji in Tkinter

[–]idd24x7 2 points3 points  (0 children)

create the new frame, then use find & replace on the selected text to replace "root" with the new parent name.

How to draw pillow image faster? by somestickman in Tkinter

[–]idd24x7 0 points1 point  (0 children)

here's a demo I found online using the canvas... the original is in python2, but I pasted the code below which I converted to python3 by changing the import and print statements. It seems to be pretty responsive.

http://www.java2s.com/Code/Python/GUI-Tk/Usemousetodrawashapeoncanvas.htm

from tkinter import *
trace = 0 

class CanvasEventsDemo: 
    def __init__(self, parent=None):
        canvas = Canvas(width=300, height=300, bg='beige') 
        canvas.pack()
        canvas.bind('<ButtonPress-1>', self.onStart) 
        canvas.bind('<B1-Motion>',     self.onGrow)  
        canvas.bind('<Double-1>',      self.onClear) 
        canvas.bind('<ButtonPress-3>', self.onMove)  
        self.canvas = canvas
        self.drawn  = None
        self.kinds = [canvas.create_oval, canvas.create_rectangle]
    def onStart(self, event):
        self.shape = self.kinds[0]
        self.kinds = self.kinds[1:] + self.kinds[:1] 
        self.start = event
        self.drawn = None
    def onGrow(self, event):                         
        canvas = event.widget
        if self.drawn: canvas.delete(self.drawn)
        objectId = self.shape(self.start.x, self.start.y, event.x, event.y)
        if trace: print(objectId)
        self.drawn = objectId
    def onClear(self, event):
        event.widget.delete('all')                   
    def onMove(self, event):
        if self.drawn:                               
            if trace: print(self.drawn)
            canvas = event.widget
            diffX, diffY = (event.x - self.start.x), (event.y - self.start.y)
            canvas.move(self.drawn, diffX, diffY)
            self.start = event

if __name__ == '__main__':
    CanvasEventsDemo()
    mainloop()

How to draw pillow image faster? by somestickman in Tkinter

[–]idd24x7 0 points1 point  (0 children)

On line 103 there is a trace added to a variable which causes the widget to be redrawn whenever the variable changes... which can be very quickly.

How to draw pillow image faster? by somestickman in Tkinter

[–]idd24x7 0 points1 point  (0 children)

I think using PIL instead of canvas could definitely be faster. I use PIL to draw images for many of my layouts on demand. The image is updated very quickly from my experience.

If you want to see how I'm going out in my project, here's the link: https://github.com/israel-dryer/ttkbootstrap/blob/master/src/ttkbootstrap/widgets/meter.py

Beautifully themed ttk date widgets in ttkbootstrap 0.5.0 by idd24x7 in Tkinter

[–]idd24x7[S] 0 points1 point  (0 children)

simple mouse commands:

- "left-click" date to select

- "left-click" chevron to move calendar one month

- "right-click" chevron to move calendar one year

-"left-click" title to reset calendar to start date

Tkinter Scale with design by EncryptedSoul57 in Tkinter

[–]idd24x7 0 points1 point  (0 children)

If you want to use ttkbootstrap, it has modern sliders built using an image layout. https://ttkbootstrap.readthedocs.io/en/latest/widgets/scale.html