2010/10/7 Martin PelikC!n <martin.peli...@gmail.com>: > 2010/10/7, Jona Joachim <j...@hcl-club.lu>: >> On 2010-10-07, Christiano F. Haesbaert <haesba...@haesbaert.org> wrote: >>> Why not make a curses GUI ? I find it much more useful than gtk/qt (IMHO). >> >> What would be really nice IMHO is to expose an API that gives access to >> ifconfig functionality so everybody could easily write their own UI. > > That API is exposed in getifaddrs(3). If you've read the whole thread... > >> Basically to to write your GUI you need to rewrite part of ifconfig. > > Basically that is by definition. ifconfig is just another kind of GUI, see? :-) > >> Also I always wondered whether it is technically possible to scan for >> APs without losing your connection to your current AP, that would be >> very handy to implement transparent roaming. > > AFAIK it's not, but one thread could do scanning while another thread > could handle user input (like WPA passphrase) > > I don't see why do so many people want to use Python for this. Its > advantages are obvious in complex software with lots of code, but why > use it for such a simple and low-level tool? I mean, why don't you use > mono then? I'm pretty sure ioctl() looks similar in all of them... > GTK/Qt seems like a huge overkill too. Look at its size and look at > the benefits from it. Round buttons? Is that what you want? A pop-down > "new network found" window from a corner? Just imagine running PyQt on > a Soekris. > > I'll try to bring myself to post my unfinished curses version. The > problem is I don't understand curses enough. Parts of it are too > complex and some important parts are missing or malfunctional across > multiple systems. But from a "simple and easy-to-use" point of view, > it seems the smallest evil. > > My app loads bunch of .so's, which create options in left menu (like > in Mikrotik Winbox) and if you press the option, a function from that > library gets called and gets control over the whole window (and does > its stuff). One for ifaces+addresses, one for pf tables and one for pf > anchors so far. Any other ideas? > > -- > Martin Pelikan > >
What would you suggest for a GUI? I mean, one that runs as an X application. I don't intend to add any tray notification or anything like that, anyway. To be honest, the reason I picked python is that I've more experience with python than I do with C/C++, so I can produce better quality code in less time. I'd do the C module to load into python because I don't think python can make system function calls. Anyway, how close are you to finishing your curses UI? A great deal of code might be re-usable for an X GUI, if you don't mind :-) As for what others said, I DID say I intend to create a C module to be called from python to use from my python UI. This would then be re-usabe for creating another UI, a text-mode UI, and anything someone would want. -- Hugo Osvaldo Barrera () B ascii ribbon campaign - against html e-mail /\ B www.asciiribbon.org B - against proprietary attachments