You are Here:
Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section



Who wants to write a basic About box for Linux Lite?

Author (Read 30151 times)

0 Members and 2 Guests are viewing this topic.

Re: Who wants to write a basic About box for Linux Lite?
« Reply #58 on: October 26, 2018, 03:47:47 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Thank you :)
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #57 on: October 26, 2018, 03:46:22 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
icon removed
Here you can see what I had wrote previously from the image, how the menubar shrinks to fit the font size of the menus, if an icon was used there at the same size it would be this size, whereas it expanded to produce the same space above the icon rather than above the fonts, as the icon was too big, so it made it too big a space above the fonts.It might help someone else if they weren't sure about it. Last icon was 24x24 ,so it might work with 16x16 icon instead.





Code: [Select]
#!/usr/bin/env python
# code by - bitsnpcs & Jerry Bezencon (2018)

from Tkinter import *
import webbrowser

url1 = 'https://www.linuxliteos.com/development.html#team'
url2 = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
url3 = 'https://www.linuxliteos.com/'
url4 = 'https://www.linuxliteos.com/manual/'
url5 = 'https://www.linuxliteos.com/forums/index.php'
url6 = 'https://www.linuxliteos.com/donate.html'
url7 = 'https://www.linuxliteos.com/shop.html'
url8 = '/usr/share/doc/litemanual/index.html'

# open browser and display url at line 7 thru 13
def OpenUrl1():
    webbrowser.open(url1)

def OpenUrl2():
    webbrowser.open(url2)

def OpenUrl3():
    webbrowser.open(url3)
   
def OpenUrl4():
    webbrowser.open(url4)
   
def OpenUrl5():
    webbrowser.open(url5)

def OpenUrl6():
    webbrowser.open(url6)
   
def OpenUrl7():
    webbrowser.open(url7)

def OpenUrl8():
    webbrowser.open(url8)
   
def close_window():
    window.destroy()
   
# Make window
window = Tk()
window.title("About Linux Lite")
window.geometry("242x250")
window.resizable(0,0)

# adding a menubar
menubar = Menu(window, bg='#ffe082')
window.config(menu=menubar)

supportmenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Support', menu=supportmenu)

contributemenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Contribute', menu=contributemenu)

def doSupport(  ): print 'doSupport'

supportmenu.add_command(label='Help Manual (local)', command=OpenUrl8)
supportmenu.add_command(label='Help Manual (online)', command=OpenUrl4)
supportmenu.add_command(label='Forums', command=OpenUrl5)
supportmenu = Menu(menubar)

def doContribute(  ): print 'doContribute'

contributemenu.add_command(label='Donate', command=OpenUrl6)
contributemenu.add_command(label='Shop', command=OpenUrl7)
contributemenu = Menu(menubar)

# uncomment below to add separator in menu, place code where seperator is wanted
# filemenu.add_separator(  )

# adding a logo
photo=PhotoImage(file="logo.png")
l1 = Button(image=photo,width=160, height=59, command=OpenUrl3)
l1.grid(row=4, column=0)
l1.place(x=36.3, y=12)
l1 = Label(window, text="     ")
l1.grid(row=5, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=6, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=7, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=8, column=0, sticky=W)

# adding a frame for ll website button
GUIFrame1=Frame(window)
GUIFrame1.grid(row=11, column=0)

#adding a frame for last row of buttons
GUIFrame2=Frame(window)
GUIFrame2.grid(row=13, column=0)

# define title, nym, year
l2 = Label(window, text=u"\u00a9Copyright 2012-2018 Jerry Bezencon", fg="grey", font="none 8")
l2.grid(row=15, column=0)

l3 = Label(window, text="     ")
l3.grid(row=0, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=12, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=14, column=0, sticky=W)

l4 = Label(window, text="Current Version:")
l4.grid(row=9, column=0)

# r/w file to gui background
file = open("/etc/llver")
data = file.read()
file.close()
Results = Label(window, text = data)
Results.grid(row = 10, column = 0)

# ll website button
l5 = Label(GUIFrame1, text=" ")
l5.grid(row=11, column=0, sticky=W)
Button(GUIFrame1, text="Visit Linux Lite website", width=16, command=OpenUrl3).grid(row=11, column=0)

