Coder Social home page Coder Social logo

pythondialog's People

Contributors

frougon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pythondialog's Issues

Drop down menu, checkboxes and hidden content

Is it possible to create following elements inside of pythondialog boxes?

  • Drop down menu
  • Hidden content
  • Checkboxes

I attach screenshot of what I would like to see, however I didn't found it in documentation.
pythondialog
.

Graphical customization from python

Hello!

Amazing python project. Please tell me, is it possible to customize the interface inside python or do we always need to edit the ~/.dialogrc file?

Thanks in advance

Msgbox and input at the same time

Hello!

I am wondering if it is possible to have two widgets at the same time, one msgbox to display text and alter in realtime and a dialog text input under. Does the library support this? With the examples, running one widget after the other I'm not sure how to approach this.

Thanks

Additional examples

Hi,
I was playing with your code, and was wanting to offer some additional examples:
#! /usr/bin/env python3 import locale from dialog import Dialog
''' This is almost always a good thing to do at the beginning of your programs. '''
locale.setlocale(locale.LC_ALL, '')
''' You may want to use 'autowidgetsize=True' here (requires pythondialog >= 3.1) '''
d = Dialog(dialog="dialog")
''' Dialog.set_background_title() requires pythondialog 2.13 or later '''
d.set_background_title("YES/NO Help sample")
''' In pythondialog 3.x, you can compare the return code to d.OK, Dialog.OK or
"ok" (same object). In pythondialog 2.x, you have to use d.DIALOG_OK, which
is deprecated since version 3.0.0.'''
user_selection = d.yesno("Hi, this is a yes/no dialog box. You can use this to ask
questions that have an answer of either yes or no.
BTW, do you notice that long lines will be automatically
wrapped around so that they can fit in the box? You can
also control line breaking explicitly by inserting
'backslash n' at any place you like, but in this case,
auto wrap around will be disabled and you will have to
control line breaking yourself.", title="YES/NO BOX",width=0,height=0,help_button=True)
if user_selection == d.OK:
d.msgbox("You chose yes")
elif user_selection == d.CANCEL:
d.msgbox("You chose no")
elif user_selection == d.HELP:
d.msgbox("You pressed help")
elif user_selection == d.ESC:
d.msgbox("You pressed ESC")
else:
d.msgbox("WHAT DID YOU DO?!?!")

Text colored in dialog

Hello,

I use pythondialog, thank's for your job :)

I try to color text in dialog, but is not work correctly in Python3
In old version (python2), it's worked nice, but in python3, it's almost work.
When i used this : "\Z5mytext\Zn", text is colored, but \ character apears in text.

Can you help me with this ?

Regards,

Provide wheel package

Currently, pythondialog is only available as a tar.gz archive on PyPI. The problem with this is that it requires the end user to have the setuptools package installed.

Providing a wheel file would solve this.

All that would need to be done is replace

from distutils.core import setup

in setup.py with

from setuptools import setup

And then package it with python setup.py bdist_wheel

Unexpected Textbox widget autosize when file has tabulations

Hello,

When Dialog is created with autowidgetsize=True, the textbox widget does not size correctly if file contains Tab characters.

It is probably a dialog backend upstream issue (using 1.3-20160209 here), because passing "--textbox filename 0 0" gives this same result.

I worked around this behavior by computing dimensions using maxsize() so that window covers whole terminal regardless, but it's not an ideal situation.

Length of extended ASCII chars are counted wrong towards width

Using extended ASCII chars like โ–ˆ are counted with a larger width as displayed in the terminal. Meaning, the dialog window extends itself more than needed. Width can't be set to a lower setting, as it will throw a DialogError and the note Can't make sub-window at (42,9), size (1,194)

This picture can only be obtained through setting width=0:
image

Here is the original ASCII art, for testing of course ๐Ÿ˜….

xx______________________________________________________________xx
xx______________________________________________________________xx
xx________________________________________โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ__________xx
xx______________________________________โ–ˆโ–ˆ////////////โ–ˆโ–ˆ________xx
xx___________________________________ โ–ˆโ–ˆ////////////////โ–ˆโ–ˆ______xx
xx_________________________________ โ–ˆโ–ˆ//// __ ////// __ //โ–ˆโ–ˆ____xx
xx_________________________________ โ–ˆโ–ˆ////__โ–ˆโ–ˆ//////โ–ˆโ–ˆ__//โ–ˆโ–ˆ____xx
xx__________________________________โ–ˆโ–ˆ////__โ–ˆโ–ˆ//////โ–ˆโ–ˆ__//โ–ˆโ–ˆ____xx
xx__________________________________โ–ˆโ–ˆ//////////โ–ˆโ–ˆ////////โ–ˆโ–ˆ____xx
xx__________________________________โ–ˆโ–ˆ////โ–ˆโ–ˆโ–ˆโ–ˆ//////โ–ˆโ–ˆโ–ˆโ–ˆ//โ–ˆโ–ˆ____xx
xx________________________________โ–ˆโ–ˆ////โ–ˆโ–ˆ//////โ–ˆโ–ˆ//////โ–ˆโ–ˆ______xx
xx______________________โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ////////โ–ˆโ–ˆโ–ˆโ–ˆ//////โ–ˆโ–ˆโ–ˆโ–ˆ________xx
xx____________________โ–ˆโ–ˆ//////โ–ˆโ–ˆ////////โ–ˆโ–ˆ//////////โ–ˆโ–ˆ__โ–ˆโ–ˆ______xx
xx__________________โ–ˆโ–ˆ////////////////////////////////โ–ˆโ–ˆ________xx
xx________________โ–ˆโ–ˆ//////////////////////////////////โ–ˆโ–ˆ________xx
xx____โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ__โ–ˆโ–ˆ//////////////////////////////////โ–ˆโ–ˆ__________xx
xx__โ–ˆโ–ˆ////////โ–ˆโ–ˆโ–ˆโ–ˆ////////////////โ–ˆโ–ˆ////////////////โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ______xx
xxโ–ˆโ–ˆ////โ–ˆโ–ˆ////////////////////////โ–ˆโ–ˆ//////////โ–ˆโ–ˆ//โ–ˆโ–ˆ//////โ–ˆโ–ˆโ–ˆโ–ˆ__xx
xx__โ–ˆโ–ˆโ–ˆโ–ˆ//////////โ–ˆโ–ˆ////////////โ–ˆโ–ˆ//////////โ–ˆโ–ˆ//โ–ˆโ–ˆ//////โ–ˆโ–ˆ////โ–ˆโ–ˆxx
xxโ–ˆโ–ˆ////////////โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ////////โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ////////โ–ˆโ–ˆโ–ˆโ–ˆ__โ–ˆโ–ˆโ–ˆโ–ˆ////////โ–ˆโ–ˆxx
xx__โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ______โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ//////////โ–ˆโ–ˆ__________โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ__xx
xx______________________________โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ______________________xx
xx______________________________________________________________xx
xx______________________________________________________________xx

(It also suffice to just use a long enough line with extended ASCII symbols of course ๐Ÿ™Š)

EDIT: I figured out how to circumvent this: Setting tab_len=1 for this window allows setting the size, but also forces one to set it manually for this window.

\n and \\n handled the same by msgbox

from dialog import Dialog
d = Dialog()
d.msgbox("a\nb")
d.msgbox("c\\nd")
print("a\nb")
print("c\\nd")

Both msgboxes show two lines.
The print shows something different.

Is this on purpose?

Debian, python3-dialog 3.5.1, Python 3.7.3, dialog 1.3-20190211-1

Wrong documentation for mixedform

The documentation has a wrong assignment for attributes in elements description

it says:
0 := hidden
1 := read only

but should be:
0 := text
1 := hidden
2 := read only

Showing color in dialog with \Z escape sequences

Trying to create a msgbox with color as d.msgbox("\Z1test\Zn regular",color=True) renders the string text in red with the text regular in the usual black color. However, the \ characters preceeding both the Zs remain in the text. So the above text gets rendered as \ test \ regular with the colors correct.

Am I missing something?
image

pythondialog = 3.5.3
dialog = Version: 1.3-20171209

Support urwid? / Is there a pure-python dialog utility

I'd like to have the menuconfig-like interface in a pure python utility. It seems that the urwid library has some half-baked dialog.py in its examples - I wonder if this could be baked in into the lib so that no external exe would need to be called if urwid exists;

or, pythondialog speaks of "dialog-like" backends; are you aware of any that would be pure python or at least installable on Linux / Mac with pip?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.