LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Who wants to write a basic About box for Linux Lite?
#25
(10-20-2018, 03:14 AM)Jerry link Wrote:#1 - Top logo also links to main website.
#2 - Add button somewhere logical that links to internal Help Manual. /usr/share/doc/litemanual/index.html
#3 - Could you please add our logo as a taskbar icon, points to in Series 4.x+: /usr/share/icons/Papirus/48x48/apps/liteicon.png (or whatever size suits)#4 - Rename app to llabout.py
#5 - pull and display the current LL version from /etc/llver file.
Hope you're enjoying the challenges. Smile

#1 - completed
#2 - completed***
#4 - completed

#3 - I was not able to do this, :-[ the various code I tried didn't display gif, png or ico, unsure where I was going wrong with it.
#5 - I am unable to do this, I know an idea of it (a thought) but not how to do it.
One way could be the text of current version to be made into a button, to its right add an output box, it somehow (the stuck point) needs to read the /etc/llver file, specifically the line stating the version, it then needs a variable defined that stores this version parameter , then the variable is output to the box when the button is clicked.
eg; in the donation builder app I made it runs a number generating script I wrote then stores these in a variable and outputs them to the output box on each click, I had help from an Open Source programmer in India on Stack Overflow of how to achieve the output as I could'nt get it to display.
So the user doesn't need to press the button it would need a way of doing an automated click, eg; so the app clicks the version button itself such as when the user clicks/executes to open the app, it also executes an automated click on the version button and so displays the version in the output box.That would occur so fast before the app is on screen and not be seen by the person opening the app, it would appear like the version number was already wrote there etc.
In a few years of practice I might be able to do #5 Smile but likely only in this type of way rather than a tidy more advanced way.

*** #2 in 2017 I wrote a post on the forum about how the local help manual for me, displays as a leafpad file of code rather than the actual manual.
On completing #2 for me this is how it displays, not the actual manual, it will need someone with a working local manual to test it and see if the manual appears or the leafpad file.

*** #2 I done some extra learning for this.
I put a menubar on the app for the help manual.
I then decided to make 2 cascading menus.

The menu named Help has -
Help Manual (local) - clicking this opens the manual offline on a users computer, using the default browser.
Help Manual (online) - clicking this opens the default browser and displays the online manual.
Ask community - clicking this opens the forum main page.

The Menu named Support has -
Donate and Shop, clicking either of these opens the main site page for Donating to LL, or the main page LL Shop, in the users default browser.

Additionally @ line #74 I have added and commented out a menu separator, to use this people just delete the # you place this line of code between which ever menu items in the cascades where you want to have a horizontal divider line in the menu, separating the Menu options.
More cascading menus can be added all the way along the menu bar for future needs.


[Image: llabout1.png]


[Image: llabout2.png]


[Image: llabout3.png]

The code -

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

from Tkinter import *
import webbrowser

url1 = 'https://www.freecinema2022.gq/development.html#team'
url2 = 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
url3 = 'https://www.freecinema2022.gq/'
url4 = 'https://www.freecinema2022.gq/manual/'
url5 = 'https://www.freecinema2022.gq/forums/index.php'
url6 = 'https://www.freecinema2022.gq/donate.html'
url7 = 'https://www.freecinema2022.gq/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)
window.config(menu=menubar)

helpmenu = Menu(menubar)
menubar.add_cascade(label='Help', menu=helpmenu)

supportmenu = Menu(menubar)
menubar.add_cascade(label='Support', menu=supportmenu)

def doPrint(  ): print 'doPrint'
def doSave(  ): print 'doSave'
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 doPrint(  ): print 'doPrint'
def doSave(  ): print 'doSave'
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()
Reply


Messages In This Thread
Re: Who wants to write a basic About box for Linux Lite? - by bitsnpcs - 10-20-2018, 05:15 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)