# last row of buttons
l6 = Label(GUIFrame2, text=" ")
l6.grid(row=13, column=0)
Button(GUIFrame2, text="Credits", width=6, command=OpenUrl1).grid(row=13, column=1)
Button(GUIFrame2, text="License", width=6, command=OpenUrl2).grid(row=13, column=2)
Button(GUIFrame2, text="Close", width=6, command=window.destroy).grid(row=13, column=3)

window.mainloop()
« Last Edit: October 26, 2018, 04:09:30 AM by bitsnpcs »
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #56 on: October 26, 2018, 03:22:08 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Shall I remove it from the menubar ?



Yes please.
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #55 on: October 26, 2018, 03:21:02 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
Shall I remove it from the menubar ?
I cannot get it on the taskbar.
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #54 on: October 26, 2018, 03:14:19 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Looks like there has been a slight misunderstanding with the small LL logo in the top left hand corner of the app. That icon is supposed to be on the taskbar. Sorry for any confusion.
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #53 on: October 23, 2018, 02:24:46 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
updated info line


Code: [Select]
#!/usr/bin/env python
# code by - bitsnpcs & Jerry Bezencon (2018)

from Tkinter import *
import webbrowser

url1 = 'https://www.linuxliteos.com/development.html#team'
url2 = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
url3 = 'https://www.linuxliteos.com/'
url4 = 'https://www.linuxliteos.com/manual/'
url5 = 'https://www.linuxliteos.com/forums/index.php'
url6 = 'https://www.linuxliteos.com/donate.html'
url7 = 'https://www.linuxliteos.com/shop.html'
url8 = '/usr/share/doc/litemanual/index.html'

# open browser and display url at line 7 thru 13
def OpenUrl1():
    webbrowser.open(url1)

def OpenUrl2():
    webbrowser.open(url2)

def OpenUrl3():
    webbrowser.open(url3)
   
def OpenUrl4():
    webbrowser.open(url4)
   
def OpenUrl5():
    webbrowser.open(url5)

def OpenUrl6():
    webbrowser.open(url6)
   
def OpenUrl7():
    webbrowser.open(url7)

def OpenUrl8():
    webbrowser.open(url8)
   
def close_window():
    window.destroy()
   
# Make window
window = Tk()
window.title("About Linux Lite")
window.geometry("242x250")
window.resizable(0,0)

# adding a menubar
menubar = Menu(window, bg='#ffe082')
window.config(menu=menubar)

photovar1 = PhotoImage(file='mlogo.png')
llmenu = Menubutton(menubar, image=photovar1)
menubar.add_cascade(image=photovar1, menu=llmenu)

supportmenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Support', menu=supportmenu)

contributemenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Contribute', menu=contributemenu)

def doSupport(  ): print 'doSupport'

supportmenu.add_command(label='Help Manual (local)', command=OpenUrl8)
supportmenu.add_command(label='Help Manual (online)', command=OpenUrl4)
supportmenu.add_command(label='Forums', command=OpenUrl5)
supportmenu = Menu(menubar)

def doContribute(  ): print 'doContribute'

contributemenu.add_command(label='Donate', command=OpenUrl6)
contributemenu.add_command(label='Shop', command=OpenUrl7)
contributemenu = Menu(menubar)

# uncomment below to add separator in menu, place code where seperator is wanted
# filemenu.add_separator(  )

# adding a logo
photo=PhotoImage(file="logo.png")
l1 = Button(image=photo,width=160, height=59, command=OpenUrl3)
l1.grid(row=4, column=0)
l1.place(x=36.3, y=12)
l1 = Label(window, text="     ")
l1.grid(row=5, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=6, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=7, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=8, column=0, sticky=W)

# adding a frame for ll website button
GUIFrame1=Frame(window)
GUIFrame1.grid(row=11, column=0)

#adding a frame for last row of buttons
GUIFrame2=Frame(window)
GUIFrame2.grid(row=13, column=0)

# define title, nym, year
l2 = Label(window, text=u"\u00a9Copyright 2012-2018 Jerry Bezencon", fg="grey", font="none 8")
l2.grid(row=15, column=0)

