|
Post by SunBurnt on Dec 15, 2011 4:41:30 GMT 1
Hate to be a pain in the arse, butt... ( pun intended ! ;D ).
'INCLUDE "/usr/share/BaCon/hug.bac" INIT
winMAIN_ = WINDOW("Sq.Apps.", 200, 50) FONT(winMAIN_, "Nimbus Roman No9 L Medium")
DISPLAY Works for buttons, don`t know what else, but controls should be good.
|
|
|
Post by Pjot on Dec 15, 2011 9:03:28 GMT 1
Hi Sunburnt, You are right, but we cannot change that. This is what is mentioned in the GTK documentation: So for Window title appearance to change, it seems you need to fiddle around with your WM configuration... Regards Peter
|
|
|
Post by SunBurnt on Dec 15, 2011 20:17:46 GMT 1
This makes sense, I hadn`t thought of it being an X thing.
Thanks Peter... Terry
|
|
|
Post by vovchik on Dec 16, 2011 9:04:38 GMT 1
Dear Terry,
You can get the screen res in Bacon this way:
' ************************************************************* ' PROGRAM: screensize.bac ' PURPOSE: get X screen size in pixels from default display ' AUTHOR: vovchik (Puppy Linux forum) ' COMMENTS: GPL ' DEPENDS: bacon 0.19, gtk, gdk libs ' PLATFORM: Linux (actually, any *nix) ' DATE: 03-10-2010 ' VERSION: 0.1a ' *************************************************************
' ********************* ' DEF ERROR HANDER ' *********************
TRAP LOCAL CATCH GOTO PRINT_ERROR
' ********************* ' END DEF ERROR HANDER ' *********************
' ********************* ' CONSTANTS ' *********************
CONST Gtk$ = "libgtk-x11-2.0.so.0" CONST Gdk$ = "libgdk-x11-2.0.so.0"
' ********************* ' END CONSTANTS ' ********************
' ********************* ' DECLARATIONS ' *********************
DECLARE MyScreen$ TYPE STRING
' ********************* ' END DECLARATIONS ' *********************
' ********************* ' IMPORTS ' *********************
IMPORT "gtk_init(int*,void*)" FROM Gtk$ TYPE void IMPORT "gtk_exit(int)" FROM Gtk$ TYPE void IMPORT "gtk_window_get_size(long,int*,int*)" FROM Gtk$ TYPE void IMPORT "gdk_screen_get_default" FROM Gdk$ TYPE long IMPORT "gdk_screen_get_width(long)" FROM Gdk$ TYPE int IMPORT "gdk_screen_height(long)" FROM Gdk$ TYPE int
' ********************* ' END IMPORTS ' *********************
' ********************* ' FUNCTIONS ' *********************
' ------------------ FUNCTION SCREENSIZE(NUMBER mode) ' ------------------ ' mode = 0 returns x (width) ' mode = 1 returns y (height) ' mode = 2 returns space-delimited x (width) and y (height) ' otherwise function returns error message LOCAL x, y TYPE int LOCAL myresult$ TYPE STRING y = gdk_screen_height(gdk_screen_get_default()) x = gdk_screen_get_width(gdk_screen_get_default()) SELECT mode CASE 0 myresult$ = STR$(x) CASE 1 myresult$ = STR$(y) CASE 2 myresult$ = CONCAT$(STR$(x), " ", STR$(y)) DEFAULT myresult$ = CONCAT$("Error: SCREENSIZE(", STR$(mode), ") mode is bad: 0 = w, 1 = h and 2 = h and w.") END SELECT RETURN CHOP$(myresult$) END FUNCTION
' ********************* ' END FUNCTIONS ' *********************
' ********************* ' MAIN ' *********************
gtk_init(0, 0) MyScreen$ = SCREENSIZE(0) PRINT MyScreen$ MyScreen$ = SCREENSIZE(1) PRINT MyScreen$ MyScreen$ = SCREENSIZE(2) PRINT MyScreen$ MyScreen$ = SCREENSIZE(3) PRINT MyScreen$ gtk_exit(0) END
' ********************* ' END MAIN ' *********************
With kind regards, vovchik
|
|
|
Post by vovchik on Dec 16, 2011 11:50:53 GMT 1
|
|
|
Post by SunBurnt on Dec 16, 2011 20:57:52 GMT 1
No problem vovchik, usually I just cut it out and paste it to where it should be. Leaving an apology in the wrong post`s place of course...
|
|