flat assembler
Message board for the users of flat assembler.

Index > Heap > C language application GUI framework

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 8963
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
any suggestion for a win32//64/linux/bsd, stable/proven/complete GUI framework that uses C language? instead of C++
Post 06 Jun 2009, 01:47
View user's profile Send private message Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
I am searching for the same thing.

There is GTK+ but it's pain to use under windows.

Do you guys have any suggestion?

sleepsleep: If you don't want to use the WinAPI (if you're targeting cross-platform), the best tool I found to create GUIs is Tcl/Tk: http://www.tcl.tk / http://wiki.tcl.tk

Althought it's a scripting language like Python, it's light and easy to bundle as a stand-alone EXE for all platforms. (1mb executables with interpreter + script inside a virtual file system).
It's also easy to call C console programs and get the output. (I'm using this to GUIfy my C console programs).

Although a pure C solution like you asked would be great!

Here is an example code for Tcl/Tk. A GUI that adds 2 numbers:
Code:
# We're using the TK GUI toolkit version 8.5
package require Tk 8.5

# Function to do the calculation
proc calc {} {
      # Get the first number
      set x [.e1 get]

 # Get the second number
     set y [.e2 get]
     
    # Add the number and store the result in variable z
 set z [expr $x + $y]

    # Set the contents of the result label
      .lres config -text "Result $z"
}

# Function to build the GUI
proc main {} {
      # Define the window title
   wm title . "Add numbers"

      ttk::label .l1 -text "Number 1: "
     ttk::entry .e1
      ttk::label .l2 -text "Number 2: "
     ttk::entry .e2
      ttk::button .bcalc -text "Calculate!" -command calc
       ttk::label .lres -text "Result: "

 grid .l1 .e1
        grid .l2 .e2
        grid .bcalc
 grid .lres
}

# Call the main funcion
main
    


And here is the screenshot:
Image

I hope it helps!
This page sums up what you can do with Tcl: http://wiki.tcl.tk/299
Post 06 Jun 2009, 04:06
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Although a pure C solution like you asked would be great!

FLTK version 1
Post 06 Jun 2009, 08:50
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
vid: FLTK is C++, although with very Cish API.
Post 06 Jun 2009, 15:57
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
sleepsleep, give IUP a try
Post 06 Jun 2009, 16:39
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8963
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Quote:

sleepsleep, give IUP a try

cool, i just checked the interface gallery and its code to generate those, looks cool Smile
thanks TmX.
Post 07 Jun 2009, 02:13
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
FLTK is C++, although with very Cish API.

Interesting... I never checked what it is written in, but I never found anything C++ specific in FLTK 1.x (FLTK 2.x has OOP API).
Post 07 Jun 2009, 08:55
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
FLTK2 is an attempt to rewrite FLTK1 with support for more C++ features like namespaces.

Although I kind of prefer the C-like API of FLTK1. Very Happy
Post 07 Jun 2009, 19:38
View user's profile Send private message Reply with quote
Chewy509



Joined: 19 Jun 2003
Posts: 297
Location: Bris-vegas, Australia
Chewy509
I've been using GTK+ for a while now, and it mostly works for what I need.

But note, I use libGlade to build the UI, link the UI elements to my asm routines, and go from there... I don't hardcode the UI in GTK.
Post 08 Jun 2009, 23:32
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
Chewy509, do you use on Windows?

Can you help me how to set it up?

Actually, I'm more interested in Gtkmm (GTK for C++), but no luck on Windows.
Post 09 Jun 2009, 01:41
View user's profile Send private message Reply with quote
Chewy509



Joined: 19 Jun 2003
Posts: 297
Location: Bris-vegas, Australia
Chewy509
OzzY wrote:
Chewy509, do you use on Windows?

Can you help me how to set it up?

Actually, I'm more interested in Gtkmm (GTK for C++), but no luck on Windows.

Sorry I only develop GTK+ stuff for Solaris, FreeBSD and Linux only. (For Windows, I tend to use just .NET for quick and dirty apps).

Where's the problem anyway, and what compiler suite are you using?
Post 09 Jun 2009, 23:14
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8963
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Quote:

sleepsleep, give IUP a try

tried it today using pelles c,
so far so good Smile
Post 14 Jun 2010, 07:54
View user's profile Send private message Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler

_________________
This is a block of text that can be added to posts you make.
Post 14 Jun 2010, 16:15
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.