You are Here:
Install Updates Gimp Error - see Security & Bug Fixes Section Sticky



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

Author (Read 5957 times)

0 Members and 4 Guests are viewing this topic.

Re: Who wants to write a basic About box for Linux Lite?
« Reply #30 on: October 21, 2018, 04:22:14 PM »
 

firenice03

  • Rockin' the FREE World
  • Global Moderator
  • Platinum Level Poster
  • *****
  • 1150
    Posts
  • Country: us
  • Reputation: 223
  • Linux Lite Member

  • Linux Lite: 4.6 64bit

  • CPU: AMD E2//Atom X5//AMD Phenom II X2

  • MEMORY: 4Gb

  • VIDEO CARD: AMD Mullin Radeon R2//Intel//AMD/ATI RS880

Thanks for showing the code.  It is too complex for me, I understand <1% of it.
It is only useful to let me know, I shouldn't have wasted the time on my efforts, and could have put it to a better use lol, and so I will pass and not embarrass myself further  :) 
I'm not 100% on what I'm seeing - but your doing a great job @bitsnpcs !! - I'm more of a steal a line of code when I can see what it does kinda coder  ;) ... What Jerry's code is (looks like) the Lite Control Center from the 2 series - I was having that feeling perusing the code then saw the name and png extension.. Perhaps knowing/seeing the codes finished product will allow help understand what the lines are doing??
If you don't recall...
https://www.linuxliteos.com/forums/linux-lite-software-development/lite-control-center-beta/msg17031/#msg17031
LL 4.6 UEFI 64 bit ASUS E402W - AMD E2 (Quad) 1.5Ghz  - 4GB - AMD Mullins Radeon R2
LL 4.6 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL 4.4 UEFI 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
LL 3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express
RETIRED LL 2.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA
Running Linux Lite since LL2.2
 


Re: Who wants to write a basic About box for Linux Lite?
« Reply #31 on: October 21, 2018, 05:20:01 PM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
@firenice03 thank you  :) for explaining what it is.


 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #32 on: October 21, 2018, 11:37:33 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7081
    Posts
  • Country: nz
  • Reputation: 663
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 3.8 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 960
Do you have the code for the colored menu version?
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #33 on: October 22, 2018, 07:43:45 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
#1 - done
#2 - done
#3 - now done ***
#4 - done

#5 - not done

Asked additional tasks - all done

#3*** I don't have the 4 series icon, I borrowed this icon from the forum banner (which displays before login in but not after), to resize it to 24x24 in GIMP and crop, I had to untick the chain to get the size, so it then does not maintain aspect ratio and becomes distorted. A properly made icon appears with the correct aspect ratio, I checked this using one of the Gnome icons.

Additionals -
removed dashy lines from menus so they look better, image 2 below.








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("242x242")
window.resizable(0,0)
window.overrideredirect(True)   
window.eval('tk::PlaceWindow %s center' % window.winfo_pathname(window.winfo_id()))

# 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, tearoff=0)
menubar.add_cascade(label='Help', menu=helpmenu)

