; Module/File: EditField_InvisibleText.pb ; Function: StringGadget - invisible input - Linux ; Author: Omi ; Date: Aug. 15, 2014 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31/5.40 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- EnableExplicit ImportC "" gtk_entry_set_invisible_char(*entry.GtkEntry, ch.l) EndImport ; Object constants #MainWin= 0 #Strg1 = 0 #Txt1 = 1 #Strg2 = 2 #Txt2 = 3 #WinX= 300 #WinY= 200 #WinW= 200 #WinH= 200 Global.i gEvent, gQuit If OpenWindow(#MainWin, #WinX, #WinY, #WinW, #WinH, "invisible input", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) TextGadget(#PB_Any, 5, 8, 190, 25, "type with shown spaces ...") StringGadget(#Strg1, 5, 30, 150, 25, "") TextGadget(#Txt1, 5, 60, 190, 25, "") TextGadget(#PB_Any, 5, 93, 190, 25, "type without display ...") StringGadget(#Strg2, 5, 115, 150, 25, "") TextGadget(#Txt2, 5, 145, 190, 25, "") gtk_entry_set_invisible_char(GadgetID(#Strg1), 32); choose unicode character (32= whitespace) gtk_entry_set_visibility_(GadgetID(#Strg1), #False) gtk_entry_set_invisible_char(GadgetID(#Strg2), 0); empty output gtk_entry_set_visibility_(GadgetID(#Strg2), #False) Repeat gEvent= WaitWindowEvent() Select gEvent Case #PB_Event_CloseWindow gQuit= #True Case #PB_Event_Gadget If EventGadget()= #Strg1 If EventType()= #PB_EventType_Change SetGadgetText(#Txt1, GetGadgetText(#Strg1)); show real content EndIf EndIf If EventGadget()= #Strg2 If EventType()= #PB_EventType_Change SetGadgetText(#Txt2, GetGadgetText(#Strg2)); show real content EndIf EndIf EndSelect Until gQuit EndIf ; IDE Options = PureBasic 5.40 LTS (Linux - x64) ; CursorPosition = 28 ; FirstLine = 19 ; EnableUnicode ; EnableXP ; CurrentDirectory = /home/charly-xubuntu/Programming/PureBasic/purebasic/