flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > [IDEA] GUI library for FASM

Author
Thread Post new topic Reply to topic
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
What about creating a GUI library for FASM to wrap Win32API on Windows and GTK on Linux?

My goal is to create a "portable" (you program with the same library on both OS), *very* easy to use, small and fast library to make asm GUI programming a joy.
Later we could include vid's FASMLIB ( http://board.flatassembler.net/topic.php?t=4696 ) and also add sockets, file IO and make a complete library, but also keeping it modular so it's assembled/linked only the necessary code.

If anyone is interessed we could start talking about the design principles.
Post 29 Sep 2006, 00:28
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
i think this is a little too big piece of cake...
Post 29 Sep 2006, 04:40
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 885
Location: \\world\asia\malaysia
vbVeryBeginner
hi ozzy,
i was thinking about some win32 framework several days ago,
and i did some sketch code on it, and just saw your thread, thought you might be interested with the code or etc.

Cool


Description:
Download
Filename: ssdev.zip
Filesize: 5.15 KB
Downloaded: 606 Time(s)

Post 03 Oct 2006, 07:04
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7106
Location: Slovakia
vid
vb: how about error handling? Wink
have you been working with X/GTK/KDE already?
Post 03 Oct 2006, 10:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 885
Location: \\world\asia\malaysia
vbVeryBeginner
hi vid,
have you been working with X/GTK/KDE already?
nope, it was just a sketch at the moment i got that idea by seeing how the bcx works, (translate basic to c code)

i was thinking that the future programming language should be more tied to IDE instead of the programming language itself.

it should be the IDE that change the programming way :p
Post 03 Oct 2006, 12:32
View user's profile Send private message Visit poster's website Reply with quote
Lsinclar



Joined: 07 Oct 2006
Posts: 1
Lsinclar
After some hesitations, I decided to post a reply, this is a tremendous subject. It has never been done before, because it is not easy.

You mean the same code produces 2 different things, according to its platform? Interesting. First goal is to get a blank window. Then establish a list of basic controls, their methods and properties.

Get someone responsible for the GTK part, plus another guy for the Win32 part. They will work separately but following the same specifications. A single man can't be an expert in both technologies.

I suggest we start doing it in C, then convert working parts into assembly.
To make it enjoyable, we should get as portable code, for a blank window:

Code:
#include <ourlib.h>

int main()
{
  ourWindow *h = Create_Window("title",0,0,200,100,TRUE,NULL);
  Window_Show(h);
  Set_Event(h, "quit", exit_loop);
  main_loop();
  return 0;
}    


GUI programming a joy? Hmm well let's say it's for scientists ...
The code of the lib, on Linux:
Code:
GtkWidget *Create_Window(Title, Left, Top, Width, Height, isCentered, *parent)
{
  GtkWidget *t = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (t), Title);
  gtk_window_set_default_size(GTK_WINDOW(fenetre), Width, Height);
  if (isCentered)
   gtk_window_set_position (GTK_WINDOW (t), GTK_WIN_POS_CENTER);
  else gtk_window_move (GTK_WINDOW(fen), Left, Top);
  if (parent) 

  return t;
}
void Window_Show(GtkWidget *f)
{
  gtk_widget_show (f);
}
void Set_Event()
{
 g_signal_connect(G_OBJECT(t),"destroy",G_CALLBACK(gtk_main_quit),NULL);
}    

Someone can produce code to make a Win32 window easily, according to the above specification... Please someone DO IT. The "main_loop()" is the equivalent of their "di$patch_message()". Globally this is what vbVB did: if you're in let's establish the common interface.

No doubt macros and preprocessor defines could help a probable performance drop: GTK is already a wrapper for X. Wrappers of wrappers tend to waste time.

Then it comes to controls.
To add a simple button let's just add:

Code:
Button *B = new_Button(h, 20,50, B_Click);
 //setParent(b, h);
 //setLeftTop_Position(20,50);    

User has to write the callback to handle the click:
Code:
void B_Click()
{
  print("clic");
}    

Detractors will show up quickly, they can talk. If we can get this working let me tell you this: Java won't stay long around.
Ozzy, please contact me in private so that things are being done.

The very best ultimate objective would be to generate this code using a WYSIWYG. There it would be enjoyable and noob-friendly, more than Visual Basic. In this
case, no matter how complex is the code, since the user won't see it except the callback he has to fill. I'll think about implementing it into my IDE for Fasm, written in GTK as you guessed.

Addictive topic.
Post 07 Oct 2006, 08:04
View user's profile Send private message Reply with quote
arafel



Joined: 29 Aug 2006
Posts: 131
Location: Jerusalem, Israel
arafel
Lsinclar wrote:
It has never been done before, because it is not easy.

Actually it has been done a number of times already. e.g. wxWidgets, ZooLib, ...
(although if you meant done in Assembly language, then I guess not)
Post 07 Oct 2006, 08:30
View user's profile Send private message 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 cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.