Author Topic: GUI Page?  (Read 1285 times)

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
GUI Page?
« on: August 26, 2010, 03:59:23 AM »
I have used Zenity in a couple of Bash scripts, and while useful it is rather limiting, and disruptive.

Essentially Zenity prompts the user for a choice/decision one question at a time.

Is there a means to create a simple GUI page, which has the capability of asking the user maybe 10 different questions, and storing the answers to those questions in a list of variables, which could be passed to a Bash script?

So instead of the user being asked 10 different questions, by 10 different Zenity prompts, the user could tick answers, choose from drop-down list, or browse for a file etc etc all on the one page, and have the script use those answers in place of all the Zenity prompts?

I realise this can be done by various other means  - like using Python or such - but I just want to know if there is something akin to what I have described which would eliminate the necessity of learning a new language; porting a script to Python or whatever is needed by the 'more comprehensive' methods I have read about .......  such as Qt development or such.

I have even wondered if it is possible to use a Qt GUI to gather the info and assign the answers to variables which could be used in the backend script.

Does such a beast exist?
Is it possible to adapt an existing GUI generator in this manner?

How might one go about attempting this?

I thought it might be an interesting learning experience ......    ;D

regards.

Online The Chief

  • Hero Member
  • *****
  • Posts: 2339
Re: GUI Page?
« Reply #1 on: August 26, 2010, 08:38:31 AM »
I have even wondered if it is possible to use a Qt GUI to gather the info and assign the answers to variables which could be used in the backend script.

Does such a beast exist?
Is it possible to adapt an existing GUI generator in this manner?


I believe this is exactly how many Linux programs are built. 

I have also done the same thing with Windows/DOS command line utilities. 

The easiest way, probably, is to gather the data in the GUI and then build a command line to be executed.

Retired Senior Chief, Retired Software Engineer, Active GrandPa

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: GUI Page?
« Reply #2 on: August 26, 2010, 08:42:12 AM »
I have even wondered if it is possible to use a Qt GUI to gather the info and assign the answers to variables which could be used in the backend script.

Does such a beast exist?
Is it possible to adapt an existing GUI generator in this manner?


I believe this is exactly how many Linux programs are built. 

I have also done the same thing with Windows/DOS command line utilities. 

The easiest way, probably, is to gather the data in the GUI and then build a command line to be executed.

The question really is .......  which application would be most suitable to generate the GUI for this type of situation?

Thanks.

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: GUI Page?
« Reply #3 on: August 27, 2010, 04:17:42 AM »
I have come across quite a lot of GUI generating applications in my search, but all seem to require quite a steep learning curve, and without getting to know them I have no idea the difficulty levels or whether they would be suitable or not.

Opinions welcomed regarding the app/IDE to use .....   :)

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: GUI Page?
« Reply #4 on: August 27, 2010, 07:41:08 AM »
I would recommend python or perl...

As for IDE, try Eclipse :)



Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: GUI Page?
« Reply #5 on: August 27, 2010, 07:54:41 AM »
Thanks for the responses ......  I have decided that all the options I have read about are beyond my interest/capabilities/whatever at this point in time.

I was hoping to find something that might generate a generic GUI page, which a user could manipulate (without a large learning curve) and drop buttons/widgets/whatever on it, and direct the output of the buttons/questions/widgets to either a list of variables or to a file, which could then be used as input options for a command or script.

Maybe something as simple as a page like this, with its output being a list of the results of the buttons, in a file.


musonio

  • Guest
Re: GUI Page?
« Reply #6 on: August 27, 2010, 08:14:41 AM »
what about gtkdialog?

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: GUI Page?
« Reply #7 on: August 27, 2010, 08:55:16 AM »
what about gtkdialog?

I know little about it, but from what I read it is somewhat akin to Zenity in that it presents a dialog box to the user, and passes the output from that dialog box to a single command.

Nothing on the home page would indicate otherwise (to me ;) ) but I may not be seeing the full potential of it.

Am I understandng this correctly?

regards.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: GUI Page?
« Reply #8 on: August 27, 2010, 09:00:03 AM »
You do understand it, so far as I know, JohnBoy.

Did you try QTCreator?

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: GUI Page?
« Reply #9 on: August 27, 2010, 09:09:47 AM »
You do understand it, so far as I know, JohnBoy.

Did you try QTCreator?

Thanks Neal.

Yes I looked at QtCreator .......  but TBH I found no tute that explains something like I have described .......  and it seems to require good knowledge of a computer language ...... I did spend some little time with it but found myself frustrated trying to do something I consider rather simple but not being able to find a means to do it.
I thought maybe it is not possible .......  without a large learning curve .......

Oh, the pic I posted came from QtCreator ;)

If someone could indicate a means of using QTCreator to do what I have described then I would willingly have another shot at it ........  or maybe a link to do something similar  .......

Thanks for the interest .....  this has been bugging me for the most part of a year now .....

regards.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15829
  • LXDE! Coffee, Bacon and Cheesecake!
Re: GUI Page?
« Reply #10 on: August 27, 2010, 09:20:32 AM »
It occurred to me after I had posted. ::) I think I know what musonio was talking about. You can set it to open various scripts/apps, or the same method could be used to have multiple questions asked, I think. Musonio most likely will understand this much better than I do.
Have a look at lxde control center for an example
Code: [Select]
# Start main program

export lxdecc='
<window title="Control Center" icon="/usr/share/icons/gnome/32x32/actions/application-exit.png" window-position="2">
<vbox>
  <notebook labels="Appearance Settings|System ">
  <vbox>
  <frame>
<hbox>
<vbox>
<hbox>
<button>
<input file>"/usr/share/icons/1.png"</input>
<action>pcmanfm --show-pref=2 &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Set Wallpaper"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/2.png"</input>
<action>obconf &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Configure Openbox"</label>
</text>
</hbox>
                                <hbox>
<button>
<input file>"/usr/share/icons/cursor_ring_icon.png"</input>
<action>lxcursor &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Change Your Cursor Theme"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/3.png"</input>
<action>lxappearance</action>
<action>lxpanelctl restart &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"GTK & Icon Theme"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/4.png"</input>
<action>xscreensaver-demo &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Screensaver Settings"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/6.png"</input>
<action>pcmanfm --show-pref=1 &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"PCManFM Settings"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/5.png"</input>
<action>lxpanelctl restart &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Refresh Panel"</label>
</text>
</hbox>
</vbox>
</hbox>
    </frame>
  </vbox>
  <vbox>
  <frame>
<hbox>
<vbox>
<hbox>
<button>
<input file>"/usr/share/icons/7.png"</input>
<action>gksu /usr/bin/gdmsetup &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"GDM Settings"</label>
</text>
</hbox>
<hbox>
     <button>
<input file>"/usr/share/icons/file_tools_section.png"</input>
<action>gksu -l /usr/bin/pcmanfm &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"File Manager Superuser Mode"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/8.png"</input>
<action>gksu -u root /usr/sbin/synaptic &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Install Software"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/drakconf.png"</input>
<action>gksu /usr/sbin/drakconf.real &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"PCLinuxOS Control Center"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/9.png"</input>
<action>lxinput &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Mouse&Keyboard"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/10.png"</input>
<action>lxsession-edit &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Session Settings"</label>
</text>
</hbox>
<hbox>
<button>
<input file>"/usr/share/icons/11.png"</input>
<action>lxrandr &</action>
</button>
<text use-markup="true" width-chars="17">
<label>"Monitor Settings"</label>
</text>
</hbox>
</vbox>
</hbox>
    </frame>
  </vbox>
</notebook>
  <hbox>
<button>
<label>"Close"</label>
<input file>"/usr/share/icons/12.png"</input>
<action>EXIT:close</action>
</button>
</hbox>
  </vbox>
</window>
'

gtkdialog --program=lxdecc
unset lxdecc


Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6849
  • MLU
Re: GUI Page?
« Reply #11 on: August 27, 2010, 09:22:49 AM »
Thanks will do ........  beginning to look interesting ........  :)

Online The Chief

  • Hero Member
  • *****
  • Posts: 2339
Re: GUI Page?
« Reply #12 on: August 27, 2010, 12:06:43 PM »
The question really is .......  which application would be most suitable to generate the GUI for this type of situation?

Thanks.

I think it's more a matter of what you're comfortable with.  Everyone has a different "best," or "most suitable!"

There are several in the repos - you might want to try qt-creator, kdevelop, monodevelop or even python-Kiwi2.  Or any of the development IDEs.  All depends on what languages you're comfortable in.

Retired Senior Chief, Retired Software Engineer, Active GrandPa

musonio

  • Guest
Re: GUI Page?
« Reply #13 on: August 27, 2010, 12:20:07 PM »
The question really is .......  which application would be most suitable to generate the GUI for this type of situation?

Thanks.

I think it's more a matter of what you're comfortable with.  Everyone has a different "best," or "most suitable!"

There are several in the repos - you might want to try qt-creator, kdevelop, monodevelop or even python-Kiwi2.  Or any of the development IDEs.  All depends on what languages you're comfortable in.

that's the advantage of gtkdialog for ignorants like myself: you don't need to learn any language.

Online The Chief

  • Hero Member
  • *****
  • Posts: 2339
Re: GUI Page?
« Reply #14 on: August 27, 2010, 12:23:40 PM »
that's the advantage of gtkdialog for ignorants like myself: you don't need to learn any language.
Only the first one is hard - after that, it's a snap.

Retired Senior Chief, Retired Software Engineer, Active GrandPa