l3 = Label(window, text="     ")
l3.grid(row=0, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=12, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=14, column=0, sticky=W)

l4 = Label(window, text="Current Version:")
l4.grid(row=9, column=0)

# r/w file to gui background
file = open("/etc/llver")
data = file.read()
file.close()
Results = Label(window, text = data)
Results.grid(row = 10, column = 0)

# ll website button
l5 = Label(GUIFrame1, text=" ")
l5.grid(row=11, column=0, sticky=W)
Button(GUIFrame1, text="Visit Linux Lite website", width=16, command=OpenUrl3).grid(row=11, column=0)

# last row of buttons
l6 = Label(GUIFrame2, text=" ")
l6.grid(row=13, column=0)
Button(GUIFrame2, text="Credits", width=6, command=OpenUrl1).grid(row=13, column=1)
Button(GUIFrame2, text="License", width=6, command=OpenUrl2).grid(row=13, column=2)
Button(GUIFrame2, text="Close", width=6, command=window.destroy).grid(row=13, column=3)

window.mainloop()
« Last Edit: October 24, 2018, 08:52:56 PM by bitsnpcs »
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #52 on: October 23, 2018, 02:03:35 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
I understand now when you wrote earlier about it is quite a long way away.


 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #51 on: October 23, 2018, 01:50:03 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
When does LL 5.0 get released ? - There's no official Roadmap until the end of Series 4.x, but you can assume around 1st June 2020.

Do you have a list of apps, or a poll of apps for LL 5.0 and beyond ? Not yet, to early. I'm still considering what if much at all, I can introduce to 4.x We are pretty complete now.
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #50 on: October 23, 2018, 01:41:55 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
#5 - reads my /etc/llver file perfectly, no matter what I put in it. Nice job :)

 :)

In regards to Themes - Id like to keep the app as simple as possible for the moment. What I did have an idea about is 'Send Logs' from the Menu.
This would make a tar.gz and upload all relevant logs that devs need to see in order to fix a problem. This is already an About box on steroids, so we may need to just concentrate on refinement for now.

The "Send Logs" sounds like it would be a useful app for both members and devs.

Concentrating on refinement sounds good.

When does LL 5.0 get released ?

Do you have a list of apps, or a poll of apps for LL 5.0  and beyond ?
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #49 on: October 23, 2018, 12:26:07 AM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Awesome :)
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #48 on: October 22, 2018, 11:54:50 PM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
I have changed the code at my end to match now.Your changes make it clear as to what each menu is for :)
I have also made code changes -
I duplicated a label "l3" and did not add a grid below it so it was not in use anyhow, but the line needed deleting as if a grid is added at a future check it would change the spacing.Look for two of this line one below another, around line 108
Code: [Select]
l3 = Label(window, text="     ")The other changes were tidying, in the define area, lines 38 and lines 41 are now switched with each others line.So that all the define of the Open Url are together and tidy.Rather than 1-7 of Open Url, then a def close window, then def open url 8.





Code with the edits above done, and also with all of your edits done, so I have it all up to date now.

Code: [Select]
#!/usr/bin/env python
# code by bitsnpcs

from Tkinter import *
import webbrowser

url1 = 'https://www.linuxliteos.com/development.html#team'
url2 = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
url3 = 'https://www.linuxliteos.com/'
url4 = 'https://www.linuxliteos.com/manual/'
url5 = 'https://www.linuxliteos.com/forums/index.php'
url6 = 'https://www.linuxliteos.com/donate.html'
url7 = 'https://www.linuxliteos.com/shop.html'
url8 = '/usr/share/doc/litemanual/index.html'

# open browser and display url at line 7 thru 13
def OpenUrl1():
    webbrowser.open(url1)

def OpenUrl2():
    webbrowser.open(url2)

def OpenUrl3():
    webbrowser.open(url3)
   
def OpenUrl4():
    webbrowser.open(url4)
   
def OpenUrl5():
    webbrowser.open(url5)

def OpenUrl6():
    webbrowser.open(url6)
   
def OpenUrl7():
    webbrowser.open(url7)

def OpenUrl8():
    webbrowser.open(url8)
   
def close_window():
    window.destroy()
   
# Make window
window = Tk()
window.title("About Linux Lite")
window.geometry("242x250")
window.resizable(0,0)

# adding a menubar
menubar = Menu(window, bg='#ffe082')
window.config(menu=menubar)

photovar1 = PhotoImage(file='mlogo.png')
llmenu = Menubutton(menubar, image=photovar1)
menubar.add_cascade(image=photovar1, menu=llmenu)

supportmenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Support', menu=supportmenu)

contributemenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Contribute', menu=contributemenu)

def doSupport(  ): print 'doSupport'

supportmenu.add_command(label='Help Manual (local)', command=OpenUrl8)
supportmenu.add_command(label='Help Manual (online)', command=OpenUrl4)
supportmenu.add_command(label='Forums', command=OpenUrl5)
supportmenu = Menu(menubar)

def doContribute(  ): print 'doContribute'

contributemenu.add_command(label='Donate', command=OpenUrl6)
contributemenu.add_command(label='Shop', command=OpenUrl7)
contributemenu = Menu(menubar)

# uncomment below to add separator in menu, place code where seperator is wanted
# filemenu.add_separator(  )

# adding a logo
photo=PhotoImage(file="logo.png")
l1 = Button(image=photo,width=160, height=59, command=OpenUrl3)
l1.grid(row=4, column=0)
l1.place(x=36.3, y=12)
l1 = Label(window, text="     ")
l1.grid(row=5, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=6, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=7, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=8, column=0, sticky=W)

# adding a frame for ll website button
GUIFrame1=Frame(window)
GUIFrame1.grid(row=11, column=0)

#adding a frame for last row of buttons
GUIFrame2=Frame(window)
GUIFrame2.grid(row=13, column=0)

# define title, nym, year
l2 = Label(window, text=u"\u00a9Copyright 2012-2018 Jerry Bezencon", fg="grey", font="none 8")
l2.grid(row=15, column=0)

l3 = Label(window, text="     ")
l3.grid(row=0, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=12, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=14, column=0, sticky=W)

l4 = Label(window, text="Current Version:")
l4.grid(row=9, column=0)

# r/w file to gui background
file = open("/etc/llver")
data = file.read()
file.close()
Results = Label(window, text = data)
Results.grid(row = 10, column = 0)

# ll website button
l5 = Label(GUIFrame1, text=" ")
l5.grid(row=11, column=0, sticky=W)
Button(GUIFrame1, text="Visit Linux Lite website", width=16, command=OpenUrl3).grid(row=11, column=0)

# last row of buttons
l6 = Label(GUIFrame2, text=" ")
l6.grid(row=13, column=0)
Button(GUIFrame2, text="Credits", width=6, command=OpenUrl1).grid(row=13, column=1)
Button(GUIFrame2, text="License", width=6, command=OpenUrl2).grid(row=13, column=2)
Button(GUIFrame2, text="Close", width=6, command=window.destroy).grid(row=13, column=3)

window.mainloop()
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #47 on: October 22, 2018, 10:40:26 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
In regards to Themes - Id like to keep the app as simple as possible for the moment. What I did have an idea about is 'Send Logs' from the Menu.
This would make a tar.gz and upload all relevant logs that devs need to see in order to fix a problem. This is already an About box on steroids, so we may need to just concentrate on refinement for now.
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #46 on: October 22, 2018, 10:37:01 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
#5 - reads my /etc/llver file perfectly, no matter what I put in it. Nice job :)
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #45 on: October 22, 2018, 10:36:03 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8775
    Posts
  • Reputation: 801
  • Linux Lite Member
    • View Profile
    • Linux Lite OS

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Menu changes:



Code: [Select]
#!/usr/bin/env python
# code by bitsnpcs

from Tkinter import *
import webbrowser

url1 = 'https://www.linuxliteos.com/development.html#team'
url2 = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
url3 = 'https://www.linuxliteos.com/'
url4 = 'https://www.linuxliteos.com/manual/'
url5 = 'https://www.linuxliteos.com/forums/index.php'
url6 = 'https://www.linuxliteos.com/donate.html'
url7 = 'https://www.linuxliteos.com/shop.html'
url8 = '/usr/share/doc/litemanual/index.html'

# open browser and display url at line 7 thru 13
def OpenUrl1():
    webbrowser.open(url1)

def OpenUrl2():
    webbrowser.open(url2)

def OpenUrl3():
    webbrowser.open(url3)
   
def OpenUrl4():
    webbrowser.open(url4)
   
def OpenUrl5():
    webbrowser.open(url5)

def OpenUrl6():
    webbrowser.open(url6)
   
def OpenUrl7():
    webbrowser.open(url7)

def close_window():
    window.destroy()
   
def OpenUrl8():
    webbrowser.open(url8)
   
# Make window
window = Tk()
window.title("About Linux Lite")
window.geometry("242x250")
window.resizable(0,0)

# adding a menubar
menubar = Menu(window, bg='#ffe082')
window.config(menu=menubar)

photovar1 = PhotoImage(file='mlogo.png')
llmenu = Menubutton(menubar, image=photovar1)
menubar.add_cascade(image=photovar1, menu=llmenu)

supportmenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Support', menu=supportmenu)

contributemenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Contribute', menu=contributemenu)

def doSupport(  ): print 'doSupport'

supportmenu.add_command(label='Help Manual (local)', command=OpenUrl8)
supportmenu.add_command(label='Help Manual (online)', command=OpenUrl4)
supportmenu.add_command(label='Forums', command=OpenUrl5)
supportmenu = Menu(menubar)

def doContribute(  ): print 'doContribute'

contributemenu.add_command(label='Donate', command=OpenUrl6)
contributemenu.add_command(label='Shop', command=OpenUrl7)
contributemenu = Menu(menubar)

# uncomment below to add separator in menu, place code where seperator is wanted
# filemenu.add_separator(  )

# adding a logo
photo=PhotoImage(file="logo.png")
l1 = Button(image=photo,width=160, height=59, command=OpenUrl3)
l1.grid(row=4, column=0)
l1.place(x=36.3, y=12)
l1 = Label(window, text="     ")
l1.grid(row=5, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=6, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=7, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=8, column=0, sticky=W)

# adding a frame for ll website button
GUIFrame1=Frame(window)
GUIFrame1.grid(row=11, column=0)

#adding a frame for last row of buttons
GUIFrame2=Frame(window)
GUIFrame2.grid(row=13, column=0)

# define title, nym, year
l2 = Label(window, text=u"\u00a9Copyright 2012-2018 Jerry Bezencon", fg="grey", font="none 8")
l2.grid(row=15, column=0)

l3 = Label(window, text="     ")
l3.grid(row=0, column=0, sticky=W)
l3 = Label(window, text="     ")
l3 = Label(window, text="     ")
l3.grid(row=12, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=14, column=0, sticky=W)

l4 = Label(window, text="Current Version:")
l4.grid(row=9, column=0)

# r/w file to gui background
file = open("/etc/llver")
data = file.read()
file.close()
Results = Label(window, text = data)
Results.grid(row = 10, column = 0)

# ll website button
l5 = Label(GUIFrame1, text=" ")
l5.grid(row=11, column=0, sticky=W)
Button(GUIFrame1, text="Visit Linux Lite website", width=16, command=OpenUrl3).grid(row=11, column=0)

# last row of buttons
l6 = Label(GUIFrame2, text=" ")
l6.grid(row=13, column=0)
Button(GUIFrame2, text="Credits", width=6, command=OpenUrl1).grid(row=13, column=1)
Button(GUIFrame2, text="License", width=6, command=OpenUrl2).grid(row=13, column=2)
Button(GUIFrame2, text="Close", width=6, command=window.destroy).grid(row=13, column=3)

window.mainloop()
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #44 on: October 22, 2018, 07:16:20 PM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3237
    Posts
  • Reputation: 305
    • View Profile
    • Try to Grow

  • Kernel: 4.x
Spacing done.



code
Code: [Select]
#!/usr/bin/env python
# code by bitsnpcs

from Tkinter import *
import webbrowser

url1 = 'https://www.linuxliteos.com/development.html#team'
url2 = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
url3 = 'https://www.linuxliteos.com/'
url4 = 'https://www.linuxliteos.com/manual/'
url5 = 'https://www.linuxliteos.com/forums/index.php'
url6 = 'https://www.linuxliteos.com/donate.html'
url7 = 'https://www.linuxliteos.com/shop.html'
url8 = '/usr/share/doc/litemanual/index.html'

