New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTK Support #189

Open
PrimordialHelios opened this Issue Jul 9, 2017 · 41 comments

Comments

Projects
None yet
5 participants
@PrimordialHelios

PrimordialHelios commented Jul 9, 2017

Is there any chance you'd be willing to add ttk support, or accept a PR adding ttk support? I personally like the native look a lot more, and I'd love to use ttk widgets with appJar.

List of supported widgets (http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-widget-set.html)

Basic widgets:

  • ttk.Label
  • ttk.Button
  • ttk.Entry
  • ttk.Checkbutton
  • ttk.Radiobutton
  • ttk.Scale

And their other incantations:

  • Buttons
  • Labels
  • Labelled Widgets

Others:

  • ttk.Frame
  • ttk.LabelFrame
  • ttk.Menubutton
  • ttk.PanedWindow
  • ttk.Scrollbar

Nice to haves:

  • OptionBox?

  • Also, include support for additional ttk themes

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jul 9, 2017

Owner

Definitely interested in adding this.

How do you envisage it working?

Perhaps just a flag that can be set to use ttk if available? This will then import ttk and replace any existing widgets with ttk widgets, as well as make any new widgets available?

Is ttk always part of a Python installation? I seem to remember having issues importing ttk when I first started appJar...

If a user wants ttk, then the config options might need to be changed too?

Owner

jarvisteach commented Jul 9, 2017

Definitely interested in adding this.

How do you envisage it working?

Perhaps just a flag that can be set to use ttk if available? This will then import ttk and replace any existing widgets with ttk widgets, as well as make any new widgets available?

Is ttk always part of a Python installation? I seem to remember having issues importing ttk when I first started appJar...

If a user wants ttk, then the config options might need to be changed too?

@PrimordialHelios

This comment has been minimized.

Show comment
Hide comment
@PrimordialHelios

PrimordialHelios Jul 9, 2017

I imagined using a flag, and then tk/ttk specific functions/options would check for the flag and then use the relevant options. I think the best way to set the flag would be either:

app = gui( useTtk=True )

Or:

app = gui()
app.useTtk()

I'm not sure if tk and ttk widgets can exist together, so if have to check that out.

The x86 Windows installer for python 3.6 has ttk by default, but when I get home I can check some Linux distros. Either way, I think using tk as the default and and requiring ttk to be explicitly asked for would be for the best.

Config options are the biggest issue with this. I remember bg, padx, and pady being the biggest culprits, but it won't be too hard to get the ttk widgets running properly, just some if..else statements checking for the useTtk flag.

EDIT: Fixed formatting

PrimordialHelios commented Jul 9, 2017

I imagined using a flag, and then tk/ttk specific functions/options would check for the flag and then use the relevant options. I think the best way to set the flag would be either:

app = gui( useTtk=True )

Or:

app = gui()
app.useTtk()

I'm not sure if tk and ttk widgets can exist together, so if have to check that out.

The x86 Windows installer for python 3.6 has ttk by default, but when I get home I can check some Linux distros. Either way, I think using tk as the default and and requiring ttk to be explicitly asked for would be for the best.

Config options are the biggest issue with this. I remember bg, padx, and pady being the biggest culprits, but it won't be too hard to get the ttk widgets running properly, just some if..else statements checking for the useTtk flag.

EDIT: Fixed formatting

@PrimordialHelios

This comment has been minimized.

Show comment
Hide comment
@PrimordialHelios

PrimordialHelios Jul 10, 2017

Fully updated and (almost) clean VMs of Ubuntu 16.04 LTS 64 bit, Fedora 25 64 bit, and FreeBSD 64 bit all properly import tkinter, and ttk in python 2 and 3 after installing the necessary packages. It looks like every modern pre-built python is linked against tkinter >= 8.5

PrimordialHelios commented Jul 10, 2017

Fully updated and (almost) clean VMs of Ubuntu 16.04 LTS 64 bit, Fedora 25 64 bit, and FreeBSD 64 bit all properly import tkinter, and ttk in python 2 and 3 after installing the necessary packages. It looks like every modern pre-built python is linked against tkinter >= 8.5

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jul 10, 2017

