Dialog background color linux

Thread: Reset background color for bash dialog?

CrewDK is offlineA Carafe of Ubuntu

Reset background color for bash dialog?

I got some script where i’m useing dialog command.

#!/bin/bash tmpfile=$(mktemp tmp.XXXXXXX --tmpdir=/tmp 2>/dev/null) || tmpfile=/tmp/test$$ dialog --backtitle "Конфигурация сервера" \ --title "Установка" \ --clear \ --checklist "Список заданий" 15 50 4 \ 1 "Install LAMP" on \ 2 "Setup IPTABLES" on 2> $ if [ "$?" -eq "0" ]; then grep -o 1 $tmpfile > /dev/null 2>&1 if [ "$?" -eq "0" ]; then echo 123 fi grep -o 2 $tmpfile > /dev/null 2>&1 if [ "$?" -eq "0" ]; then echo 123 fi else echo "Interrupted" fi

Is there any way to reset background and font colours back to default black\white after filling dialog «form»? I tried to use «clear» but it’s no use.

Habitual is offlineGeek

Re: Reset background color for bash dialog?

Background color of the dialog or the terminal after the dialog/script exits?
And running your script, selections are both pre-filled. Both chosen.

CrewDK is offlineA Carafe of Ubuntu

Re: Reset background color for bash dialog?

I’m talking about blue BG color. For example, i want to see some output after running dialog and this blue BG a little bit noisy
Is there any way after close dialog form itself reset this colours back to default?

Attached Images

Attached Images

  • 2016-06-18_014002.jpg (16.1 KB, 5 views)

Skaperen is offlineUbuntu addict and loving it

Join Date Jan 2010 Location Wheeling WV USA Beans 2,003 —> Beans 2,003 Distro Xubuntu 20.04 Focal Fossa

Re: Reset background color for bash dialog?

what did the clear command do? the dialog man page says that is what to do. maybe your terminal was not set to the default colors. try clear by itself and tell us what happens. what terminal are you running? maybe setterm can do what you need.

Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweeter

Habitual is offlineGeek

Re: Reset background color for bash dialog?

CrewDK is offlineA Carafe of Ubuntu

Re: Reset background color for bash dialog?

Yeah. I know about clear, but some strange way when I run this script in ssh session it looks for me like this. If i run this script in real terminal — all works just fine. So what wrong with ssh session or what?

Attached Images

Attached Images

  • 2016-06-20_061620.jpg (43.9 KB, 3 views)
Читайте также:  How to use vpn on linux

CrewDK is offlineA Carafe of Ubuntu

Re: Reset background color for bash dialog?

QuoteOriginally Posted by Skaperen View Post

How can I check what terminal i’m running? Sorry i’m still not so good with linux Are you talking about that?

I tried use setterm with —default and —reset but this didn’t helped me

Skaperen is offlineUbuntu addict and loving it

Join Date Jan 2010 Location Wheeling WV USA Beans 2,003 —> Beans 2,003 Distro Xubuntu 20.04 Focal Fossa

Re: Reset background color for bash dialog?

it look like you are running putty. maybe it is emulating a terminal wrong. install ubuntu (in a virtual machine) and use that

Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweeter

CrewDK is offlineA Carafe of Ubuntu

Re: Reset background color for bash dialog?

I’m running «Xshell». This is too ssh client for windows PCs. And as I already told — when I’m running this script in «real» terminal (yeah, on virtual machine) — all works fine. So maybe some one have any idea what setting for ssh client I should look for?

Skaperen is offlineUbuntu addict and loving it

Join Date Jan 2010 Location Wheeling WV USA Beans 2,003 —> Beans 2,003 Distro Xubuntu 20.04 Focal Fossa

Re: Reset background color for bash dialog?

Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweeter

  • Site Areas
  • Settings
  • Private Messages
  • Subscriptions
  • Who’s Online
  • Search Forums
  • Forums Home
  • Forums
  • The Ubuntu Forum Community
    1. Ubuntu Official Flavours Support
      1. New to Ubuntu
      2. General Help
      3. Installation & Upgrades
      4. Hardware
      5. Desktop Environments
      6. Networking & Wireless
      7. Multimedia Software
    2. Ubuntu Specialised Support
      1. Ubuntu Development Version
      2. Security
      3. Virtualisation
      4. Ubuntu Servers, Cloud and Juju
        1. Server Platforms
        2. Ubuntu Cloud and Juju
      5. Gaming & Leisure
        1. Emulators
      6. Wine
      7. Development & Programming
        1. Packaging and Compiling Programs
        2. Development CD/DVD Image Testing
        3. Ubuntu Application Development
        4. Ubuntu Dev Link Forum
        5. Programming Talk
        6. Repositories & Backports
          1. Ubuntu Backports
            1. Bug Reports / Support
      8. System76 Support
      9. Apple Hardware Users
    3. Ubuntu Community Discussions
      1. Ubuntu, Linux and OS Chat
        1. Recurring Discussions
        2. Full Circle Magazine
      2. The Cafe
        1. Cafe Games
      3. Market
      4. Mobile Technology Discussions (CLOSED)
      5. Announcements & News
      6. Weekly Newsletter
      7. Membership Applications
      8. The Fridge Discussions
      9. Forum Council Agenda
      10. Forum Feedback & Help
        1. Request a LoCo forum
      11. Resolution Centre
    4. Other Discussion and Support
      1. Other OS Support and Projects
        1. Other Operating Systems
          1. Ubuntu/Debian BASED
          2. Debian
          3. MINT
          4. Arch and derivatives
          5. Fedora/RedHat and derivatives
          6. Mandriva/Mageia
          7. Slackware and derivatives
          8. openSUSE and SUSE Linux Enterprise
          9. Mac OSX
          10. PCLinuxOS
          11. Gentoo and derivatives
          12. Windows
          13. BSD
          14. Any Other OS
      2. Assistive Technology & Accessibility
      3. Art & Design
      4. Education & Science
      5. Documentation and Community Wiki Discussions
      6. Tutorials
        1. Outdated Tutorials & Tips
      7. Ubuntu Women
      8. Ubuntu LoCo Team Forums
        1. Americas LoCo Teams
          1. Argentina Team
            1. Software
            2. Hardware
            3. Comunidad
          2. Arizona Team — US
          3. Arkansas Team — US
          4. Brazil Team
          5. California Team — US
          6. Canada Team
          7. Centroamerica Team
          8. Chile Team
            1. Comunidad
            2. Hardware
            3. Software
            4. Instalaci�n y Actualizaci�n
          9. Colombia Team — Colombia
          10. Georgia Team — US
          11. Illinois Team
          12. Indiana — US
          13. Kentucky Team — US
          14. Maine Team — US
          15. Minnesota Team — US
          16. Mississippi Team — US
          17. Nebraska Team — US
          18. New Mexico Team — US
          19. New York — US
          20. North Carolina Team — US
          21. Ohio Team — US
          22. Oklahoma Team — US
          23. Oregon Team — US
          24. Pennsylvania Team — US
          25. Peru Team
          26. Texas Team — US
          27. Uruguay Team
          28. Utah Team — US
          29. Virginia Team — US
          30. West Virginia Team — US
        2. Asia and Oceania LoCo Teams
          1. Australia Team
          2. Bangladesh Team
          3. Hong Kong Team
          4. Myanmar Team
          5. Philippine Team
          6. Singapore Team
        3. Europe, Middle East, and African (EMEA) LoCo Teams
          1. Albania Team
          2. Catalan Team
          3. Portugal Team
          4. Egypt Team
          5. Georgia Team
          6. Ireland Team — Ireland
          7. Kenyan Team — Kenya
          8. Kurdish Team — Kurdistan
          9. Lebanon Team
          10. Morocco Team
          11. Saudi Arabia Team
          12. Sudan Team
          13. Tunisia Team
        4. Other Forums & Teams
        5. LoCo Archive
          1. Afghanistan Team
          2. Alabama Team — US
          3. Alaska Team — US
          4. Algerian Team
          5. Andhra Pradesh Team — India
          6. Austria Team
          7. Bangalore Team
          8. Bolivia Team
          9. Cameroon Team
          10. Colorado Team — US
          11. Connecticut Team
          12. Costa Rica Team
          13. Delhi Team
          14. Ecuador Team
          15. El Salvador Team
          16. Florida Team — US
          17. Galician LoCo Team
          18. Greek team
          19. Hawaii Team — US
          20. Honduras Team
          21. Idaho Team — US
          22. Iowa Team — US
          23. Jordan Team
          24. Kansas Team — US
          25. Libya Team
          26. Louisiana Team — US
          27. Maryland Team — US
          28. Massachusetts Team
          29. Michigan Team — US
          30. Missouri Team — US
          31. Montana Team — US
          32. Namibia Team
          33. Nevada Team — US
          34. New Hampshire Team — US
          35. New Jersey Team — US
          36. Northeastern Team — US
          37. Panama Team
          38. Paraguay Team
          39. Qatar Team
          40. Quebec Team
          41. Rhode Island Team — US
          42. Senegal Team
          43. South Carolina Team — US
          44. South Dakota Team — US
          45. Switzerland Team
          46. Tamil Team — India
          47. Tennessee Team — US
          48. Trinidad & Tobago Team
          49. Uganda Team
          50. United Kingdom Team
          51. US LoCo Teams
          52. Venezuela Team
          53. Wales Team
          54. Washington DC Team — US
          55. Washington State Team — US
          56. Wisconsin Team
          57. Yemen Team
          58. Za Team — South Africa
          59. Zimbabwe Team
Читайте также:  Linux удалить файл только чтение

Источник

wxWidgets Discussion Forum

Dialog background color on Gnome (Ubuntu) Topic is solved

Do you have a typical platform dependent issue you’re battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.

Dialog background color on Gnome (Ubuntu)

Post by razoredge » Thu Jul 09, 2009 8:13 pm

On Windows XP I used the following code to get the background color of a dialog for a self drawn control:

wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE) 

But on Gnome I get a color which is darker than the dialog background color. I tried a lot of the enums for GetColour(), but I can’t find one with the right color.

Which enum defines the dialog background color ?

Post by razoredge » Sun Jul 12, 2009 1:09 pm

From wxSystemSettings I get the color 230 / 224 / 218 (RGB) instead of 239 / 235 / 231 (RGB).

I am using Ubuntu 9.04. (I am new at Linux)

Auria Site Admin
Posts: 6695 Joined: Thu Sep 28, 2006 12:23 am Contact:

Post by Auria » Sun Jul 12, 2009 2:45 pm

Sorry, I don’t know; but asking the question differently : do you really need to know it? Can’t you just not draw on areas where you want to see the background?

Post by razoredge » Sun Jul 12, 2009 2:57 pm

Maybe I don’t understand your question right, but:

I have a self written control which is derived from wxWindow.
Inside the OnPaint handler I want to draw / clear the background of the control. Then I draw my own content .
(I use wxBufferedPaintDC inside OnPaint)

The background of the control should have the same color as the background of the wxPanel which contain the control.

Читайте также:  Linux home media center

And I don’t want to set the color of the self written control manually on fixed values.

Auria Site Admin
Posts: 6695 Joined: Thu Sep 28, 2006 12:23 am Contact:

Post by Auria » Sun Jul 12, 2009 5:01 pm

This code does no clear of the DC, it just renders over the existing background (I tried to make the text move, the previous render didn’t stay under). However I only tested this with wxMac, I can’t guarantee it work on wxGTK/others

Post by razoredge » Sun Jul 12, 2009 5:36 pm

I have found a reason / solution:

My control was derived from wxWindow.

If I use wxControl as base class the background color is the right one !

Is that behavior normal ?
Should I always use wxControl as base for «user widgets» ?

Auria Site Admin
Posts: 6695 Joined: Thu Sep 28, 2006 12:23 am Contact:

Post by Auria » Sun Jul 12, 2009 6:13 pm

I’d even recommend wxPanel; wxWindow is almost an abstract base class, it doesn’t do much on its own. It’s just a common interface to all subwidgets. Unless you know wx internals I wouldn’t recommend deriving from wxWindow

  • About The Forum
  • ↳ Forum Announcements
  • ↳ General Forum Issues
  • wxWidgets Programming Forums
  • ↳ C++ Development
  • ↳ Component Writing
  • ↳ Compiler / Linking / IDE Related
  • ↳ Platform Related Issues
  • wxWidgets Specialized Forums
  • ↳ wxDev-C++
  • ↳ wx.NET
  • ↳ The Code Dump
  • ↳ wxCode
  • General Forums
  • ↳ General Development
  • ↳ Announcements and Discoveries
  • ↳ Open Discussion
  • ↳ Database Related
  • International Forums
  • ↳ wxWidgets Development (French)
  • ↳ wxWidgets Development (Chinese)
  • ↳ wxWidgets Development (Russian)

Powered by phpBB® Forum Software © phpBB Limited

Источник

Оцените статью
Adblock
detector