supportmenu = Menu(menubar, 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.grid(row=10, 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: 5.0")
l4.grid(row=9, 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 22, 2018, 10:02:19 AM by bitsnpcs
 

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

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
Coloured menus task. Mouse over of menu title or any item in the menu makes it change colour to grey.






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("242x242")
window.resizable(0,0)
window.overrideredirect(True)   
window.eval('tk::PlaceWindow %s center' % window.winfo_pathname(window.winfo_id()))

# 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.grid(row=10, 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: 5.0")
l4.grid(row=9, 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 22, 2018, 08:06:42 AM by bitsnpcs
 

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

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7081
    Posts
  • Country: nz
  • Reputation: 663
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 3.8 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 960
Looking terrific @bitsnpcs FYI - on 2 or more monitors, the About window appears right in the middle of each screens bezel, so it is effectively cut in half. Can we have it so that the window appears in the middle of the main screen? Thank you.
 

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

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
Example. Tying in Logo, Menu and main site.

 

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

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
I don't understand the code, and will pass on this as well as #5 (as stated earlier) but here it is to use multiple monitors -

"Tkinter doesn't see if there are 2 or more monitors extended horizontal or vertical. So, you 'll get the total resolution of all screens together and your window will end-up somewhere in the middle of the screens.
PyQt from the other hand, doesn't see multi-monitors environment either, but it will get only the resolution of the Top-Left monitor (Imagine 4 monitors, 2 up and 2 down making a square). So, it does the work by putting the window on center of that screen. If you don't want to use both, PyQt and Tkinter, maybe it would be better to go with PyQt from start." - quoted from Stack Overflow.

Multiple Monitors using tkinter AND PyQT4 -https://stackoverflow.com/questions/3352918/how-to-center-a-window-on-the-screen-in-tkinter


I have re-added the titlebar.
Do you want the colour of menu drop down changed back to grey or left as is ?




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("242x242")
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.grid(row=10, 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: 5.0")
l4.grid(row=9, 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 22, 2018, 09:53:53 AM by bitsnpcs
 

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

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7081
    Posts
  • Country: nz
  • Reputation: 663
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 3.8 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 960
There's no hurry here and keep in mind, you're not obligated to do anything you don't want to :) Series 5.x is a long way off.
You've already made tremendous progress, I'm very proud of you.
 

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

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7081
    Posts
  • Country: nz
  • Reputation: 663
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 3.8 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 960
Shall I remove the centering, and re-add the titlebar to the code so it works for users with multiple monitors too ? - Yes please.
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #40 on: October 22, 2018, 09:54:55 AM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
Shall I remove the centering, and re-add the titlebar to the code so it works for users with multiple monitors too ? - Yes please.

Done this it appears above x3 posts in thread.
Last Edit: October 22, 2018, 09:56:43 AM by bitsnpcs
 

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

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
Some thoughts -
  • adding a menu on menubar named "Themes" (or something else), to the About app.
  • contained inside would be titles such as Red, Yellow, Orange, Green, Flags
The graphic designer members would be needed to -
  • make transparent banners of Linux lite, one with each of the Official feather colours , red having a red feather, yellow a yellow feather, as an example of this see the About app current main website banner logo to give an idea.
  • make logos for the menu bar to match each.
  • make feathers wrapped in a flag, every flag of the nations in the community, maybe also feathers with,  a cross , a rainbow one. It wouldn't be complete without a ganja leaf feather on a caduceus.
Programmers would then -
attach a script to each menu title so when for example blue is clicked, it changes the menu bar to blue, the main website banner logo feather to blue and the menubar icon feather to blue .
Clicking Flags would open a Gui window (as there would be too many option for inside a menu), in this window would be the icon of each nations flag and the universal use flags like ganja leaf, rainbow, or cross.
Clicking any of these would change the menu bar to the base colour hex code, eg; such as ganja leaf green menubar, ganja leaf on the menubar icon, and on the main website banner icon.
Clicking the flag would also close the flag selection window at the end of its script.
Or an okay button to confirm, apply and close the flag window.

Furthering on that would be
  • when clicking a colour or flag, this applies the users choice throughout all Lite Software Apps on their system, and the XFCE Main Menu icon, in 1 click of okay, so they match.
  • That would be Lite Themes an internal theme system for Lite Apps, potential new in LL 5.0?
Lite themes once made for the About App could be integrated in to every Lite App, by adding a button that links to and runs it through the About app, code file.
This could also be made to allow it to do things like VLC Player does, such as apply a santa hat, on everyone's feather for Christmas done during a Lite Install Updates, that is removed at the appropriate time during a future/date specific Lite Install Updates, done via install updates as this maintains security, and doesn't slow or present future problems with bandwidth or security of an open port.
It also actively encourages users to update their system in a regular fashion, which is also About Linux Lite.
Last Edit: October 22, 2018, 05:28:28 PM by bitsnpcs
 

Re: Who wants to write a basic About box for Linux Lite?
« Reply #42 on: October 22, 2018, 05:41:00 PM »
 

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
#1 - done
#2 - done
#3 - done
#4 - done
#5 - now done* - the code reads the /etc/llver file stores its text and writes this to the gui.

* - it reads version as LL 3.0 on this computer which is what it also says inside the file if browsed to, and it is LL 3.2.

I need to adjust the spacing, of current version and version # lines, til it is a bit better.
Added a space row, a new row, renumbered some rows.
Increased the app size by 8 pixels in height so the copyright line was in the gui.




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()
Last Edit: October 22, 2018, 07:16:55 PM by bitsnpcs
 

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

bitsnpcs

  • Platinum Level Poster
  • **********
  • 3185
    Posts
  • Country: 00
  • Reputation: 300

  • Linux Lite: 3.2 64bit
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()
 

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

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 7081
    Posts
  • Country: nz
  • Reputation: 663
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 3.8 64bit

  • CPU: Intel Xeon Dual CPU's E5645 2.4GHz 12 Cores

  • MEMORY: 16Gb

  • VIDEO CARD: nVidia GeForce GTX 960
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()
 


Tags:
 


Install Updates Gimp Error - see Security & Bug Fixes Section Sticky