Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6863041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:44:03+00:00 2026-05-27T02:44:03+00:00

As a learning project, I’d like to set-out to make an ncurses-based UI for

  • 0

As a learning project, I’d like to set-out to make an ncurses-based UI for a program I had in mind, written in python.

After looking at urwid documentation, I cannot see anyway to create a simple slider (I need it to make a volume slider) that can be adjusted with the mouse.

Am I missing something in urwid, or is there a more convenient curses module to make such a slider?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:44:04+00:00Added an answer on May 27, 2026 at 2:44 am

    Curses is has very low level API – going back to the 1980’s C’programing.

    The Python wrappers have some higher level support for keyboard input and some other niceties, but they are few and apart and not nicely documented.

    The Python niceties do not include Mouse support (ok, you get your mouse state back in a tuple instead of having to create a C structure for that, so it is somewhat better).

    The idea is that one has to
    enable a curses Window
    enable “keypad” so that Python gives you full key codes
    enable a “mousemask” so that mouse events are sent to your app
    Detect the special “mouse_key” keyboard code in the getch function
    so that you can call “getmouse” to get the coordinates and button state.

    So there are no pre-made nice callbacks, you have to set-up the mainloop of your
    application to detect mouse events your self.

    This sample code performs the above steps for reading the mouse events and printing the mouse state to the screen – it should be enough to get one started in building some usefull mouse handling with curses:

    # -*- coding: utf-8 -*-
    import curses
    
    screen = curses.initscr()
    curses.noecho()
    curses.mousemask(curses.ALL_MOUSE_EVENTS)
    
    screen.keypad(1)
    
    char = ""
    
    try:
        while True:
            char = screen.getch()
    
            screen.addstr( str(char) + " ")
            if char == curses.KEY_MOUSE:
                screen.addstr (" |" + str(curses.getmouse()) + "| ")
    
    finally:
        screen.keypad(0)
        curses.endwin()
    
        curses.echo()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As a little learning project, I'd like to make a little app that reads
I have just started learning Erlang and am trying out some Project Euler problems
I'm a beginner in python and as a learning project i decided to just
I'm attempting to make a TinyURL clone in ASP.NET MVC as a learning project.
As a hobby/learning project, I'm writing a parser generator in Python. One of my
I am attempting to write a simple WPF learning project which creates a set
I want to write a module in python (This is the learning project) to
I am working on a personal learning project to make a Minecraft clone. It
So I'm working on just a learning project to expose myself to doing some
I'm currently working on a semantic web e-learning project. I've made an ontology and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.