Axis Modifications

More
12 Jan 2025 00:18 #318719 by phillc54
Replied by phillc54 on topic Axis Modifications
Ahh, yes I see that now. There are a couple of procedures in tkfbox.tcl that overwrite the button text.
The only correct way I see to do it would be to roll your own dialog box.
There is an ugly workaround by running the below code in the user_live_update method of the user command file. You would restore bigfileopen.tcl back to the original.
def user_live_update():
    if root_window.tk.eval('winfo exists .__tk_filedialog') == '1':
        open = '\n   Open   \n'
        cancel = '\nCancel\n'
        root_window.tk.eval(f'.__tk_filedialog.contents.f2.ok configure -text {{{open}}}')
        root_window.tk.eval(f'.__tk_filedialog.contents.f2.cancel configure -text {{{cancel}}}')

It is really ugly...
 
The following user(s) said Thank You: nawaf

Please Log in or Create an account to join the conversation.

More
14 Jan 2025 00:42 #318910 by phillc54
Replied by phillc54 on topic Axis Modifications
I really didn't like the last one so I tried something different and this is the result.
You don't need user_live_update, just use the below in bigfileopen.tcl.
# bigfileopen.tcl

if {[info proc tkgof] == ""} {rename tk_getOpenFile tkgof}
proc tk_getOpenFile {args} {
    # get width and height for max screen size:
    variable width  [lindex [wm maxsize .] 0]
    variable height [lindex [wm maxsize .] 1]
    # alternately, just set width and height explicitly:
    variable width  800
    variable height 600
    # location on screen:
    variable xoffset 0
    variable yoffset 0
    # padding to enlarge buttons:
    variable padx 10
    variable pady 20
    # set the window size and the button sizes
    after 0 {wm geometry .__tk_filedialog ${width}x${height}+${xoffset}+${yoffset};
             .__tk_filedialog.contents.f2.ok configure -padding [list $padx $pady $padx $pady];
             .__tk_filedialog.contents.f2.cancel configure -padding [list $padx $pady $padx $pady]}
    return [eval ::tkgof $args]
}
 
The following user(s) said Thank You: tommylight, nawaf

Please Log in or Create an account to join the conversation.

More
14 Jan 2025 04:21 - 14 Jan 2025 04:29 #318923 by nawaf
Replied by nawaf on topic Axis Modifications
Thank you, Phill, that was very helpful.How can I make the file list display with larger sizes? I want to increase the size of the text and icons.  
if {[info proc tkgof] == ""} {rename tk_getOpenFile tkgof}
proc tk_getOpenFile {args} {
    # location and size on screen:
    variable xoff    50
    variable yoff    10
    variable width    900
    variable height    500
    variable padx    10
    variable pady    20

    after 0 {
        wm geometry .__tk_filedialog ${width}x${height}+${xoff}+${yoff};
        .__tk_filedialog.contents.f1.lab configure -padding [list $padx $pady $padx $pady];
        .__tk_filedialog.contents.f1.menu configure -direction below;
        .__tk_filedialog.contents.f1.menu.menu configure -font {Sans 20};
        .__tk_filedialog.contents.f1.up configure -padding [list $pady $pady $pady $pady];
        .__tk_filedialog.contents.f2.lab configure -padding [list $padx $pady $padx $pady];
        .__tk_filedialog.contents.f2.ent configure -font {Sans 18};
        .__tk_filedialog.contents.f2.lab2 configure -padding [list $padx $pady $padx $pady];
        .__tk_filedialog.contents.f2.menu configure -padding [list 5 10 5 10];
        .__tk_filedialog.contents.f2.ok configure -padding [list $padx $pady $padx $pady];
        .__tk_filedialog.contents.f2.cancel configure -padding [list $padx $pady $padx $pady];
        .__tk_filedialog.contents.f2.hidden configure -padding [list 10 10 10 10]
    }
    
    return [eval tkgof $args]
    
}
Attachments:
Last edit: 14 Jan 2025 04:29 by nawaf.

Please Log in or Create an account to join the conversation.

More
15 Jan 2025 02:47 - 15 Jan 2025 02:51 #318994 by cakeslob
Replied by cakeslob on topic Axis Modifications
holy shit I am not sure why they made this so hard. they are using a different font class
for changing the font size in the file menu -
rC('font','configure','TkIconFont','-family', fontName, '-size', fontSize)
rC('font','configure','TkTextFont','-family', fontName, '-size', fontSize)

for posteriority heres how I got there. fbox takes the files and makes them into an Iconlist, which then uses the font family TkIconFont to configure this megawidget "Iconlist"

I thought it was odd that some of the widgets configured to our textsize and font but some did not. Its the same case for the entry widget that loads the file name. The colours dont change for most widgets unless you change the colour after you open, and even then only some widgets configure. The options in the listbox configure colour but none of the other text changes colour.

nawaf are you using regularmac800? that will make this easier. you can just add those 2 lines, or get the update from the github.

unfortunately this doesnt make it a better file browser. there are some alternative ones i want to try out when i figure out how
Last edit: 15 Jan 2025 02:51 by cakeslob.
The following user(s) said Thank You: nawaf

Please Log in or Create an account to join the conversation.

More
15 Jan 2025 03:44 #318998 by phillc54
Replied by phillc54 on topic Axis Modifications

holy shit I am not sure why they made this so hard

Yeah, these are mostly themed widgets so some options require setting via styles. It can be a PITA.

I want to increase the size of the text and icons

It seems to need an update for the first run, the below bigfileopen.tcl touches every widget in the dialog and includes the update.
Warning: Spoiler!


 
The following user(s) said Thank You: nawaf

Please Log in or Create an account to join the conversation.

More
16 Jan 2025 03:47 #319084 by nawaf
Replied by nawaf on topic Axis Modifications

nawaf are you using regularmac800?

Yeah, thanks, cakeslob, for the GUI mod.
I am using a 10-inch touchscreen with a resolution of 1024x600 and I want to use the Axis GUI with buttons that are large enough, and I saw your mod and tried it. It's great because the buttons are big enough.
But for the open file dialog, the buttons are not big enough for my fingers, making it a bit difficult to touch them on my screen
 

Please Log in or Create an account to join the conversation.

More
16 Jan 2025 03:51 - 16 Jan 2025 09:34 #319085 by nawaf
Replied by nawaf on topic Axis Modifications
Thank you, Pill, this works great for me
Warning: Spoiler!
Last edit: 16 Jan 2025 09:34 by nawaf.

Please Log in or Create an account to join the conversation.

Time to create page: 0.173 seconds
Powered by Kunena Forum