Owner

Great, thanks for investigating that!

OK, I'll add the second option you mention above, and for now simply have that import ttk - that will override any existing widgets.

I'll leave it at that for the current scheduled release (already overdue) - unless it breaks the basic setup - then in the next release we can look at updating config functions, as well as exposing any other widgets/features.

Owner

jarvisteach commented Jul 10, 2017

Great, thanks for investigating that!

OK, I'll add the second option you mention above, and for now simply have that import ttk - that will override any existing widgets.

I'll leave it at that for the current scheduled release (already overdue) - unless it breaks the basic setup - then in the next release we can look at updating config functions, as well as exposing any other widgets/features.

@jarvisteach jarvisteach added this to the 0.07 milestone Jul 10, 2017

@jarvisteach jarvisteach self-assigned this Jul 10, 2017

jarvisteach added a commit that referenced this issue Jul 23, 2017

Import ttk #189
Added function to import ttk widgets

This should cause any tk widgerts to be replaced with appropriate ttk widgets.

If called, it may well break lots of other bits - but that's OK for now.

@jarvisteach jarvisteach modified the milestones: 0.07, 0.08 Aug 2, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Aug 18, 2017

Owner

This doesn't really have any effect.

Need to change instantiation to actually be ttk.Button, etc....

Owner

jarvisteach commented Aug 18, 2017

This doesn't really have any effect.

Need to change instantiation to actually be ttk.Button, etc....

@jarvisteach

This comment has been minimized.

Show comment
Hide comment

jarvisteach added a commit that referenced this issue Aug 18, 2017

