; Module/File: EditField_Align.pb ; Function: Text orientation in StringGadget (GtkEntry) - Linux ; Author: Omi ; Date: Juli 27, 2014 ; Version: 0.3 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ; Alignment: 0.0 = Left, 0.5 = Center, 1.0 = Right, and all float steps between EnableExplicit ImportC "" gtk_entry_set_alignment(*entry.GtkEntry, xalign.f) EndImport ; Object constants #MainWin= 0 #Strg1 = 0 #Strg2 = 1 #Strg3 = 2 Global.i gEvent, gQuit If OpenWindow(#MainWin, 300, 200, 200, 200, "string alignment", #PB_Window_SystemMenu |#PB_Window_ScreenCentered) StringGadget(#Strg1, 5, 5, 150, 25, "RightAlign") StringGadget(#Strg2, 5, 35, 150, 25, "CenterAlign") StringGadget(#Strg3, 5, 65, 150, 25, "LeftAlign") gtk_entry_set_alignment(GadgetID(#Strg1), 1.0); right gtk_entry_set_alignment(GadgetID(#Strg2), 0.5); center gtk_entry_set_alignment(GadgetID(#Strg3), 0.0); left (std.) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS (Linux - x64) ; CursorPosition = 23 ; EnableUnicode ; EnableXP ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/