#SpinBox widget
Explore tagged Tumblr posts
webbazaar0101 · 3 years ago
Text
PyQt5 QSpinBox Widget
PyQt is the python GUI library which provides us almost every GUI widget. In this tutorial, we will study PyQt5 QSpinBox Widget with example. Python QSpinBox is a widget which presents the user with a textbox that displays an integer with up/down button on its right side. The value in the textbox increases/decreases if the up/down button is pressed. The default minimum value is 0 and maximum…
Tumblr media
View On WordPress
0 notes
pythonfan-blog · 3 years ago
Link
4 notes · View notes
mypythonteacher · 3 years ago
Text
Tkinter, Args, Kwargs, and GUI
The Tkinter module is used to create GUIs.
Creating Windows and Labels with Tkinter
To import TKinter: import tkinter
To initialise a new object and create a window: window = tkinter.Tk()
To keep the window open: window.mainloop() (at the end of the program)
To change the title of the window: window.title("string")
To change the size of the window so it scales to the minimum size: window.minsize(width=500, height=300)
To make a label of the Tkinter Label class: my_label = tkinter.Label(text="I am a Label", font=("Arial", 24, "bold")
To make it display and place it in the screen and centre it: my_label.pack()
To make it display and place it in the screen and left justify it: my_label.pack(side="left")
.pack() takes **kw
Advanced Arguments
You can create arguments with default values
def my_function(a=1, b=2, c=3)
then you can provide an alternative value, or not.
Unlimited Arguments: *args, many positional arguments
The asterisk is important and means the function can take any number of arguments.
Tumblr media
Unlimited Arguments: *kwargs, many keyworded arguments
You are essentially passing in a dictionary; {'add': 3, 'multiply': 5}
Tumblr media
Thus, you can work with it like a dictionary.
You can also pass in a positional argument.
Tumblr media
This will return 25.
Tkinter has a lot of kwargs... a lot of default arguments.
Tumblr media
BUT, if you don't specify a make and call my_car.make, it will error out.
Tumblr media
Watch the brackets for get(), but now it will return None.
This is how to create a class with lots of optional keyword arguments.
Buttons, Entry and Setting Components Options
in Tkinter, you can set options at creation, using keyword arguments
fred = Button(self, fg="red", bg="blue)
or after object creation, treating the option name like a dictionary index
fred["bg"] = "blue"
or use the config() method to update multiple attributes after object creation
fred.config(fg="red", bg="blue)
To import every class from Tkinter: from tkinter import *
then you don't have to type button = tkinter.Button()
To create a button and attach a function to that button:
Tumblr media
To create an entry field and display it:
input = Entry() input.pack()
To get what is typed in an entry field and do something with it:
Tumblr media
Tkinter has a bunch of widgets including: labels, buttons, entry, and also text boxes (multiple lines of text), spin boxes(counters that go up and down), scales (sliders), checkbuttons(on or off), radio buttons (selectors) and listboxes (of choices you can pick from),
To create entry boxes:
Tumblr media
To create a multi-line text box:
Tumblr media
The 1.0 means getting hold of the text from the start
To create a spinbox:
Tumblr media
To create a scale:
Tumblr media
To create a checkbox:
Tumblr media
To create a radio button (to select between two options of which you can only select one)
Tumblr media
To create a listbox:
Tumblr media
This code can be used the same each time. Just cut and paste. END and listbox select doesn't need to be understood yet.
Tkinter Layout Managers: pack(), place() and grid()
Make sure .pack() is at the end of each widget.
All that .pack() does is pack the widgets next to each other, and by default goes from top to bottom.
To put in different places: .pack(side="left")
To put something in a precise position: .place(x=, y=)
Without pack, place or grid, nothing will be shown.
The downside of place is that it is SO specific.
To put something in a grid position: widget.grid(column=, row=)
The grid system is relative to other components. Start with the thing you want at the top left, and then work relative to the first thing.
CAREFUL: You can't mix grid and pack in the same program!
To add padding around the outside of the window: window.config(padx=20, pady=20)
To add padding around a widget: my_label.config(padx=20, pady=20)
0 notes
kjunichi · 5 years ago
Text
How to use math input in GIMP | Libre Graphics World [はてなブックマーク]
Tumblr media
How to use math input in GIMP | Libre Graphics World
One semi-hidden feature in GIMP is that you can do simple calculations in the spinbox widgets where you input numeric values. This tutorials explains how it works and all the advanced things you can do there. So this recent repost on Twitter by the GIMP account (and originally by Andrei Rybak) bl...
Tumblr media Tumblr media
from kjw_junichiのはてなブックマーク https://ift.tt/32sYePE
0 notes
illuminarch · 6 years ago
Text
Foi mais um mês movimentado em relação ao KDEfazendo um balanço de todo este mês de outubro. O desenvolvedor do KDE, Nate Graham, continua com seu ritual de todos os domingos de recapitular os importantes desenvolvimentos do KDE na semana passada. Seu post mais recente no blog detalha algumas das mudanças que ocorreram no KDE nos últimos dias. A principal alteração corrige a apresentação de slides no KDE Plasma 5.17.1.
O plasma agora tem um “modo de edição” acessível através do menu de contexto da área de trabalho e painel, o que permite editar widgets e painéis. Isso deve limpar significativamente as coisas e melhorar o fluxo de trabalho para ajustar a área de trabalho do Plasma;
Uma correção de falha em que as apresentações de slides do papel de parede podem travar a tela de bloqueio, a ser corrigida no Plasma 5.17.1. Essa falha ocorreria ao usar o recurso de apresentação de slides do papel de parede e definido para exibir as imagens em uma ordem aleatória. Quando todas as imagens foram mostradas uma vez e para randomizar outra ordem de exibição das imagens, pode ocorrer um acidente. A correção está aqui para os interessados;
Melhorias contínuas nas configurações do sistema KDE;
Melhorias na interface do Kirigami;
Várias outras melhorias na interface do usuário.
(Outros) Novos Recursos do KDE Plasma 5.17.1 que corrige apresentação de slides no papel de parede
 itens da barra de ferramentas nos aplicativos baseados em Kirigami agora respondem dinamicamente à quantidade de espaço disponível: quando há muito espaço horizontal, todos aparecem com ícones e texto completo. À medida que a quantidade de espaço diminui, eles perdem o texto e passam para um menu excedente no tamanho direito da janela:
Video Player
Correções de bugs e melhorias de desempenho
Corrigida uma falha comum com apresentações de slides de papel de parede que podiam até travar sua tela de bloqueio;
O KRunner não trava mais quando usado para alternar para uma janela aberta;
As configurações de aceleração “Flat” da página System Settings Mouse realmente finalmente funcionam agora!;
As Configurações do sistema não exibem mais itens vazios na página inicial de páginas que não estão instaladas;
Na página Configuração das configurações do sistema, as visualizações de cada tela conectada agora são maiores e mais utilizáveis quando mais de uma tela é conectada, e o texto dentro delas não é mais elidido;
Os widgets na área de trabalho não perdem mais suas posições quando um monitor adicional é conectado;
O atalho padrão do KRunner agora funciona novamente para novas instalações;
O widget Minimizar tudo agora desimplica corretamente as janelas que são minimizadas quando outra janela foi aberta após o primeiro uso;
A página Decorações da janela de configurações do sistema não possui mais um layout corrompido ao usar idiomas verbais como alemão ou português do Brasil;
Corrigida a entrada do teclado ao compartilhar a tela no Wayland;
A Bandeja do sistema agora exibe corretamente ícones especiais “Preciso de atenção” para aplicativos (como o Konversation) que os definiram;
A página Cor noturna das configurações do sistema agora mostra unidades para a configuração “Duração da transição”:
Quando você usa a funcionalidade “Obter novidade nas várias páginas de Configurações do sistema, as pesquisas subsequentes de algo diferente de uma página diferente não exibem mais itens da primeira pesquisa;
O ícone usado nos botões “Get new [thing]” agora implica o download em vez de marcar algo como favorito:
O Konsole não deixa mais para trás arquivos potencialmente grandes na pasta temporária do sistema quando falha ou é encerrada pelo sistema ao desligar ou reiniciar;
O Dolphin agora seleciona o arquivo correto ao usar a digitação antecipada do teclado e selecionar um arquivo previamente selecionado.
Melhorias na interface do usuário
SpinBox na janela de configurações do applet volume de áudio, a janela de configurações do widget do tempo, e vários ajustes do sistema páginas agora permitem que você digite números usando o teclado para que você não precisa ir insano manualmente clicando nas pequenas setas para alterar os valores;
O campo de pesquisa do Discover agora está focado por padrão, para que você possa pesquisar assim que o programa abrir;
Na página Configuração das configurações do sistema, agora é mais óbvio que telas podem ser arrastadas para reorganizá-las:
A página Cor noturna das configurações do sistema agora exibe rótulos explicativos abaixo do controle deslizante de temperatura da cor para que você saiba o que fará:
O Discover agora mostra a categoria de cada item nas listas de pesquisa e navegação:
A página Cor noturna das configurações do sistema agora possui um rótulo explicativo para ajudá-lo a entender o que faz:
Os cabeçalhos de lista nos aplicativos baseados no QWidgets e nas páginas Configurações do sistema agora têm a mesma aparência do software baseado em QML mais recente:
KDE Plasma Mobile também tem novidades
  Enquanto isso, para os interessados no KDE Plasma Mobile, eles lançam outra atualização semanal, cobrindo melhorias na interface de venda, revisão geral das configurações de WiFi, melhorias no calendário e outras alterações nesta versão otimizada para dispositivos móveis do KDE.
  KDE Plasma 5.17.1 corrige apresentação de slides Foi mais um mês movimentado em relação ao KDEfazendo um balanço de todo este mês de outubro. 
0 notes
vrheadsets · 8 years ago
Text
Unreal Engine Releases Third Preview for 4.15
Last week Epic Games launched the first preview for Unreal Engine 4.15, bring with it support for the PlayStation Aim controller. Today the company has released its third preview for the upcoming build, adding a significant amount of fixes.
For 4.15’s preview three Epic hasn’t added any major features like it did in the first, simply fine tuning the build further, fixing issues users are coming across as they demo it. On the VREditor side of things only one problem has need to be fixed, to do with a “Laser not hidden on MotionControllers with docked Menu/UI Panels”.  So either that’s reassuring few issues have been found or not enough people are using it to find anything.
Two engines currently dominate the virtual reality (VR) industry in terms of development, Unreal Engine and Unity. Over the past year both have been making significant strides to improve VR support, namely adding editors that can work whilst using VR head-mounted displays (HMDs). While Unity Technologies purely work on developing its game engine, Epic also creates its own titles helping showcase what can be achieved with Unreal Engine.
One of these is Robo Recall, set to be released in early 2017. An evolution of earlier tech demo Bullet Train, Robo Recall will be a free exclusive for Oculus Touch owners. The studio released another dev diary yesterday, discussing the team updated the former to the latter.
Checkout the full changelog below for 4.15 Preview 3, and for any further updates from Epic Games keep reading VRFocus.
Fixed for Preview 3:
Fixed! UE-40753 [CrashReport] UE4Editor_LevelEditor!FLevelEditorActionCallbacks::Paste_CanExecute() [leveleditoractions.cpp:1602] Fixed! UE-41130 User Defined Enums may lose their display names on upgrade to 4.15 Fixed! UE-41073 Crash when opening blueprint with collapsed nodes with structure output, split pin Fixed! UE-41072 Implemented Interfaces are not added to nativization list Fixed! UE-41070 Data only blueprints are not not nativized when flagged to do so Fixed! UE-41071 Parent blueprint not added to nativization array if only child saved Fixed! UE-41190 Ensure failure !bStaticCall nativizing blueprint calling blueprint function library function Fixed! UE-37815 BulkData Async loading remains in memory Fixed! UE-38767 [CrashReport] UE4Editor_Core!FArchive::SerializeCompressed() [archive.cpp:447] Fixed! UE-41125 Static mesh LODs other than LOD0 cannot be set to screen sizes greater than 1 Fixed! UE-41220 Crash when adding multiple collision types to a mesh Fixed! UE-40791 The Play button on the ForceFeedback effect icons is missing Fixed! UE-41294 Reimporting skeletal mesh clears material references from material slots Fixed! UE-41126 HISMC UpdateInstanceTransform blueprint function does not update bounds correctly Fixed! UE-40525 CommitMapChange doesn’t fully deal with sub-levels Fixed! UE-40939 Inconsistent line ending prompts occur in Visual Studio after adding Vehicle C++ feature pack Fixed! UE-41163 Material curves keeps resetting to 0.f Fixed! UE-41216 Additive Pose Asset arms become over exteneded when blended with reference pose Fixed! UE-41082 Fix crash on cache bone with sub instance Fixed! UE-40945 Crash trying to import facial animations Fixed! UE-41143 Crash when launching engine without a windows audio device enabled. Fixed! UE-41112 Crash when Dragging Skeletal Mesh with Apex Clothing into Level Fixed! UE-37270 Changing transform of simulated component during physics freezes motion Fixed! UE-39884 Foliage LODs are do not appear to use the base LODs lightmap any longer Fixed! UE-40480 Ensure encountered when using the Copy/Paste sub-tool in sculpt mode Fixed! UE-41271 Localization broken in cooked builds due to missing meta-data during cook Fixed! UE-41253 Mobile / Use Full Precision not working on Metal Fixed! UE-41023 Scene capture produces black texture on encoding devices with mobileHDR == false Fixed! UE-39451 Web browser widget causes app to crash when packaging for Distribution on Android Fixed! UE-40927 Projects crash on Android when trying to load mips Fixed! UE-39911 Failed checkSlow(IsInGameThread()); in UWorld::GetWorldSettings Fixed! UE-40524 Issues with PrepareMapChange/CommitMapChange and Level Collections Fixed! UE-40810 Crash opening Infiltrator packaged on Windows for Linux Fixed! UE-41198 Spinbox value decimal point is moved one place to the right when edited on Android Fixed! UE-36984 TestPAL fails to compile Fixed! UE-41146 Crash in editor when audio is playing Fixed! UE-40451 Blueprint – User configured tvOS Bundle ID is not set properly during packaging Fixed! UE-40392 GitHub 3111 : Fix environment variable name to the correct legacy LINUX_ROOT. Fixed! UE-40023 UFE Deploying and launching a packaged build on Linux fails due to invalid directory Fixed! UE-40761 Various audio clips are not playing in Elemental Demo on PS4 Fixed! UE-41209 PS4SharePlay errors are produced when launching onto PS4 with UnrealFrontEnd Fixed! UE-41183 Crash Occurs when changing the ‘Max Metal Shader Standard To Target’ option within iOS Project Settings Fixed! UE-38691 Launch On from Windows to Linux fails with missing GLSL_430 shaders Fixed! UE-37016 GitHub 2842 : [Linux] Fix bootstrap script so it is independent on working dir Fixed! UE-40956 Rare crash occurs in CoreAudio in Vehicle Game on Mac when quitting. Fixed! UE-41042 GitHub 3160 : Fixed `ADB` being incorrectly set to `ANDROID_HOME`. Fixed! UE-41079 NpToolkit2 fails to initialize in 6CPU mode on PS4 Fixed! UE-41167 Shader complexity is broken in the forward renderer Fixed! UE-39754 Crash: Changing Material Property Overrides of Material Instance Fixed! UE-40736 “Too many texture coordinate sets” warnings in KiteDemo Fixed! UE-40873 Shadows of small movable components popping out Fixed! UE-41193 Update material node tooltips based on 4.15 preview feedback. Fixed! UE-40482 Ensure occurs when turning on Constraints in Advanced Show Flags Fixed! UE-40980 Fix mem corruption on particles on PS4 Fixed! UE-40724 Large round stone in ZenGarden is no longer reflective Fixed! UE-41138 Flickering in Elemental Demo when TemporalAA and bloom is enabled Fixed! UE-41099 SpeedTree Material No Longer Compiles With Texture Coordinate Node In BaseColor Fixed! UE-41008 LogApexClothingUtils Warning when opening QAGame Fixed! UE-41311 Time snapping interval is not updating the timeline in UMG Sequencer Fixed! UE-40682 Animations that overlap and blend together break when undoing Fixed! UE-40758 Events on frame 0 fire twice Fixed! UE-41019 Sequencer does not refresh on creating a new camera if Default Property Tracks is empty Fixed! UE-41010 Fix up actors remove actor from sequencer folder. Fixed! UE-41148 Logstreaming warning when opening the editor: “LogStreaming:Warning: Failed to read file ‘Common/RoundedSelection_16x.png’ error.” Fixed! UE-40070 VREditor: Laser not hidden on MotionControllers with docked Menu/UI Panels
from VRFocus http://ift.tt/2kkSPlK
0 notes
pythonfan-blog · 3 years ago
Link
18 notes · View notes
pythonfan-blog · 4 years ago
Link
7 notes · View notes
pythonfan-blog · 4 years ago
Link
7 notes · View notes
mypythonteacher · 3 years ago
Text
Tkinter Cookbook
from tkinter import *
#Creating a new window and configurations window = Tk() window.title("Widget Examples") window.minsize(width=500, height=500)
#Labels label = Label(text="This is old text") label.config(text="This is new text") label.pack()
#Buttons def action(): print("Do something")
#calls action() when pressed button = Button(text="Click Me", command=action) button.pack()
#Entries entry = Entry(width=30) #Add some text to begin with entry.insert(END, string="Some text to begin with.") #Gets text in entry print(entry.get()) entry.pack()
#Text text = Text(height=5, width=30) #Puts cursor in textbox. text.focus() #Adds some text to begin with. text.insert(END, "Example of multi-line text entry.") #Get's current value in textbox at line 1, character 0 print(text.get("1.0", END)) text.pack()
#Spinbox def spinbox_used(): #gets the current value in spinbox. print(spinbox.get()) spinbox = Spinbox(from_=0, to=10, width=5, command=spinbox_used) spinbox.pack()
#Scale #Called with current scale value. def scale_used(value): print(value) scale = Scale(from_=0, to=100, command=scale_used) scale.pack()
#Checkbutton def checkbutton_used(): #Prints 1 if On button checked, otherwise 0. print(checked_state.get()) #variable to hold on to checked state, 0 is off, 1 is on. checked_state = IntVar() checkbutton = Checkbutton(text="Is On?", variable=checked_state, command=checkbutton_used) checked_state.get() checkbutton.pack()
#Radiobutton def radio_used(): print(radio_state.get()) #Variable to hold on to which radio button value is checked. radio_state = IntVar() radiobutton1 = Radiobutton(text="Option1", value=1, variable=radio_state, command=radio_used) radiobutton2 = Radiobutton(text="Option2", value=2, variable=radio_state, command=radio_used) radiobutton1.pack() radiobutton2.pack()
#Listbox def listbox_used(event): # Gets current selection from listbox print(listbox.get(listbox.curselection()))
listbox = Listbox(height=4) fruits = ["Apple", "Pear", "Orange", "Banana"] for item in fruits: listbox.insert(fruits.index(item), item) listbox.bind("<<ListboxSelect>>", listbox_used) listbox.pack() window.mainloop()
0 notes