Switched some widgets to ttk (#189)
Added command line arguments to invoke ttk and set a ttk theme.

Functions to `.useTtk()` and `.setTtkTheme()`

If in ttk mode - `__positionWidget()` doesn't configure BG/FG

Updated these widgets to use ttk if requested:
* LabelFrame
* CheckBox
* RadioButton
* Button
* Label - not selectableLabel
* Entry - not AutoCompleteEntry

Scale has been started - but it uses ajScale - so need to work that out...
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Aug 18, 2017

Owner

Making progress - need to work out how to subclass using a switch for ttk (for SelectableLabel, AutoCompleteEntry, ajScale)- might not be possible...

Need to go through top-level frames, etc - make sure they are all ttk - might need to have ttk a constructor parameter to achieve this.

Need to look at scrollbars - on list boxes, scroll panes, etc

Owner

jarvisteach commented Aug 18, 2017

Making progress - need to work out how to subclass using a switch for ttk (for SelectableLabel, AutoCompleteEntry, ajScale)- might not be possible...

Need to go through top-level frames, etc - make sure they are all ttk - might need to have ttk a constructor parameter to achieve this.

Need to look at scrollbars - on list boxes, scroll panes, etc

jarvisteach added a commit that referenced this issue Aug 18, 2017

Initial testing for #187 & #195
Playing around with appJar vs. tkinter

Also, added ttk flag check to setFg & setBg #189
@mpmc

This comment has been minimized.

Show comment
Hide comment
@mpmc

mpmc Aug 18, 2017

Contributor

Just a small note, you may want to use "clam" as default style on Linux, "aqua" for Mac and "vista" for Windows, these are all built-in so shouldn't cause any issues, you could slap it in a try/except to ignore failed style changes.

Contributor

mpmc commented Aug 18, 2017

Just a small note, you may want to use "clam" as default style on Linux, "aqua" for Mac and "vista" for Windows, these are all built-in so shouldn't cause any issues, you could slap it in a try/except to ignore failed style changes.

@jarvisteach jarvisteach modified the milestones: 0.08, 0.09 Sep 16, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Oct 1, 2017

Owner

Have a solution for subclassing:

  • in the ttkFlag function set two global variables - labelBase & frameBase
  • then use these when subclassing, creating GUI, etc

However, note that a lot of special classes rely heavily on non-ttk supported features - and can't use a ttk.Label

Owner

jarvisteach commented Oct 1, 2017

Have a solution for subclassing:

  • in the ttkFlag function set two global variables - labelBase & frameBase
  • then use these when subclassing, creating GUI, etc

However, note that a lot of special classes rely heavily on non-ttk supported features - and can't use a ttk.Label

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Oct 1, 2017

Owner

The useTtk flag needs to be moved to the constructor - otherwise the base Frame can't be a ttk frame

Owner

jarvisteach commented Oct 1, 2017

The useTtk flag needs to be moved to the constructor - otherwise the base Frame can't be a ttk frame

jarvisteach added a commit that referenced this issue Oct 1, 2017

Introduced ttk dynamic subclassing
Now have two dynamic parents (#254, #189):
* frameBase - either Frame or ttk.Frame
* labelBase - either Label or ttk.Label

These are set when ttk flag is changed

They are used for subclassing, so far just two places:
* separator
* ParentBox

Also  used for top level frame.

jarvisteach added a commit that referenced this issue Oct 1, 2017

fixed testing #189
had to rearrange ttk test to end - as baseClasses remained into next
test…

jarvisteach added a commit that referenced this issue Oct 1, 2017

Added ttk constructor option
Now possible to set ttk in the ajar constructor

#254, #189
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Oct 1, 2017

Owner

useTtk now available in constructor - the only benefit is that the entire GUI is in a ttk.Frame instead of Frame - gets rid of the white border.

Owner

jarvisteach commented Oct 1, 2017

useTtk now available in constructor - the only benefit is that the entire GUI is in a ttk.Frame instead of Frame - gets rid of the white border.

jarvisteach added a commit that referenced this issue Oct 1, 2017

jarvisteach added a commit that referenced this issue Dec 3, 2017

@jarvisteach jarvisteach modified the milestones: 0.90, 1.0 Dec 10, 2017

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Dec 17, 2017

Contributor

@jarvisteach I've read the next_release docs and found how to change the background of most things, but the label in the LabelFrame doesn't change colour when I do: program.ttkStyle.configure("TLabel", background="white"), and I can't find the name for the checkbox layout, as I've tried to use TCheck, TCheckbox and TCheckBox but all return Layout xxx not found.

Also, I noticed a typo in the docs - with the code examples, you put background= as backgroun= :P

Contributor

TheSleepyPenguin commented Dec 17, 2017

@jarvisteach I've read the next_release docs and found how to change the background of most things, but the label in the LabelFrame doesn't change colour when I do: program.ttkStyle.configure("TLabel", background="white"), and I can't find the name for the checkbox layout, as I've tried to use TCheck, TCheckbox and TCheckBox but all return Layout xxx not found.

Also, I noticed a typo in the docs - with the code examples, you put background= as backgroun= :P

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Dec 18, 2017

Owner

Hi @The-Sleepy-Penguin could you give me some sample code to test out...

Owner

jarvisteach commented Dec 18, 2017

Hi @The-Sleepy-Penguin could you give me some sample code to test out...

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Dec 18, 2017

Contributor

@jarvisteach Here is some code that demonstrates the issue with Label Frames and Checkboxes:

from appJar import gui

with gui("appJar", useTtk=True) as app:

    app.ttkStyle.configure("TFrame", background="blue")
    app.ttkStyle.configure("TLabel", background="blue")
    app.ttkStyle.configure("TCheckBox", background="blue")
    app.ttkStyle.configure("TCheck", background="blue")
    app.setBg("blue")

    with app.labelFrame("Text"):
        app.setLabelFrameStyle("Text", "TFrame")
        app.addCheckBox("Option here...")
        app.setCheckBoxStyle("Option here...", "TCheckBox")

    app.addCheckBox("Another option...")
    app.setCheckBoxStyle("Another option...", "TCheck")

And here is the result:

capture

Hope this helps :)

Contributor

TheSleepyPenguin commented Dec 18, 2017

@jarvisteach Here is some code that demonstrates the issue with Label Frames and Checkboxes:

from appJar import gui

with gui("appJar", useTtk=True) as app:

    app.ttkStyle.configure("TFrame", background="blue")
    app.ttkStyle.configure("TLabel", background="blue")
    app.ttkStyle.configure("TCheckBox", background="blue")
    app.ttkStyle.configure("TCheck", background="blue")
    app.setBg("blue")

    with app.labelFrame("Text"):
        app.setLabelFrameStyle("Text", "TFrame")
        app.addCheckBox("Option here...")
        app.setCheckBoxStyle("Option here...", "TCheckBox")

    app.addCheckBox("Another option...")
    app.setCheckBoxStyle("Another option...", "TCheck")

And here is the result:

capture

Hope this helps :)

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Dec 18, 2017

