Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 22 Nov 2014, 10:32
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
make your own custom keyword highlighting
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Sun 09 Oct 2011, 00:25    Post subject:  

now with two colors
UPDATED code Oct-9-20011
and added a readme

BaCon in blue
HUG in green

doesnt that look so much better with color ?


remember to inclose using the forums Quote
this allows colors to be used the Code doesnt work with colors


Quote:

' Imports when HUG is used as shared object
CONST HUG_lib$ = "./hug.so"

' Setup error handling
TRAP LOCAL
CATCH GOTO hug_handle_error

' Import HUG functions
IMPORT "ATTACH(long,long,int,int)" FROM HUG_lib$ TYPE void
IMPORT "BUTTON(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "CALLBACK(long,void*)" FROM HUG_lib$ TYPE void
IMPORT "CALLBACKX(long,void*,long)" FROM HUG_lib$ TYPE void
IMPORT "CANVAS(int,int)" FROM HUG_lib$ TYPE long
IMPORT "CHECK(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "CIRCLE(char*,int,int,int,int,long)" FROM HUG_lib$ TYPE void
IMPORT "CLIPBOARD" FROM HUG_lib$ TYPE long
IMPORT "COMBO(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "DISABLE(long)" FROM HUG_lib$ TYPE void
IMPORT "DISPLAY" FROM HUG_lib$ TYPE void
IMPORT "EDIT(int,int)" FROM HUG_lib$ TYPE long
IMPORT "ENABLE(long)" FROM HUG_lib$ TYPE void
IMPORT "ENTRY(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "FILEDIALOG(char*,char*,int,int,int)" FROM HUG_lib$ TYPE long
IMPORT "FOCUS(long)" FROM HUG_lib$ TYPE void
IMPORT "FONT(long,char*)" FROM HUG_lib$ TYPE void
IMPORT "FRAME(int,int)" FROM HUG_lib$ TYPE long
IMPORT "GET(long)" FROM HUG_lib$ TYPE long
IMPORT "GRAB$(long)" FROM HUG_lib$ TYPE char*
IMPORT "HIDE(long)" FROM HUG_lib$ TYPE void
IMPORT "HSEPARATOR(int)" FROM HUG_lib$ TYPE long
IMPORT "HUGOPTIONS(char*)" FROM HUG_lib$ TYPE void
IMPORT "HUGLIB$(char*)" FROM HUG_lib$ TYPE char*
IMPORT "IMAGE(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "INIT" FROM HUG_lib$ TYPE void
IMPORT "KEY" FROM HUG_lib$ TYPE long
IMPORT "LINE(char*,int,int,int,int)" FROM HUG_lib$ TYPE void
IMPORT "LIST(int,int)" FROM HUG_lib$ TYPE long
IMPORT "MARK(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "METHOD(long,int,void*)" FROM HUG_lib$ TYPE void
IMPORT "MOUSE(long)" FROM HUG_lib$ TYPE long
IMPORT "MSGDIALOG(char*,int,int,int,int)" FROM HUG_lib$ TYPE long
IMPORT "NOTEBOOK(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "OUT(char*,char*,char*,int,int)" FROM HUG_lib$ TYPE void
IMPORT "PASSWORD(int,int)" FROM HUG_lib$ TYPE long
IMPORT "PICTURE(char*,int,int,int,int)" FROM HUG_lib$ TYPE void
IMPORT "PIXEL(char*,int,int)" FROM HUG_lib$ TYPE void
IMPORT "PROGRESSBAR(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "QUIT" FROM HUG_lib$ TYPE void
IMPORT "RADIO(char*,int,int,long)" FROM HUG_lib$ TYPE long
IMPORT "REGISTER(long,int,int,int,long,long,long,long)" FROM HUG_lib$ TYPE void
IMPORT "SCREENSIZE(int)" FROM HUG_lib$ TYPE int
IMPORT "SET(long,int)" FROM HUG_lib$ TYPE void
IMPORT "SHOW(long)" FROM HUG_lib$ TYPE void
IMPORT "SPIN(int,int,double,double,double)" FROM HUG_lib$ TYPE long
IMPORT "SQUARE(char*,int,int,int,int,int)" FROM HUG_lib$ TYPE void
IMPORT "STOCK(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "SYNC" FROM HUG_lib$ TYPE void
IMPORT "TEXT(long,char*)" FROM HUG_lib$ TYPE void
IMPORT "TIMEOUT(int,void*)" FROM HUG_lib$ TYPE void
IMPORT "TOGGLE(char*,int,int)" FROM HUG_lib$ TYPE long
IMPORT "UNFOCUS(long)" FROM HUG_lib$ TYPE void
IMPORT "VSEPARATOR(int)" FROM HUG_lib$ TYPE long
IMPORT "WINDOW(char*,int,int)" FROM HUG_lib$ TYPE long

' Define the PROPERTY directive
hug_Gobject$ = HUGLIB$("gobject")
IMPORT "g_object_set(long,char*,...)" FROM hug_Gobject$ TYPE void
PROTO PROPERTY
DEF FN PROPERTY(widget, name, ...) = g_object_set(widget, name, __VA_ARGS__, NULL)

' The dialog response codes
CONST GTK_RESPONSE_ACCEPT = -3
CONST GTK_RESPONSE_DELETE_EVENT = -4
CONST GTK_RESPONSE_OK = -5
CONST GTK_RESPONSE_CANCEL = -6
CONST GTK_RESPONSE_CLOSE = -7
CONST GTK_RESPONSE_YES = -8
CONST GTK_RESPONSE_NO = -9
CONST GTK_RESPONSE_APPLY = -10
CONST GTK_RESPONSE_HELP = -11



bacon-highlighting.tar.gz
Description 
gz

 Download 
Filename  bacon-highlighting.tar.gz 
Filesize  2.12 KB 
Downloaded  120 Time(s) 

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though

Last edited by big_bass on Sun 09 Oct 2011, 22:53; edited 2 times in total
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Sun 09 Oct 2011, 22:06    Post subject:  

I updated the above post

and this is the readme to get an idea how simple it is


the folder $HOME/bacon-highlighting/ is used
$HOME on puppy is /root

1.)if you click on /root/bacon-highlighting/myparser-bacon
it will auto generate colorlist-bacon
this reads the KEYWORD2.TXT which are BaCon keywords in blue


2.)if you click on/root/bacon-highlighting/myparser-hug
it will auto generate colorlist_hug
this reads the KEYWORDS_HUG.TXT which are HUG keywords in green

*the reason this is auto generated is it allows you to modify it easily
having separate scripts allows for easy modifications and debugging
and as more colors are added this simplifies making color edits to
complex scripts

the file hug.bac was renamed to hug.bac1 just for an example file
any file could be used it is not needed for the script to work

3.)you dragNdrop hug.bac1 onto colorlist-bacon that gives the blue color
4.)you dragNdrop hug.bac1 onto colorlist_hug that gives you the green color


these files were used during testing of the color
if you need hug.bac its here ---------->http://www.basic-converter.org/hug.bac
if you need hug_imports.bac its here ----------->http://www.basic-converter.org/hug_imports.bac

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0776s ][ Queries: 12 (0.0039s) ][ GZIP on ]