wxwidgets and c

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
vish
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Apr 04, 2007 7:49 pm

wxwidgets and c

Post by vish » Wed Apr 04, 2007 8:01 pm

hi i have a c program for which i plan to use widgets as my gui.
i have no idea if i can do that please help!

EDIT: please don't use so many exclamation marks it's irritating and people tend to ignore your posts then -Joel

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Wed Apr 04, 2007 9:53 pm

You can't unless you compile your C code using C++. wxWidgets is C++-only.

Joel

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

Post by Auria » Wed Apr 04, 2007 10:55 pm

I think wx.NET and wxD use wxC, a C interface to wxWidgets. Though i don't think it's very handy to use, nor very well supported

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Apr 05, 2007 7:12 am

Hi!
I guess it depends on your program. you surely can use the internal "logic" and have wxWidgets do the visuals. But you will need to use C++ for wxWidgets.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

vish
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Apr 04, 2007 7:49 pm

Post by vish » Thu Apr 05, 2007 12:20 pm

ok i'm fine with c++ but then mine is a console program. how do i use widgets to give it a cool graphic interface?

vish
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Apr 04, 2007 7:49 pm

Post by vish » Thu Apr 05, 2007 12:23 pm

[quote="lowjoel"]You can't unless you compile your C code using C++. wxWidgets is C++-only.

Joel[/quote] sorry for usin too many exclamation marks

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Apr 05, 2007 12:30 pm

Errr...
Like I said: wxWidgets can be used for the GUI, the internal logic would be the same as in your existing app.

Question yourself: What input does my app need? What input does a user have to make? Where is the "logic" in my app?

If you know about 1 & 2 go ahead and hack up some dummy GUI with all the elements you need (text boxes, buttons, etc.). Then implement the event handling and after that fill in your logic.

Another option would be to create a library out of you application and use this in your new wxWidgets app to call functions that do the work.

It's a bit hard to tell how to do this exactly, as we no nothing about your app or how it was coded. And we know nothing about your experience either. Have you ever coded a GUI application on any platform? If not, I'd highly recommend that you get to know wxWidgets first.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

vish
In need of some credit
In need of some credit
Posts: 8
Joined: Wed Apr 04, 2007 7:49 pm

Post by vish » Fri Apr 06, 2007 11:52 am

i simply dont get it. my program is a console based and a frame appli dont have a main function. then how do i give my program gui? if any one knows the answer or any artical or tutorials please help.

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

Post by Auria » Fri Apr 06, 2007 2:21 pm

vish wrote:i simply dont get it. my program is a console based and a frame appli dont have a main function. then how do i give my program gui? if any one knows the answer or any artical or tutorials please help.
i don't get your question... what's your problem? just learn to write wxWidgets programs, when you know that it will be obvious how to add a GUI to your current app

Also as upCase said you're not giving much info about your needs, you'll need to be clearer than that if you want us to understand what you want

Post Reply