Owner

OK, had a little play, try these:

  • app.ttkStyle.configure("TCheckbutton", background="blue")
  • app.ttkStyle.configure("TLabelframe", background="blue")
  • app.ttkStyle.configure('TLabelframe.Label', background='blue')

These set the default styles for the widgets, so you should't need to call .set XXX Style()

I've also discovered this:

  • app.ttkStyle.configure('.', background="blue")

ttk styles inherit from one another, so setting background on . will be inherited by all widgets.

I'm going to use this in appJar...

Owner

jarvisteach commented Dec 18, 2017

OK, had a little play, try these:

  • app.ttkStyle.configure("TCheckbutton", background="blue")
  • app.ttkStyle.configure("TLabelframe", background="blue")
  • app.ttkStyle.configure('TLabelframe.Label', background='blue')

These set the default styles for the widgets, so you should't need to call .set XXX Style()

I've also discovered this:

  • app.ttkStyle.configure('.', background="blue")

ttk styles inherit from one another, so setting background on . will be inherited by all widgets.

I'm going to use this in appJar...

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Dec 19, 2017

Contributor

@jarvisteach Thanks! Those worked a charm.

Contributor

TheSleepyPenguin commented Dec 19, 2017

@jarvisteach Thanks! Those worked a charm.

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Dec 19, 2017

Contributor

Okay... just tried this with message boxes and sub windows - app.ttkStyle.configure(".", background="blue") doesn't seem to work.
I was also wondering if the message box was themed by ttk, because it doesn't use the regular font used by ttk themes, and when I use .setMessageBg() instead, the background colour changes.

capture 2

When using label frames and third party ttk themes, unless I use app.ttkStyle.configure("TFrame", background="blue") and app.setLabelFrameStyle("title", "TFrame"), it too won't respond to app.ttkStyle.configure(".", background="blue").

Contributor

TheSleepyPenguin commented Dec 19, 2017

Okay... just tried this with message boxes and sub windows - app.ttkStyle.configure(".", background="blue") doesn't seem to work.
I was also wondering if the message box was themed by ttk, because it doesn't use the regular font used by ttk themes, and when I use .setMessageBg() instead, the background colour changes.

capture 2

When using label frames and third party ttk themes, unless I use app.ttkStyle.configure("TFrame", background="blue") and app.setLabelFrameStyle("title", "TFrame"), it too won't respond to app.ttkStyle.configure(".", background="blue").

jarvisteach added a commit that referenced this issue Dec 20, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Dec 20, 2017

Owner
  • Yup - there's no ttk MessageBox
  • I'll look into the extra themes - I also noticed the styling was;t changing for some built-in themes...
  • The SubWindow uses a TopLevel widget - this doesn't seem to support ttk, I'll do a bit more digging to see if it can, or maybe I'll need to put a Frame inside it that can support ttk...
Owner

jarvisteach commented Dec 20, 2017

  • Yup - there's no ttk MessageBox
  • I'll look into the extra themes - I also noticed the styling was;t changing for some built-in themes...
  • The SubWindow uses a TopLevel widget - this doesn't seem to support ttk, I'll do a bit more digging to see if it can, or maybe I'll need to put a Frame inside it that can support ttk...
@mpmc

This comment has been minimized.

Show comment
Hide comment
@mpmc

mpmc Dec 24, 2017

Contributor

@jarvisteach Is the non-ttk theme your own btw? It looks totally different to what I see elsewhere. The optionbox looks completely different too.


vs
image

Contributor

mpmc commented Dec 24, 2017

@jarvisteach Is the non-ttk theme your own btw? It looks totally different to what I see elsewhere. The optionbox looks completely different too.


vs
image

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Dec 28, 2017

Contributor

@jarvisteach I've found that .addIconButton() and .addImageButton() produce errors only when ttk is set to True, and align is set to None. eg:

from appJar import gui

with gui(useTtk=True) as app:
    app.addImageButton("button2", None, "Capture 2.PNG", align=None) # Uncomment this
    app.addIconButton("button", None, "md-play", align=None) # Or this

Produces this for .addImageButton():

2017-12-28 00:15:51,892 appJar:ERROR [Line 5->1522/__exit__]: ContextManager failed: unknown option "-justify"
Traceback (most recent call last):
  File "C:/Users/Penguin/Desktop/icon buttons.py", line 5, in <module>
    app.addImageButton("button2", None, "Capture 2.PNG", align=None)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6823, in addImageButton
    self.setButtonImage(title, imgFile, align)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6844, in setButtonImage
    but.config(image=image, compound=TOP, text="", justify=LEFT)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1338, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1329, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-justify"

and this for .addIconButton():

2017-12-28 00:15:43,907 appJar:ERROR [Line 4->1522/__exit__]: ContextManager failed: unknown option "-justify"
Traceback (most recent call last):
  File "C:/Users/Penguin/Desktop/icon buttons.py", line 4, in <module>
    app.addIconButton("button", None, "md-play", align=None)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6829, in addIconButton
    return self.addImageButton(title, func, icon, row, column, colspan, rowspan, align)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6823, in addImageButton
    self.setButtonImage(title, imgFile, align)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6844, in setButtonImage
    but.config(image=image, compound=TOP, text="", justify=LEFT)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1338, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1329, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-justify"

If ttk is set to False or the align parameter is filled, the error will not occur.

Contributor

TheSleepyPenguin commented Dec 28, 2017

@jarvisteach I've found that .addIconButton() and .addImageButton() produce errors only when ttk is set to True, and align is set to None. eg:

from appJar import gui

with gui(useTtk=True) as app:
    app.addImageButton("button2", None, "Capture 2.PNG", align=None) # Uncomment this
    app.addIconButton("button", None, "md-play", align=None) # Or this

Produces this for .addImageButton():

2017-12-28 00:15:51,892 appJar:ERROR [Line 5->1522/__exit__]: ContextManager failed: unknown option "-justify"
Traceback (most recent call last):
  File "C:/Users/Penguin/Desktop/icon buttons.py", line 5, in <module>
    app.addImageButton("button2", None, "Capture 2.PNG", align=None)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6823, in addImageButton
    self.setButtonImage(title, imgFile, align)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6844, in setButtonImage
    but.config(image=image, compound=TOP, text="", justify=LEFT)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1338, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1329, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-justify"

and this for .addIconButton():

2017-12-28 00:15:43,907 appJar:ERROR [Line 4->1522/__exit__]: ContextManager failed: unknown option "-justify"
Traceback (most recent call last):
  File "C:/Users/Penguin/Desktop/icon buttons.py", line 4, in <module>
    app.addIconButton("button", None, "md-play", align=None)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6829, in addIconButton
    return self.addImageButton(title, func, icon, row, column, colspan, rowspan, align)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6823, in addImageButton
    self.setButtonImage(title, imgFile, align)
  File "C:/Users/Penguin/Desktop\appJar\appjar.py", line 6844, in setButtonImage
    but.config(image=image, compound=TOP, text="", justify=LEFT)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1338, in configure
    return self._configure('configure', cnf, kw)
  File "C:\Program Files\Python35\lib\tkinter\__init__.py", line 1329, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: unknown option "-justify"

If ttk is set to False or the align parameter is filled, the error will not occur.

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Dec 28, 2017

Owner

@The-Sleepy-Penguin - try setting align="none" instead of None

Owner

jarvisteach commented Dec 28, 2017

@The-Sleepy-Penguin - try setting align="none" instead of None

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Dec 28, 2017

Contributor

@jarvisteach Thanks, that worked.

Contributor

TheSleepyPenguin commented Dec 28, 2017

@jarvisteach Thanks, that worked.

jarvisteach added a commit that referenced this issue Jan 2, 2018

Work on tabbed frame
Modded tabbed frame to work with ttk - required makerFunction #189
Added function to delete tabs #333

Change to setFonts functions #324
Updated docs
@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Jan 3, 2018

Contributor

@jarvisteach When using padding within a frame, the padding doesn't take the colour of the background:

from appJar import gui

with gui("appJar", useTtk=True) as app:
    app.setPadding(10, 10)
    app.ttkStyle.configure(".", background="white")
    app.addButton("Button", func=None)
    app.addButton("Button2", func=None)
    
    with app.frame("frame"):
        app.setPadding(10, 10)
        app.ttkStyle.configure(".", background="white")
        app.setBg("white")
        app.addButton("Button3", func=None)
        app.addButton("Button4", func=None)

And so results in this:
padding

Contributor

TheSleepyPenguin commented Jan 3, 2018

@jarvisteach When using padding within a frame, the padding doesn't take the colour of the background:

from appJar import gui

with gui("appJar", useTtk=True) as app:
    app.setPadding(10, 10)
    app.ttkStyle.configure(".", background="white")
    app.addButton("Button", func=None)
    app.addButton("Button2", func=None)
    
    with app.frame("frame"):
        app.setPadding(10, 10)
        app.ttkStyle.configure(".", background="white")
        app.setBg("white")
        app.addButton("Button3", func=None)
        app.addButton("Button4", func=None)

And so results in this:
padding

jarvisteach added a commit that referenced this issue Jan 16, 2018

Updates to useTtk #189
Removing option to setTtk mode later - makes things too complicated.
Must be set in the constructor.
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 16, 2018

Owner

Hi @The-Sleepy-Penguin - I don't know what causes this, it could be a ttk specific thing, where extra style needs to be set (maybe for the padding), or something else. I'll try to look into it in the next few days...

Owner

jarvisteach commented Jan 16, 2018

Hi @The-Sleepy-Penguin - I don't know what causes this, it could be a ttk specific thing, where extra style needs to be set (maybe for the padding), or something else. I'll try to look into it in the next few days...

jarvisteach added a commit that referenced this issue Jan 16, 2018

jarvisteach added a commit that referenced this issue Jan 16, 2018

ajFrame now uses frameBase #189
ajFrame now has constructor function, to dynamically inherit from
correct parent.
@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 16, 2018

Owner

@The-Sleepy-Penguin - OK resolved issue with frames - still can't get dynamic inheritance to work properly, so Frame is now dynamic, and should work with both ttk and regular styling.

Owner

jarvisteach commented Jan 16, 2018

@The-Sleepy-Penguin - OK resolved issue with frames - still can't get dynamic inheritance to work properly, so Frame is now dynamic, and should work with both ttk and regular styling.

jarvisteach added a commit that referenced this issue Jan 16, 2018

@TheSleepyPenguin

This comment has been minimized.

Show comment
Hide comment
@TheSleepyPenguin

TheSleepyPenguin Jan 18, 2018

Contributor

@jarvisteach Great! I can confirm that it works :)

Contributor

TheSleepyPenguin commented Jan 18, 2018

@jarvisteach Great! I can confirm that it works :)

jarvisteach added a commit that referenced this issue Jan 20, 2018

jarvisteach added a commit that referenced this issue Jan 21, 2018

updates to ttk #189 - theme now supported in contructor & as a proper…
…ty.\nmethod naming #235 - list renamed to listbox, _parsePos now accepts sticky & stretch

@jarvisteach jarvisteach reopened this Mar 3, 2018

@adtzlr

This comment has been minimized.

Show comment
Hide comment
@adtzlr

adtzlr May 17, 2018

@jarvisteach Would it be possible to integrate a themed Dropdown Widget (like OptionBox)? As @TheSleepyPenguin mentioned that the TTK ComboBox could replace the AppJar OptionBox?

adtzlr commented May 17, 2018

@jarvisteach Would it be possible to integrate a themed Dropdown Widget (like OptionBox)? As @TheSleepyPenguin mentioned that the TTK ComboBox could replace the AppJar OptionBox?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment