DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd August 2011
Daffy Daffy is offline
Fdisk Soldier
 
Join Date: Jun 2010
Posts: 73
Default Where to begin with GUI as a frontend for command line?

As I'm trying to learn more stuff, I think it would be interesting to learn how to construct a gui for replacing command line tools (which is something I don't wanna do, just for learning purposes).

I know that this question is very general, but where do I begin? I have a first target to build a simple frontend to openssl for encrypting/decrypting files.

p.s. I'm not asking for a complete walkthrough, but a guide on -how- to do things and what approach is better and why. I just don't know where to begin.
Reply With Quote
  #2   (View Single Post)  
Old 2nd August 2011
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Check bxpkg which is a graphical GTK frontend for the pkg_* tools, its in the Ports of course.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #3   (View Single Post)  
Old 3rd August 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by vermaden View Post
Check bxpkg which is a graphical GTK frontend for the pkg_* tools, its in the Ports of course...
Unless Daffy is changing affiliations, bxpkg is only available for FreeBSD, & FreeBSD's package tools.

Perhaps the simplest cross-platform solution is to learn the Tk extensions to Tcl. This begins a descent into programming solutions, & I don't recall Daffy mentioning any previous programming experience. Depending upon what packages are already installed, Tcl might already be installed in your OpenBSD environment as a dependency to other packages. Many Tcl/Tk tutorials can be found on the Internet.

In my opinion, if you are going to begin learning a programming language, learn Python. The Tk extensions (the same mentioned above for Tcl...) are also part of a standard Python installation. wxPython (also available in OpenBSD's package system as py-wxPython...) is a much more robust GUI library available to Python. Some beginning tutorial presentation can be found at the wxPython site:

http://wxpython.org/

There are no simple GUI building tools. Constructing an X11 interface requires programming experience. Unless you have already started down this path, don't expect to knock out complicated software in a few nights of dabbling. Programming takes time to master.
Reply With Quote
  #4   (View Single Post)  
Old 3rd August 2011
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
ISO Quartermaster
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 589
Default

Quote:
Originally Posted by vermaden View Post
Check bxpkg which is a graphical GTK frontend for the pkg_* tools, its in the Ports of course.
Actually It's not a front-end.
It implements library to handle ports, and that library does all the dirty stuff.

bxpkg doesn't use pkg_* tools at all
http://hg.bsdroot.lv/expl/bxpkg
Reply With Quote
  #5   (View Single Post)  
Old 3rd August 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
Originally Posted by ocicat
In my opinion, if you are going to begin learning a programming language, learn Python.
I'll second that
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 3rd August 2011
Daffy Daffy is offline
Fdisk Soldier
 
Join Date: Jun 2010
Posts: 73
Default

ocicat, you're right. OpenBSD user here, so I followed your proposal and began reading about wxPython.

For programming experience, again you're right. I have none. I've only read two books for Python, but apart from a dice program (for D&D ) , I've found nothing more to do with it. So I count this as a zero experience. The good thing is that I can follow many things in wxPython's tutorials.


Thank you all. Off I go to more tutorials and achieve my first target.
Reply With Quote
  #7   (View Single Post)  
Old 3rd August 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by Daffy View Post
...I followed your proposal and began reading about wxPython.
Unfortunately, event-driven GUI programming is frequently not the first topic newcomers delve into when learning a new language.
  • Be aware that the documentation found on the Python site might help fill in lots of gaps:

    http://python.org/doc/
  • Mark Pilgrim's Dive into Python books (for Python 2 & Python 3...) are both freely available online. His Python 2 title can also be found as a OpenBSD package.
  • O'Reilly's introductory Python title, Learning Python, is also recommended for getting up to speed.
Note that Python is going through a major transition from Python 2 to Python 3 -- a change large enough that old Python 2 code might not run as is with the newer Python 3 interpreter. Right now, OpenBSD only sports Python 2 in packages, however a Python 3 port is in the works. I don't suspect that the Python 3 port will be available until after OpenBSD 5.0 is released.
Reply With Quote
  #8   (View Single Post)  
Old 3rd August 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Perhaps you can start by building a curses UI using the curses module. This easier than building something with GTK...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #9   (View Single Post)  
Old 3rd August 2011
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 437
Default

Quote:
Originally Posted by ocicat View Post
There are no simple GUI building tools. Constructing an X11 interface requires programming experience. Unless you have already started down this path, don't expect to knock out complicated software in a few nights of dabbling. Programming takes time to master.
If you use Python - which I say you should also, you could use the QT toolkit and QTDesigner is a about the easiest to use GUI designer I seen in the *nix world. QTDesigner also intergrates with Eric IDE and there are python bindings for QT. Sorry I don't know about the status of using these on OpenBSD. But all are cross platform as I used them on FreeBSD and Windows.
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
Old 12th August 2011
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Daffy:

One easy way to bring up some command line utilities from a menu is to use the -e option in xterm.
I do this typically with "top" and ncmpc
Code:
[Desktop Entry]
Version=1.0
Name=NcMpc
Comment=NCurses Mpd Frontend
Exec=/usr/bin/X11/xterm -e "ncmpc"
Icon=/usr/share/icons/gnome/32x32/mimetypes/audio-x-generic.png
Terminal=false
Categories=AudioVideo;Player;
The above example is from my Debian Desktop so you will need to adjust paths accordingly for BSD

Last edited by shep; 12th August 2011 at 03:45 AM. Reason: Clarified that entry is from Debian
Reply With Quote
Reply

Tags
gui

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
matts: a shell script to mail attachments from the command line J65nko Guides 7 3rd August 2022 03:13 AM
command-line-fu (digg like site with UNIX commands) vermaden Guides 3 13th March 2009 03:56 PM
avidemux2 command line roddierod FreeBSD General 1 10th November 2008 08:27 PM
shell: how to take part of the line... graudeejs Programming 8 6th September 2008 11:13 PM
OSS , playing a sound via command line.. scotsman FreeBSD General 7 29th August 2008 08:01 PM


All times are GMT. The time now is 01:34 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick