jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

[Question] FileBox dirName using the all-in-one method? #583

Closed eyeonus closed 4 years ago

eyeonus commented 5 years ago

So, I learned very quickly that I couldn't use directoryBox() the way I wanted to, but that entry() allowed me sufficient configurability:

win.entry('--cwd', cwd, tooltip = 'Change the working directory file accesses are made from.',
                   kind = 'directory', label = False, text = '--cwd', colspan = 1, sticky = 'w', row = 3, column = 0)

The problem with using entry() is that, "dirName", is an invalid kwarg for entry. I don't seem to be able to set the dialog to open at a particular location, and it doesn't open in the CWD by default like the directoryBox() etc. methods do.

Is there any way to set the initialdir of the dialog box when building the filebox using the all-in-one entry() method?

jarvisteach commented 5 years ago

Good idea - this would be a useful feature to have.

Although, I'm surprised the directoryBox opens in a different location to the one generate by the directoryBox function, as they should be the same.

I'll add the dirName parameter, to support this request.

Out of interest, what is it you're trying to achieve, that creating an a directoryBox doesn't support?

eyeonus commented 5 years ago

Creating an entry widget using "kind = 'directory'" creates a compound widget that includes a text area for typing and a button that launches a browser window.

Creating a directoryBox just launches a browser window, requiring me to emulate the entry() way with a scollPane, a button, and a standard entry.

It's too bad Label and Entry are separate widgets. It be nice if they were the same widget with a disabled flag. But that's a minor aside that's not entirely relevant.

It's mainly just a lot less effort on my part to use the 'directory' kind of entry().

Although speaking of, it'd be nice to be able to configure some things about the various widgets, like being able to choose which side of the widget the label is on for labelled widgets: in most cases the label is to the left of the content, but in the case of checkBoxen it's on the right, for example.

eyeonus commented 5 years ago

Oh, if you're wondering about the state of the fruit of my labours, https://github.com/eyeonus/Trade-Dangerous/tree/gui-beta

DL that branch and run trade.py gui and you'll see what I've got thus far.

jarvisteach commented 4 years ago

OK, so now the contents of the entry are passed as a parameter to the dialogs, ensuring they carry on where they left off. Furthermore, if they have no contents, and a dirName parameter is set on the entry, then that will be sent...

jarvisteach commented 4 years ago

I've resolved the issue with disabling fileEntries #590