# open browser and display url at line 7 thru 13
def OpenUrl1():
    webbrowser.open(url1)

def OpenUrl2():
    webbrowser.open(url2)

def OpenUrl3():
    webbrowser.open(url3)
   
def OpenUrl4():
    webbrowser.open(url4)
   
def OpenUrl5():
    webbrowser.open(url5)

def OpenUrl6():
    webbrowser.open(url6)
   
def OpenUrl7():
    webbrowser.open(url7)

def close_window():
    window.destroy()
   
def OpenUrl8():
    webbrowser.open(url8)
   
# Make window
window = Tk()
window.title("About Linux Lite")
window.geometry("242x250")
window.resizable(0,0)

# adding a menubar
menubar = Menu(window, bg='#ffe082')
window.config(menu=menubar)

photovar1 = PhotoImage(file='mlogo.png')
llmenu = Menubutton(menubar, image=photovar1)
menubar.add_cascade(image=photovar1, menu=llmenu)

helpmenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Help', menu=helpmenu)

supportmenu = Menu(menubar, bg='#ffe082', tearoff=0)
menubar.add_cascade(label='Support', menu=supportmenu)

def doHelp(  ): print 'doHelp'

helpmenu.add_command(label='Help Manual (local)', command=OpenUrl8)
helpmenu.add_command(label='Help Manual (online)', command=OpenUrl4)
helpmenu.add_command(label='Ask Community', command=OpenUrl5)
helpmenu = Menu(menubar)

def doSupport(  ): print 'doSupport'

supportmenu.add_command(label='Donate', command=OpenUrl6)
supportmenu.add_command(label='Shop', command=OpenUrl7)
supportmenu = Menu(menubar)

# uncomment below to add separator in menu, place code where seperator is wanted
# filemenu.add_separator(  )

# adding a logo
photo=PhotoImage(file="logo.png")
l1 = Button(image=photo,width=160, height=59, command=OpenUrl3)
l1.grid(row=4, column=0)
l1.place(x=36.3, y=12)
l1 = Label(window, text="     ")
l1.grid(row=5, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=6, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=7, column=0, sticky=W)
l1 = Label(window, text="     ")
l1.grid(row=8, column=0, sticky=W)

# adding a frame for ll website button
GUIFrame1=Frame(window)
GUIFrame1.grid(row=11, column=0)

#adding a frame for last row of buttons
GUIFrame2=Frame(window)
GUIFrame2.grid(row=13, column=0)

# define title, nym, year
l2 = Label(window, text=u"\u00a9Copyright 2012-2018 Jerry Bezencon", fg="grey", font="none 8")
l2.grid(row=15, column=0)

l3 = Label(window, text="     ")
l3.grid(row=0, column=0, sticky=W)
l3 = Label(window, text="     ")
l3 = Label(window, text="     ")
l3.grid(row=12, column=0, sticky=W)
l3 = Label(window, text="     ")
l3.grid(row=14, column=0, sticky=W)

l4 = Label(window, text="Current Version:")
l4.grid(row=9, column=0)

# r/w file to gui background
file = open("/etc/llver")
data = file.read()
file.close()
Results = Label(window, text = data)
Results.grid(row = 10, column = 0)

# ll website button
l5 = Label(GUIFrame1, text=" ")
l5.grid(row=11, column=0, sticky=W)
Button(GUIFrame1, text="Visit Linux Lite website", width=16, command=OpenUrl3).grid(row=11, column=0)

# last row of buttons
l6 = Label(GUIFrame2, text=" ")
l6.grid(row=13, column=0)
Button(GUIFrame2, text="Credits", width=6, command=OpenUrl1).grid(row=13, column=1)
Button(GUIFrame2, text="License", width=6, command=OpenUrl2).grid(row=13, column=2)
Button(GUIFrame2, text="Close", width=6, command=window.destroy).grid(row=13, column=3)

window.mainloop()
 

 

-->
X Close Ad

Linux Lite 6.6 FINAL Released - Support for 22 Languages Added - See Release Announcement Section